[llvm] r286668 - [InstCombine] update test to use FileCheck; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 11 15:12:47 PST 2016


Author: spatel
Date: Fri Nov 11 17:12:46 2016
New Revision: 286668

URL: http://llvm.org/viewvc/llvm-project?rev=286668&view=rev
Log:
[InstCombine] update test to use FileCheck; NFC

Modified:
    llvm/trunk/test/Transforms/InstCombine/udiv_select_to_select_shift.ll

Modified: llvm/trunk/test/Transforms/InstCombine/udiv_select_to_select_shift.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/udiv_select_to_select_shift.ll?rev=286668&r1=286667&r2=286668&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/udiv_select_to_select_shift.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/udiv_select_to_select_shift.ll Fri Nov 11 17:12:46 2016
@@ -1,17 +1,21 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -instcombine -S | FileCheck %s
+
 ; Test that this transform works:
 ; udiv X, (Select Cond, C1, C2) --> Select Cond, (shr X, C1), (shr X, C2)
-;
-; RUN: opt < %s -instcombine -S -o %t
-; RUN:   not grep select %t
-; RUN:   grep lshr %t | count 2
-; RUN:   not grep udiv %t
 
 define i64 @test(i64 %X, i1 %Cond ) {
-entry:
-        %divisor1 = select i1 %Cond, i64 16, i64 8
-        %quotient1 = udiv i64 %X, %divisor1
-        %divisor2 = select i1 %Cond, i64 8, i64 0
-        %quotient2 = udiv i64 %X, %divisor2
-        %sum = add i64 %quotient1, %quotient2
-        ret i64 %sum
+; CHECK-LABEL: @test(
+; CHECK-NEXT:    [[QUOTIENT1:%.*]] = lshr i64 %X, 4
+; CHECK-NEXT:    [[QUOTIENT2:%.*]] = lshr i64 %X, 3
+; CHECK-NEXT:    [[SUM:%.*]] = add nuw nsw i64 [[QUOTIENT1]], [[QUOTIENT2]]
+; CHECK-NEXT:    ret i64 [[SUM]]
+;
+  %divisor1 = select i1 %Cond, i64 16, i64 8
+  %quotient1 = udiv i64 %X, %divisor1
+  %divisor2 = select i1 %Cond, i64 8, i64 0
+  %quotient2 = udiv i64 %X, %divisor2
+  %sum = add i64 %quotient1, %quotient2
+  ret i64 %sum
 }
+




More information about the llvm-commits mailing list