[llvm] 6984781 - [NFC][SimplifyCFG] Add a test with an undef cond branch to identical destinations

Roman Lebedev via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 7 15:16:19 PST 2021


Author: Roman Lebedev
Date: 2021-01-08T02:15:26+03:00
New Revision: 6984781df9b584febce51b7740c8738a076f5692

URL: https://github.com/llvm/llvm-project/commit/6984781df9b584febce51b7740c8738a076f5692
DIFF: https://github.com/llvm/llvm-project/commit/6984781df9b584febce51b7740c8738a076f5692.diff

LOG: [NFC][SimplifyCFG] Add a test with an undef cond branch to identical destinations

Added: 
    llvm/test/Transforms/SimplifyCFG/change-to-unreachable-matching-successor.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/SimplifyCFG/change-to-unreachable-matching-successor.ll b/llvm/test/Transforms/SimplifyCFG/change-to-unreachable-matching-successor.ll
new file mode 100644
index 000000000000..4fd017d6780f
--- /dev/null
+++ b/llvm/test/Transforms/SimplifyCFG/change-to-unreachable-matching-successor.ll
@@ -0,0 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S < %s | FileCheck %s
+
+declare void @llvm.assume(i1)
+
+define void @fn(i1 %c) {
+; CHECK-LABEL: @fn(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    unreachable
+;
+entry:
+  call void @llvm.assume(i1 undef)
+  br i1 %c, label %bb1, label %bb1
+bb1:
+  ret void
+}


        


More information about the llvm-commits mailing list