[llvm] c1bfa41 - [ConstraintElimination] Add test for debug printing.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 3 12:57:03 PDT 2022
Author: Florian Hahn
Date: 2022-10-03T20:56:39+01:00
New Revision: c1bfa414284f887f3f0b5709ebbd281dc3ccc34f
URL: https://github.com/llvm/llvm-project/commit/c1bfa414284f887f3f0b5709ebbd281dc3ccc34f
DIFF: https://github.com/llvm/llvm-project/commit/c1bfa414284f887f3f0b5709ebbd281dc3ccc34f.diff
LOG: [ConstraintElimination] Add test for debug printing.
Added:
llvm/test/Transforms/ConstraintElimination/debug.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/ConstraintElimination/debug.ll b/llvm/test/Transforms/ConstraintElimination/debug.ll
new file mode 100644
index 0000000000000..c4eb291667436
--- /dev/null
+++ b/llvm/test/Transforms/ConstraintElimination/debug.ll
@@ -0,0 +1,32 @@
+; RUN: opt -passes=constraint-elimination -S -debug %s 2>&1 | FileCheck %s
+
+; REQUIRES: asserts
+
+declare void @use(i1)
+
+define i1 @test_and_ule(i4 %x, i4 %y, i4 %z) {
+; CHECK: Processing %c.1 = icmp ule i4 %x, %y
+; CHECK-NEXT: Adding 'ule %x, %y'
+; CHECK-NEXT: constraint: %x + -1 * %y <= 0
+
+; CHECK: Processing %c.2 = icmp ule i4 %y, %z
+; CHECK-NEXT: Adding 'ule %y, %z'
+; CHECK-NEXT: constraint: %y + -1 * %z <= 0
+
+; CHECK: Checking %t.1 = icmp ule i4 %x, %z
+; CHECK: Condition %t.1 = icmp ule i4 %x, %z implied by dominating constraints
+
+entry:
+ %c.1 = icmp ule i4 %x, %y
+ %c.2 = icmp ule i4 %y, %z
+ %and = and i1 %c.1, %c.2
+ br i1 %and, label %bb1, label %exit
+
+bb1:
+ %t.1 = icmp ule i4 %x, %z
+ ret i1 %t.1
+
+exit:
+ %c.3 = icmp ule i4 %x, %z
+ ret i1 %c.3
+}
More information about the llvm-commits
mailing list