diff options
| author | Eli Friedman <efriedma@codeaurora.org> | 2018-07-19 23:02:07 +0000 |
|---|---|---|
| committer | Eli Friedman <efriedma@codeaurora.org> | 2018-07-19 23:02:07 +0000 |
| commit | a3c78f59814f90a06994f720d75ecbae2612c4c3 (patch) | |
| tree | 54c89cd54b864769c320a9c1700657bf4ddf41db /llvm/test/Transforms/SCCP/ipsccp-branch-unresolved-undef.ll | |
| parent | 8995c5f0f617769edbfb3e7c8510957feaa27501 (diff) | |
| download | bcm5719-llvm-a3c78f59814f90a06994f720d75ecbae2612c4c3.tar.gz bcm5719-llvm-a3c78f59814f90a06994f720d75ecbae2612c4c3.zip | |
[SCCP] Don't use markForcedConstant on branch conditions.
It's more aggressive than we need to be, and leads to strange
workarounds in other places like call return value inference. Instead,
just directly mark an edge viable.
Tests by Florian Hahn.
Differential Revision: https://reviews.llvm.org/D49408
llvm-svn: 337507
Diffstat (limited to 'llvm/test/Transforms/SCCP/ipsccp-branch-unresolved-undef.ll')
| -rw-r--r-- | llvm/test/Transforms/SCCP/ipsccp-branch-unresolved-undef.ll | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SCCP/ipsccp-branch-unresolved-undef.ll b/llvm/test/Transforms/SCCP/ipsccp-branch-unresolved-undef.ll new file mode 100644 index 00000000000..7092b8d587a --- /dev/null +++ b/llvm/test/Transforms/SCCP/ipsccp-branch-unresolved-undef.ll @@ -0,0 +1,24 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: opt < %s -S -ipsccp | FileCheck %s + +define void @main() { +; CHECK-LABEL: @main( +; CHECK: %call = call i1 @patatino(i1 undef) +; CHECK-NEXT: ret void +; + %call = call i1 @patatino(i1 undef) + ret void +} + +define internal i1 @patatino(i1 %a) { +; CHECK-LABEL: define internal i1 @patatino( +; CHECK-NEXT: br label [[ONFALSE:%.*]] +; CHECK-EMPTY: +; CHECK-NEXT: onfalse: +; CHECK-NEXT: ret i1 undef + br i1 %a, label %ontrue, label %onfalse +ontrue: + ret i1 false +onfalse: + ret i1 false +} |

