Skip to content

Commit 3945574

Browse files
BrzVladradekdoulik
authored andcommitted
Avoid crashing in case of alias detection failure (#607)
Simply use the conservative may alias value instead.
1 parent 0cf0183 commit 3945574

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/CodeGen/ImplicitNullChecks.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,10 @@ ImplicitNullChecks::areMemoryOpsAliased(const MachineInstr &MI,
344344
for (MachineMemOperand *MMO1 : MI.memoperands()) {
345345
// MMO1 should have a value due it comes from operation we'd like to use
346346
// as implicit null check.
347-
assert(MMO1->getValue() && "MMO1 should have a Value!");
347+
//assert(MMO1->getValue() && "MMO1 should have a Value!");
348+
// Doesn't have a value, unclear why
349+
if (MMO1->getValue() == nullptr)
350+
return AR_MayAlias;
348351
for (MachineMemOperand *MMO2 : PrevMI->memoperands()) {
349352
if (const PseudoSourceValue *PSV = MMO2->getPseudoValue()) {
350353
if (PSV->mayAlias(MFI))

0 commit comments

Comments
 (0)