[llvm] r281621 - [InstCombine] auto-generate checks

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 08:48:53 PDT 2016


Author: spatel
Date: Thu Sep 15 10:48:53 2016
New Revision: 281621

URL: http://llvm.org/viewvc/llvm-project?rev=281621&view=rev
Log:
[InstCombine] auto-generate checks

Modified:
    llvm/trunk/test/Transforms/InstCombine/min-positive.ll

Modified: llvm/trunk/test/Transforms/InstCombine/min-positive.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/min-positive.ll?rev=281621&r1=281620&r2=281621&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/min-positive.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/min-positive.ll Thu Sep 15 10:48:53 2016
@@ -1,10 +1,13 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
 ; RUN: opt -S -instcombine < %s | FileCheck %s
 
 @g = external global i32
 
 define i1 @test(i32 %other) {
-; CHECK-LABEL: @test
-; CHECK: %test = icmp sgt i32 %other, 0
+; CHECK-LABEL: @test(
+; CHECK-NEXT:    [[TEST:%.*]] = icmp sgt i32 %other, 0
+; CHECK-NEXT:    ret i1 [[TEST]]
+;
   %positive = load i32, i32* @g, !range !{i32 1, i32 2048}
   %cmp = icmp slt i32 %positive, %other
   %sel = select i1 %cmp, i32 %positive, i32 %other
@@ -13,8 +16,10 @@ define i1 @test(i32 %other) {
 }
 
 define i1 @test2(i32 %other) {
-; CHECK-LABEL: @test2
-; CHECK: %test = icmp sgt i32 %other, 0
+; CHECK-LABEL: @test2(
+; CHECK-NEXT:    [[TEST:%.*]] = icmp sgt i32 %other, 0
+; CHECK-NEXT:    ret i1 [[TEST]]
+;
   %positive = load i32, i32* @g, !range !{i32 1, i32 2048}
   %cmp = icmp slt i32 %other, %positive
   %sel = select i1 %cmp, i32 %other, i32 %positive
@@ -24,8 +29,13 @@ define i1 @test2(i32 %other) {
 
 ; %positive might be zero
 define i1 @test3(i32 %other) {
-; CHECK-LABEL: @test3
-; CHECK: %test = icmp sgt i32 %sel, 0
+; CHECK-LABEL: @test3(
+; CHECK-NEXT:    [[POSITIVE:%.*]] = load i32, i32* @g, align 4, !range !0
+; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i32 [[POSITIVE]], %other
+; CHECK-NEXT:    [[SEL:%.*]] = select i1 [[CMP]], i32 [[POSITIVE]], i32 %other
+; CHECK-NEXT:    [[TEST:%.*]] = icmp sgt i32 [[SEL]], 0
+; CHECK-NEXT:    ret i1 [[TEST]]
+;
   %positive = load i32, i32* @g, !range !{i32 0, i32 2048}
   %cmp = icmp slt i32 %positive, %other
   %sel = select i1 %cmp, i32 %positive, i32 %other




More information about the llvm-commits mailing list