summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/SCCP/ipsccp-branch-unresolved-undef.ll
diff options
context:
space:
mode:
authorEli Friedman <efriedma@codeaurora.org>2018-07-19 23:02:07 +0000
committerEli Friedman <efriedma@codeaurora.org>2018-07-19 23:02:07 +0000
commita3c78f59814f90a06994f720d75ecbae2612c4c3 (patch)
tree54c89cd54b864769c320a9c1700657bf4ddf41db /llvm/test/Transforms/SCCP/ipsccp-branch-unresolved-undef.ll
parent8995c5f0f617769edbfb3e7c8510957feaa27501 (diff)
downloadbcm5719-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.ll24
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
+}
OpenPOWER on IntegriCloud