aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
authorDianQK <dianqk@dianqk.net>2023-02-19 21:08:29 +0800
committerDianQK <dianqk@dianqk.net>2023-02-19 21:08:29 +0800
commit1235ed913356d493563d730cb7997bcca633397d (patch)
tree537119e3e5163cebea395a6090b2251b61bbec75 /llvm/lib/Transforms/Utils/SimplifyCFG.cpp
parentb6eed9a82e0ce530d94a194c88615d6c272e1854 (diff)
downloadllvm-1235ed913356d493563d730cb7997bcca633397d.zip
llvm-1235ed913356d493563d730cb7997bcca633397d.tar.gz
llvm-1235ed913356d493563d730cb7997bcca633397d.tar.bz2
Revert "[SimplifyCFG] Check if the return instruction causes undefined behavior"
This reverts commit b6eed9a82e0ce530d94a194c88615d6c272e1854.
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 82ce8a6..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 !PtrValueMayBeModified;
- }
- }
-
// Look through bitcasts.
if (BitCastInst *BC = dyn_cast<BitCastInst>(Use))
return passingValueIsAlwaysUndefined(V, BC, PtrValueMayBeModified);