Skip to content

Commit

Permalink
Revert "[SimplifyCFG] Check if the return instruction causes undefine…
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybuka committed Feb 18, 2023
1 parent 8e3dc13 commit c23f29d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 100 deletions.
14 changes: 0 additions & 14 deletions llvm/lib/Transforms/Utils/SimplifyCFG.cpp
Expand Up @@ -7126,20 +7126,6 @@ static bool passingValueIsAlwaysUndefined(Value *V, Instruction *I, bool PtrValu
return passingValueIsAlwaysUndefined(V, GEP, PtrValueMayBeModified);
}

// Look through return.
if (ReturnInst *Ret = dyn_cast<ReturnInst>(Use)) {
bool HasNoUndefAttr =
Ret->getFunction()->hasRetAttribute(Attribute::NoUndef);
// Return undefined to a noundef return value is undefined.
if (isa<UndefValue>(C) && HasNoUndefAttr)
return true;
// Return null to a nonnull+noundef return value is undefined.
if (C->isNullValue() && HasNoUndefAttr &&
Ret->getFunction()->hasRetAttribute(Attribute::NonNull)) {
return true;
}
}

// Look through bitcasts.
if (BitCastInst *BC = dyn_cast<BitCastInst>(Use))
return passingValueIsAlwaysUndefined(V, BC, PtrValueMayBeModified);
Expand Down
86 changes: 0 additions & 86 deletions llvm/test/Transforms/SimplifyCFG/unreachable-eliminate-on-ret.ll

This file was deleted.

0 comments on commit c23f29d

Please sign in to comment.