Skip to content

Commit f9a8d70

Browse files
aemersoncuviper
authored andcommitted
[[GlobalISel][IRTranslator] Fix a crash when the use of an extractvalue is a non-dominated metadata use.
We don't expect uses to come before defs in the CFG, so allocateVRegs() asserted. Fixes PR48211
1 parent effbce6 commit f9a8d70

File tree

2 files changed

+403
-1
lines changed

2 files changed

+403
-1
lines changed

llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ void IRTranslator::getAnalysisUsage(AnalysisUsage &AU) const {
160160

161161
IRTranslator::ValueToVRegInfo::VRegListT &
162162
IRTranslator::allocateVRegs(const Value &Val) {
163-
assert(!VMap.contains(Val) && "Value already allocated in VMap");
163+
auto VRegsIt = VMap.findVRegs(Val);
164+
if (VRegsIt != VMap.vregs_end())
165+
return *VRegsIt->second;
164166
auto *Regs = VMap.getVRegs(Val);
165167
auto *Offsets = VMap.getOffsets(Val);
166168
SmallVector<LLT, 4> SplitTys;

0 commit comments

Comments
 (0)