diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 8d4c8802f71ce0..208de4b73d9167 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1040,7 +1040,7 @@ static SDValue combineShiftToAVG(SDValue Op, SelectionDAG &DAG, EVT VT = Op.getValueType(); unsigned MinWidth = std::max(VT.getScalarSizeInBits() - KnownBits, 8); - EVT NVT = EVT::getIntegerVT(*DAG.getContext(), PowerOf2Ceil(MinWidth)); + EVT NVT = EVT::getIntegerVT(*DAG.getContext(), llvm::bit_ceil(MinWidth)); if (VT.isVector()) NVT = EVT::getVectorVT(*DAG.getContext(), NVT, VT.getVectorElementCount()); if (!TLI.isOperationLegalOrCustom(AVGOpc, NVT)) diff --git a/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp b/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp index 2639f1f4556519..b0c5df50b72b55 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp @@ -2137,7 +2137,7 @@ static int sizeToSubRegIndex(unsigned Size) { return AMDGPU::sub0; if (Size > 256) return -1; - return sizeToSubRegIndex(PowerOf2Ceil(Size)); + return sizeToSubRegIndex(llvm::bit_ceil(Size)); } } diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index a33ee63c877ee3..4c463dae0a0046 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -37707,7 +37707,7 @@ X86TargetLowering::targetShrinkDemandedConstant(SDValue Op, return false; // Find the next power of 2 width, rounding up to a byte. - Width = PowerOf2Ceil(std::max(Width, 8U)); + Width = llvm::bit_ceil(std::max(Width, 8U)); // Truncate the width to size to handle illegal types. Width = std::min(Width, EltSize);