[llvm] r340660 - [CVP] Extend tests to illustrate an old patch isn't needed
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 24 14:56:43 PDT 2018
Author: reames
Date: Fri Aug 24 14:56:43 2018
New Revision: 340660
URL: http://llvm.org/viewvc/llvm-project?rev=340660&view=rev
Log:
[CVP] Extend tests to illustrate an old patch isn't needed
Back in https://reviews.llvm.org/D19559, I tried to teach CVP about range facts implied by value/value icmps (i.e. no constants.) In the meantime, we've implemented the optimization, but I couldn't find tests checked in, so adding them.
Modified:
llvm/trunk/test/Transforms/CorrelatedValuePropagation/range.ll
Modified: llvm/trunk/test/Transforms/CorrelatedValuePropagation/range.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/CorrelatedValuePropagation/range.ll?rev=340660&r1=340659&r2=340660&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/CorrelatedValuePropagation/range.ll (original)
+++ llvm/trunk/test/Transforms/CorrelatedValuePropagation/range.ll Fri Aug 24 14:56:43 2018
@@ -603,3 +603,45 @@ exit:
exit2:
ret i1 false
}
+
+define i1 @slt(i8 %a, i8 %b) {
+; CHECK-LABEL: @slt(
+; CHECK: ret i1 true
+entry:
+ %cmp = icmp slt i8 %a, %b
+ call void @llvm.assume(i1 %cmp)
+ %res = icmp slt i8 %a, 127
+ ret i1 %res
+}
+
+define i1 @sgt(i8 %a, i8 %b) {
+; CHECK-LABEL: @sgt(
+; CHECK: ret i1 true
+entry:
+ %cmp = icmp sgt i8 %a, %b
+ call void @llvm.assume(i1 %cmp)
+ %res = icmp sgt i8 %a, -128
+ ret i1 %res
+}
+
+define i1 @ult(i8 %a, i8 %b) {
+; CHECK-LABEL: @ult(
+; CHECK: ret i1 true
+entry:
+ %cmp = icmp ult i8 %a, %b
+ call void @llvm.assume(i1 %cmp)
+ %res = icmp ult i8 %a, 255
+ ret i1 %res
+}
+
+define i1 @ugt(i8 %a, i8 %b) {
+; CHECK-LABEL: @ugt(
+; CHECK: ret i1 true
+entry:
+ %cmp = icmp ugt i8 %a, %b
+ call void @llvm.assume(i1 %cmp)
+ %res = icmp ugt i8 %a, 0
+ ret i1 %res
+}
+
+declare void @llvm.assume(i1)
More information about the llvm-commits
mailing list