[llvm] 31e29d4 - AMDGPU/GlobalISel: Make use of MachineIRBuilder helper functions. NFC.
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 31 05:53:50 PST 2020
Author: Jay Foad
Date: 2020-01-31T13:53:39Z
New Revision: 31e29d4afe02278415fb5b898035146b19c1220d
URL: https://github.com/llvm/llvm-project/commit/31e29d4afe02278415fb5b898035146b19c1220d
DIFF: https://github.com/llvm/llvm-project/commit/31e29d4afe02278415fb5b898035146b19c1220d.diff
LOG: AMDGPU/GlobalISel: Make use of MachineIRBuilder helper functions. NFC.
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
index 3e33b155cda1..47453e294827 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
@@ -1235,10 +1235,7 @@ Register AMDGPULegalizerInfo::getSegmentAperture(
MRI.setType(GetReg, S32);
auto ShiftAmt = B.buildConstant(S32, WidthM1 + 1);
- B.buildInstr(TargetOpcode::G_SHL)
- .addDef(ApertureReg)
- .addUse(GetReg)
- .addUse(ShiftAmt.getReg(0));
+ B.buildShl(ApertureReg, GetReg, ShiftAmt);
return ApertureReg;
}
@@ -1365,9 +1362,7 @@ bool AMDGPULegalizerInfo::legalizeAddrSpaceCast(
// Coerce the type of the low half of the result so we can use merge_values.
Register SrcAsInt = MRI.createGenericVirtualRegister(S32);
- B.buildInstr(TargetOpcode::G_PTRTOINT)
- .addDef(SrcAsInt)
- .addUse(Src);
+ B.buildPtrToInt(SrcAsInt, Src);
// TODO: Should we allow mismatched types but matching sizes in merges to
// avoid the ptrtoint?
@@ -1420,7 +1415,7 @@ bool AMDGPULegalizerInfo::legalizeFceil(
// if (src > 0.0 && src != result)
// result += 1.0
- auto Trunc = B.buildInstr(TargetOpcode::G_INTRINSIC_TRUNC, {S64}, {Src});
+ auto Trunc = B.buildIntrinsicTrunc(S64, Src);
const auto Zero = B.buildFConstant(S64, 0.0);
const auto One = B.buildFConstant(S64, 1.0);
More information about the llvm-commits
mailing list