[llvm] 6a7b6dd - AMDGPU: Don't assert in canInsertSelect
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 28 18:01:14 PDT 2020
Author: Matt Arsenault
Date: 2020-07-28T21:01:06-04:00
New Revision: 6a7b6dd54b207945ba4b3750496036c6280ab522
URL: https://github.com/llvm/llvm-project/commit/6a7b6dd54b207945ba4b3750496036c6280ab522
DIFF: https://github.com/llvm/llvm-project/commit/6a7b6dd54b207945ba4b3750496036c6280ab522.diff
LOG: AMDGPU: Don't assert in canInsertSelect
Currently GlobalISel doesn't force all VGPR phi operands to VGPRs, so
this hit a case where it was queried with a VGPR and SGPR. This could
arguably be a verifier error, but it's currently not.
Added:
Modified:
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
index 5d7cd5ffc4ce..59915cb48324 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -2392,7 +2392,8 @@ bool SIInstrInfo::canInsertSelect(const MachineBasicBlock &MBB,
case VCCZ: {
const MachineRegisterInfo &MRI = MBB.getParent()->getRegInfo();
const TargetRegisterClass *RC = MRI.getRegClass(TrueReg);
- assert(MRI.getRegClass(FalseReg) == RC);
+ if (MRI.getRegClass(FalseReg) != RC)
+ return false;
int NumInsts = AMDGPU::getRegBitWidth(RC->getID()) / 32;
CondCycles = TrueCycles = FalseCycles = NumInsts; // ???
@@ -2406,7 +2407,8 @@ bool SIInstrInfo::canInsertSelect(const MachineBasicBlock &MBB,
// with a vector one.
const MachineRegisterInfo &MRI = MBB.getParent()->getRegInfo();
const TargetRegisterClass *RC = MRI.getRegClass(TrueReg);
- assert(MRI.getRegClass(FalseReg) == RC);
+ if (MRI.getRegClass(FalseReg) != RC)
+ return false;
int NumInsts = AMDGPU::getRegBitWidth(RC->getID()) / 32;
More information about the llvm-commits
mailing list