[llvm] 62d1fb8 - AMDGPU/GlobalISel: Use unmerge instead of extract in addrspace queries
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 08:07:59 PDT 2020
Author: Matt Arsenault
Date: 2020-08-24T11:07:51-04:00
New Revision: 62d1fb828f918fef0c139028fed6e81c5ba1fa41
URL: https://github.com/llvm/llvm-project/commit/62d1fb828f918fef0c139028fed6e81c5ba1fa41
DIFF: https://github.com/llvm/llvm-project/commit/62d1fb828f918fef0c139028fed6e81c5ba1fa41.diff
LOG: AMDGPU/GlobalISel: Use unmerge instead of extract in addrspace queries
This is a bit more consistent with regular operation legalization.
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 17ac0c026912..7734d11fb2a5 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
@@ -3442,7 +3442,9 @@ bool AMDGPULegalizerInfo::legalizeIsAddrSpace(MachineInstr &MI,
MachineIRBuilder &B,
unsigned AddrSpace) const {
Register ApertureReg = getSegmentAperture(AddrSpace, MRI, B);
- auto Hi32 = B.buildExtract(LLT::scalar(32), MI.getOperand(2).getReg(), 32);
+ auto Unmerge = B.buildUnmerge(LLT::scalar(32), MI.getOperand(2).getReg());
+ Register Hi32 = Unmerge.getReg(1);
+
B.buildICmp(ICmpInst::ICMP_EQ, MI.getOperand(0), Hi32, ApertureReg);
MI.eraseFromParent();
return true;
More information about the llvm-commits
mailing list