[PATCH] D19245: [SimplifyCFG] Fold `llvm.guard(false)` to unreachable

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 20:58:28 PDT 2016


reames accepted this revision.
reames added a reviewer: reames.
reames added a comment.
This revision is now accepted and ready to land.

LGTM w/remaining comments from David and my own addressed.


================
Comment at: test/Transforms/SimplifyCFG/guards.ll:12
@@ +11,3 @@
+entry:
+  br i1 %c, label %true, label %false
+
----------------
I believe this branch is redundant?

================
Comment at: test/Transforms/SimplifyCFG/guards.ll:23
@@ +22,3 @@
+define i32 @f_1(i1 %c) {
+; Demonstrate that we do not yet simplify a guard on undef
+
----------------
Clarify: and do not want to.

Also, add a test case for guard(true) just as a sanity check!

================
Comment at: test/Transforms/SimplifyCFG/guards.ll:45
@@ +44,3 @@
+
+true:
+  call void(i1, ...) @llvm.experimental.guard(i1 false) [ "deopt"() ]
----------------
Naming wise: true, false are confusing.  Possibly: dead_via_guard and merge?  Applies to all tests.


http://reviews.llvm.org/D19245





More information about the llvm-commits mailing list