Skip to content

Commit

Permalink
Avoid crashing in case of alias detection failure (#607)
Browse files Browse the repository at this point in the history
Simply use the conservative may alias value instead.
  • Loading branch information
BrzVlad authored Aug 1, 2024
1 parent 8d2ed27 commit b9b4464
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion llvm/lib/CodeGen/ImplicitNullChecks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,10 @@ ImplicitNullChecks::areMemoryOpsAliased(const MachineInstr &MI,
for (MachineMemOperand *MMO1 : MI.memoperands()) {
// MMO1 should have a value due it comes from operation we'd like to use
// as implicit null check.
assert(MMO1->getValue() && "MMO1 should have a Value!");
//assert(MMO1->getValue() && "MMO1 should have a Value!");
// Doesn't have a value, unclear why
if (MMO1->getValue() == nullptr)
return AR_MayAlias;
for (MachineMemOperand *MMO2 : PrevMI->memoperands()) {
if (const PseudoSourceValue *PSV = MMO2->getPseudoValue()) {
if (PSV->mayAlias(MFI))
Expand Down

0 comments on commit b9b4464

Please sign in to comment.