aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2023-02-18 12:21:10 -0800
committerVitaly Buka <vitalybuka@google.com>2023-02-18 12:21:10 -0800
commitc23f29d6f05b1fe4fa2dd50cbb78ee2b30e0de4d (patch)
tree5e50ed2df6da1c997d373854ff9038485e5b8c9a /llvm/lib/Transforms/Utils/SimplifyCFG.cpp
parent8e3dc1366fb8365c4beb394ef2d34f1c639e8064 (diff)
downloadllvm-c23f29d6f05b1fe4fa2dd50cbb78ee2b30e0de4d.zip
llvm-c23f29d6f05b1fe4fa2dd50cbb78ee2b30e0de4d.tar.gz
llvm-c23f29d6f05b1fe4fa2dd50cbb78ee2b30e0de4d.tar.bz2
Revert "[SimplifyCFG] Check if the return instruction causes undefined behavior"
Breaks bots https://lab.llvm.org/buildbot/#/builders/236/builds/2349 https://lab.llvm.org/buildbot/#/builders/74/builds/17361 https://lab.llvm.org/buildbot/#/builders/168/builds/11972 This reverts commit 7be55b007698f6b6398cbbea69c327b5a971938a.
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index f6d3022..372a669 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -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);