From feabdd18d9813a2439fb811b4eaf2bb6b3778e5e Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Mon, 13 Nov 2017 19:46:28 +0000 Subject: [PATCH] [Reassociation] regenerate test checks; NFC llvm-svn: 318076 --- .../Reassociate/fast-ReassociateVector.ll | 109 +++++++++++---------- 1 file changed, 55 insertions(+), 54 deletions(-) diff --git a/llvm/test/Transforms/Reassociate/fast-ReassociateVector.ll b/llvm/test/Transforms/Reassociate/fast-ReassociateVector.ll index bf7f703..95cee06 100644 --- a/llvm/test/Transforms/Reassociate/fast-ReassociateVector.ll +++ b/llvm/test/Transforms/Reassociate/fast-ReassociateVector.ll @@ -1,12 +1,13 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -reassociate -S | FileCheck %s ; Check that a*c+b*c is turned into (a+b)*c define <4 x float> @test1(<4 x float> %a, <4 x float> %b, <4 x float> %c) { ; CHECK-LABEL: @test1( -; CHECK-NEXT: [[TMP:%.*]] = fadd fast <4 x float> %b, %a -; CHECK-NEXT: [[TMP1:%.*]] = fmul fast <4 x float> [[TMP]], %c -; CHECK-NEXT: ret <4 x float> [[TMP1]] +; CHECK-NEXT: [[REASS_ADD:%.*]] = fadd fast <4 x float> [[B:%.*]], [[A:%.*]] +; CHECK-NEXT: [[REASS_MUL:%.*]] = fmul fast <4 x float> [[REASS_ADD]], [[C:%.*]] +; CHECK-NEXT: ret <4 x float> [[REASS_MUL]] ; %mul = fmul fast <4 x float> %a, %c %mul1 = fmul fast <4 x float> %b, %c @@ -18,8 +19,8 @@ define <4 x float> @test1(<4 x float> %a, <4 x float> %b, <4 x float> %c) { define <4 x float> @test1_reassoc(<4 x float> %a, <4 x float> %b, <4 x float> %c) { ; CHECK-LABEL: @test1_reassoc( -; CHECK-NEXT: [[MUL:%.*]] = fmul reassoc <4 x float> %a, %c -; CHECK-NEXT: [[MUL1:%.*]] = fmul reassoc <4 x float> %b, %c +; CHECK-NEXT: [[MUL:%.*]] = fmul reassoc <4 x float> [[A:%.*]], [[C:%.*]] +; CHECK-NEXT: [[MUL1:%.*]] = fmul reassoc <4 x float> [[B:%.*]], [[C]] ; CHECK-NEXT: [[ADD:%.*]] = fadd reassoc <4 x float> [[MUL]], [[MUL1]] ; CHECK-NEXT: ret <4 x float> [[ADD]] ; @@ -33,10 +34,10 @@ define <4 x float> @test1_reassoc(<4 x float> %a, <4 x float> %b, <4 x float> %c define <2 x float> @test2(<2 x float> %a, <2 x float> %b, <2 x float> %c) { ; CHECK-LABEL: @test2( -; CHECK-NEXT: [[TMP2:%.*]] = fadd fast <2 x float> %c, %b -; CHECK-NEXT: [[TMP3:%.*]] = fmul fast <2 x float> %a, %a -; CHECK-NEXT: [[TMP1:%.*]] = fmul fast <2 x float> [[TMP3]], [[TMP2]] -; CHECK-NEXT: ret <2 x float> [[TMP1]] +; CHECK-NEXT: [[REASS_ADD1:%.*]] = fadd fast <2 x float> [[C:%.*]], [[B:%.*]] +; CHECK-NEXT: [[REASS_MUL2:%.*]] = fmul fast <2 x float> [[A:%.*]], [[A]] +; CHECK-NEXT: [[REASS_MUL:%.*]] = fmul fast <2 x float> [[REASS_MUL2]], [[REASS_ADD1]] +; CHECK-NEXT: ret <2 x float> [[REASS_MUL]] ; %t0 = fmul fast <2 x float> %a, %b %t1 = fmul fast <2 x float> %a, %t0 @@ -50,10 +51,10 @@ define <2 x float> @test2(<2 x float> %a, <2 x float> %b, <2 x float> %c) { define <2 x float> @test2_reassoc(<2 x float> %a, <2 x float> %b, <2 x float> %c) { ; CHECK-LABEL: @test2_reassoc( -; CHECK-NEXT: [[T0:%.*]] = fmul reassoc <2 x float> %a, %b -; CHECK-NEXT: [[T1:%.*]] = fmul reassoc <2 x float> %a, [[T0]] -; CHECK-NEXT: [[T2:%.*]] = fmul reassoc <2 x float> %a, %c -; CHECK-NEXT: [[T3:%.*]] = fmul reassoc <2 x float> %a, [[T2]] +; CHECK-NEXT: [[T0:%.*]] = fmul reassoc <2 x float> [[A:%.*]], [[B:%.*]] +; CHECK-NEXT: [[T1:%.*]] = fmul reassoc <2 x float> [[A]], [[T0]] +; CHECK-NEXT: [[T2:%.*]] = fmul reassoc <2 x float> [[A]], [[C:%.*]] +; CHECK-NEXT: [[T3:%.*]] = fmul reassoc <2 x float> [[A]], [[T2]] ; CHECK-NEXT: [[T4:%.*]] = fadd reassoc <2 x float> [[T1]], [[T3]] ; CHECK-NEXT: ret <2 x float> [[T4]] ; @@ -69,9 +70,9 @@ define <2 x float> @test2_reassoc(<2 x float> %a, <2 x float> %b, <2 x float> %c define <2 x double> @test3(<2 x double> %a, <2 x double> %b, <2 x double> %c, <2 x double> %d) { ; CHECK-LABEL: @test3( -; CHECK-NEXT: [[TMP:%.*]] = fadd fast <2 x double> %c, %b -; CHECK-NEXT: [[TMP1:%.*]] = fmul fast <2 x double> [[TMP]], %a -; CHECK-NEXT: [[T3:%.*]] = fadd fast <2 x double> [[TMP1]], %d +; CHECK-NEXT: [[REASS_ADD:%.*]] = fadd fast <2 x double> [[C:%.*]], [[B:%.*]] +; CHECK-NEXT: [[REASS_MUL:%.*]] = fmul fast <2 x double> [[REASS_ADD]], [[A:%.*]] +; CHECK-NEXT: [[T3:%.*]] = fadd fast <2 x double> [[REASS_MUL]], [[D:%.*]] ; CHECK-NEXT: ret <2 x double> [[T3]] ; %t0 = fmul fast <2 x double> %a, %b @@ -85,9 +86,9 @@ define <2 x double> @test3(<2 x double> %a, <2 x double> %b, <2 x double> %c, <2 define <2 x double> @test3_reassoc(<2 x double> %a, <2 x double> %b, <2 x double> %c, <2 x double> %d) { ; CHECK-LABEL: @test3_reassoc( -; CHECK-NEXT: [[T0:%.*]] = fmul reassoc <2 x double> %a, %b -; CHECK-NEXT: [[T1:%.*]] = fmul reassoc <2 x double> %a, %c -; CHECK-NEXT: [[T2:%.*]] = fadd reassoc <2 x double> [[T1]], %d +; CHECK-NEXT: [[T0:%.*]] = fmul reassoc <2 x double> [[A:%.*]], [[B:%.*]] +; CHECK-NEXT: [[T1:%.*]] = fmul reassoc <2 x double> [[A]], [[C:%.*]] +; CHECK-NEXT: [[T2:%.*]] = fadd reassoc <2 x double> [[T1]], [[D:%.*]] ; CHECK-NEXT: [[T3:%.*]] = fadd reassoc <2 x double> [[T0]], [[T2]] ; CHECK-NEXT: ret <2 x double> [[T3]] ; @@ -102,8 +103,8 @@ define <2 x double> @test3_reassoc(<2 x double> %a, <2 x double> %b, <2 x double define <2 x float> @test4(<2 x float> %A) { ; CHECK-LABEL: @test4( -; CHECK-NEXT: [[X:%.*]] = fadd <2 x float> %A, -; CHECK-NEXT: [[Y:%.*]] = fadd <2 x float> %A, +; CHECK-NEXT: [[X:%.*]] = fadd <2 x float> [[A:%.*]], +; CHECK-NEXT: [[Y:%.*]] = fadd <2 x float> [[A]], ; CHECK-NEXT: [[R:%.*]] = fsub <2 x float> [[X]], [[Y]] ; CHECK-NEXT: ret <2 x float> [[R]] ; @@ -117,7 +118,7 @@ define <2 x float> @test4(<2 x float> %A) { define <2 x float> @test5(<2 x float> %X) { ; CHECK-LABEL: @test5( -; CHECK-NEXT: [[FACTOR:%.*]] = fmul fast <2 x float> %X, +; CHECK-NEXT: [[FACTOR:%.*]] = fmul fast <2 x float> [[X:%.*]], ; CHECK-NEXT: ret <2 x float> [[FACTOR]] ; %Y = fmul fast <2 x float> %X, @@ -129,7 +130,7 @@ define <2 x float> @test5(<2 x float> %X) { define <2 x float> @test5_reassoc(<2 x float> %X) { ; CHECK-LABEL: @test5_reassoc( -; CHECK-NEXT: [[Y:%.*]] = fmul reassoc <2 x float> %X, +; CHECK-NEXT: [[Y:%.*]] = fmul reassoc <2 x float> [[X:%.*]], ; CHECK-NEXT: [[Z:%.*]] = fadd reassoc <2 x float> [[Y]], [[Y]] ; CHECK-NEXT: ret <2 x float> [[Z]] ; @@ -142,7 +143,7 @@ define <2 x float> @test5_reassoc(<2 x float> %X) { define <2 x float> @test6(<2 x float> %X) { ; CHECK-LABEL: @test6( -; CHECK-NEXT: [[FACTOR:%.*]] = fmul fast <2 x float> %X, +; CHECK-NEXT: [[FACTOR:%.*]] = fmul fast <2 x float> [[X:%.*]], ; CHECK-NEXT: ret <2 x float> [[FACTOR]] ; %Y = fadd fast <2 x float> %X ,%X @@ -154,8 +155,8 @@ define <2 x float> @test6(<2 x float> %X) { define <2 x float> @test6_reassoc(<2 x float> %X) { ; CHECK-LABEL: @test6_reassoc( -; CHECK-NEXT: [[Y:%.*]] = fadd reassoc <2 x float> %X, %X -; CHECK-NEXT: [[Z:%.*]] = fadd reassoc <2 x float> %X, [[Y]] +; CHECK-NEXT: [[Y:%.*]] = fadd reassoc <2 x float> [[X:%.*]], [[X]] +; CHECK-NEXT: [[Z:%.*]] = fadd reassoc <2 x float> [[X]], [[Y]] ; CHECK-NEXT: ret <2 x float> [[Z]] ; %Y = fadd reassoc <2 x float> %X ,%X @@ -167,8 +168,8 @@ define <2 x float> @test6_reassoc(<2 x float> %X) { define <2 x double> @test7(<2 x double> %W) { ; CHECK-LABEL: @test7( -; CHECK-NEXT: [[TMP1:%.*]] = fmul fast <2 x double> %W, -; CHECK-NEXT: ret <2 x double> [[TMP1]] +; CHECK-NEXT: [[REASS_MUL:%.*]] = fmul fast <2 x double> [[W:%.*]], +; CHECK-NEXT: ret <2 x double> [[REASS_MUL]] ; %X = fmul fast <2 x double> %W, %Y = fmul fast <2 x double> %W, @@ -180,8 +181,8 @@ define <2 x double> @test7(<2 x double> %W) { define <2 x double> @test7_reassoc(<2 x double> %W) { ; CHECK-LABEL: @test7_reassoc( -; CHECK-NEXT: [[X:%.*]] = fmul reassoc <2 x double> %W, -; CHECK-NEXT: [[Y:%.*]] = fmul reassoc <2 x double> %W, +; CHECK-NEXT: [[X:%.*]] = fmul reassoc <2 x double> [[W:%.*]], +; CHECK-NEXT: [[Y:%.*]] = fmul reassoc <2 x double> [[W]], ; CHECK-NEXT: [[Z:%.*]] = fadd reassoc <2 x double> [[Y]], [[X]] ; CHECK-NEXT: ret <2 x double> [[Z]] ; @@ -195,7 +196,7 @@ define <2 x double> @test7_reassoc(<2 x double> %W) { define <2 x float> @test8(<2 x float> %arg) { ; CHECK-LABEL: @test8( -; CHECK-NEXT: [[TMP2:%.*]] = fmul fast <2 x float> %arg, +; CHECK-NEXT: [[TMP2:%.*]] = fmul fast <2 x float> [[ARG:%.*]], ; CHECK-NEXT: ret <2 x float> [[TMP2]] ; %tmp1 = fmul fast <2 x float> , %arg @@ -207,7 +208,7 @@ define <2 x float> @test8(<2 x float> %arg) { define <2 x float> @test8_reassoc(<2 x float> %arg) { ; CHECK-LABEL: @test8_reassoc( -; CHECK-NEXT: [[TMP1:%.*]] = fmul reassoc <2 x float> %arg, +; CHECK-NEXT: [[TMP1:%.*]] = fmul reassoc <2 x float> [[ARG:%.*]], ; CHECK-NEXT: [[TMP2:%.*]] = fmul reassoc <2 x float> [[TMP1]], ; CHECK-NEXT: ret <2 x float> [[TMP2]] ; @@ -220,8 +221,8 @@ define <2 x float> @test8_reassoc(<2 x float> %arg) { define <2 x double> @test9(<2 x double> %b, <2 x double> %a) { ; CHECK-LABEL: @test9( -; CHECK-NEXT: [[TMP1:%.*]] = fsub fast <2 x double> zeroinitializer, %a -; CHECK-NEXT: [[TMP2:%.*]] = fadd fast <2 x double> %b, +; CHECK-NEXT: [[TMP1:%.*]] = fsub fast <2 x double> zeroinitializer, [[A:%.*]] +; CHECK-NEXT: [[TMP2:%.*]] = fadd fast <2 x double> [[B:%.*]], ; CHECK-NEXT: ret <2 x double> [[TMP2]] ; %1 = fadd fast <2 x double> %a, @@ -235,9 +236,9 @@ define <2 x double> @test9(<2 x double> %b, <2 x double> %a) { define <2 x double> @test9_reassoc(<2 x double> %b, <2 x double> %a) { ; CHECK-LABEL: @test9_reassoc( -; CHECK-NEXT: [[TMP1:%.*]] = fadd reassoc <2 x double> %a, -; CHECK-NEXT: [[TMP2:%.*]] = fadd reassoc <2 x double> %b, [[TMP1]] -; CHECK-NEXT: [[TMP3:%.*]] = fsub reassoc <2 x double> zeroinitializer, %a +; CHECK-NEXT: [[TMP1:%.*]] = fadd reassoc <2 x double> [[A:%.*]], +; CHECK-NEXT: [[TMP2:%.*]] = fadd reassoc <2 x double> [[B:%.*]], [[TMP1]] +; CHECK-NEXT: [[TMP3:%.*]] = fsub reassoc <2 x double> zeroinitializer, [[A]] ; CHECK-NEXT: [[TMP4:%.*]] = fadd reassoc <2 x double> [[TMP3]], [[TMP2]] ; CHECK-NEXT: ret <2 x double> [[TMP4]] ; @@ -253,8 +254,8 @@ define <2 x double> @test9_reassoc(<2 x double> %b, <2 x double> %a) { define <2 x float> @test10(<2 x float> %a, <2 x float> %b, <2 x float> %z) { ; CHECK-LABEL: @test10( ; CHECK-NEXT: [[TMP1:%.*]] = fsub fast <2 x float> zeroinitializer, zeroinitializer -; CHECK-NEXT: [[E:%.*]] = fmul fast <2 x float> %a, -; CHECK-NEXT: [[F:%.*]] = fmul fast <2 x float> [[E]], %z +; CHECK-NEXT: [[E:%.*]] = fmul fast <2 x float> [[A:%.*]], +; CHECK-NEXT: [[F:%.*]] = fmul fast <2 x float> [[E]], [[Z:%.*]] ; CHECK-NEXT: ret <2 x float> [[F]] ; %d = fmul fast <2 x float> %z, @@ -268,9 +269,9 @@ define <2 x float> @test10(<2 x float> %a, <2 x float> %b, <2 x float> %z) { define <2 x float> @test10_reassoc(<2 x float> %a, <2 x float> %b, <2 x float> %z) { ; CHECK-LABEL: @test10_reassoc( -; CHECK-NEXT: [[D:%.*]] = fmul reassoc <2 x float> %z, +; CHECK-NEXT: [[D:%.*]] = fmul reassoc <2 x float> [[Z:%.*]], ; CHECK-NEXT: [[C:%.*]] = fsub reassoc <2 x float> zeroinitializer, [[D]] -; CHECK-NEXT: [[E:%.*]] = fmul reassoc <2 x float> %a, [[C]] +; CHECK-NEXT: [[E:%.*]] = fmul reassoc <2 x float> [[A:%.*]], [[C]] ; CHECK-NEXT: [[F:%.*]] = fsub reassoc <2 x float> zeroinitializer, [[E]] ; CHECK-NEXT: ret <2 x float> [[F]] ; @@ -285,9 +286,9 @@ define <2 x float> @test10_reassoc(<2 x float> %a, <2 x float> %b, <2 x float> % define <2 x double> @test11(<2 x double> %x, <2 x double> %y) { ; CHECK-LABEL: @test11( -; CHECK-NEXT: [[FACTOR:%.*]] = fmul fast <2 x double> %x, -; CHECK-NEXT: [[TMP1:%.*]] = fmul fast <2 x double> [[FACTOR]], %y -; CHECK-NEXT: ret <2 x double> [[TMP1]] +; CHECK-NEXT: [[FACTOR:%.*]] = fmul fast <2 x double> [[X:%.*]], +; CHECK-NEXT: [[REASS_MUL:%.*]] = fmul fast <2 x double> [[FACTOR]], [[Y:%.*]] +; CHECK-NEXT: ret <2 x double> [[REASS_MUL]] ; %1 = fmul fast <2 x double> %x, %y %2 = fmul fast <2 x double> %y, %x @@ -299,8 +300,8 @@ define <2 x double> @test11(<2 x double> %x, <2 x double> %y) { define <2 x double> @test11_reassoc(<2 x double> %x, <2 x double> %y) { ; CHECK-LABEL: @test11_reassoc( -; CHECK-NEXT: [[TMP1:%.*]] = fmul reassoc <2 x double> %x, %y -; CHECK-NEXT: [[TMP2:%.*]] = fmul reassoc <2 x double> %x, %y +; CHECK-NEXT: [[TMP1:%.*]] = fmul reassoc <2 x double> [[X:%.*]], [[Y:%.*]] +; CHECK-NEXT: [[TMP2:%.*]] = fmul reassoc <2 x double> [[X]], [[Y]] ; CHECK-NEXT: [[TMP3:%.*]] = fadd reassoc <2 x double> [[TMP1]], [[TMP2]] ; CHECK-NEXT: ret <2 x double> [[TMP3]] ; @@ -314,7 +315,7 @@ define <2 x double> @test11_reassoc(<2 x double> %x, <2 x double> %y) { define <2 x i64> @test12(<2 x i64> %b, <2 x i64> %c) { ; CHECK-LABEL: @test12( -; CHECK-NEXT: [[MUL:%.*]] = mul <2 x i64> %c, %b +; CHECK-NEXT: [[MUL:%.*]] = mul <2 x i64> [[C:%.*]], [[B:%.*]] ; CHECK-NEXT: [[SHL:%.*]] = shl <2 x i64> [[MUL]], ; CHECK-NEXT: ret <2 x i64> [[SHL]] ; @@ -329,8 +330,8 @@ define <2 x i64> @test12(<2 x i64> %b, <2 x i64> %c) { define <4 x float> @test13(<4 x float> %a, <4 x float> %b) { ; CHECK-LABEL: @test13( -; CHECK-NEXT: [[MUL:%.*]] = fmul fast <4 x float> %b, -; CHECK-NEXT: [[ADD:%.*]] = fadd fast <4 x float> [[MUL]], %a +; CHECK-NEXT: [[MUL:%.*]] = fmul fast <4 x float> [[B:%.*]], +; CHECK-NEXT: [[ADD:%.*]] = fadd fast <4 x float> [[MUL]], [[A:%.*]] ; CHECK-NEXT: ret <4 x float> [[ADD]] ; %mul = fmul fast <4 x float> , %b @@ -343,8 +344,8 @@ define <4 x float> @test13(<4 x float> %a, <4 x float> %b) { define <2 x i64> @test14(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c) { ; CHECK-LABEL: @test14( -; CHECK-NEXT: [[ADD:%.*]] = add <2 x i64> %b, %a -; CHECK-NEXT: [[C_NEG:%.*]] = sub <2 x i64> zeroinitializer, %c +; CHECK-NEXT: [[ADD:%.*]] = add <2 x i64> [[B:%.*]], [[A:%.*]] +; CHECK-NEXT: [[C_NEG:%.*]] = sub <2 x i64> zeroinitializer, [[C:%.*]] ; CHECK-NEXT: [[SUB:%.*]] = add <2 x i64> [[ADD]], [[C_NEG]] ; CHECK-NEXT: ret <2 x i64> [[SUB]] ; @@ -355,7 +356,7 @@ define <2 x i64> @test14(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c) { define <2 x i32> @test15(<2 x i32> %x, <2 x i32> %y) { ; CHECK-LABEL: @test15( -; CHECK-NEXT: [[TMP3:%.*]] = and <2 x i32> %y, %x +; CHECK-NEXT: [[TMP3:%.*]] = and <2 x i32> [[Y:%.*]], [[X:%.*]] ; CHECK-NEXT: ret <2 x i32> [[TMP3]] ; %tmp1 = and <2 x i32> %x, %y @@ -366,7 +367,7 @@ define <2 x i32> @test15(<2 x i32> %x, <2 x i32> %y) { define <2 x i32> @test16(<2 x i32> %x, <2 x i32> %y) { ; CHECK-LABEL: @test16( -; CHECK-NEXT: [[TMP3:%.*]] = or <2 x i32> %y, %x +; CHECK-NEXT: [[TMP3:%.*]] = or <2 x i32> [[Y:%.*]], [[X:%.*]] ; CHECK-NEXT: ret <2 x i32> [[TMP3]] ; %tmp1 = or <2 x i32> %x, %y @@ -387,7 +388,7 @@ define <2 x i32> @test17(<2 x i32> %x, <2 x i32> %y) { define <2 x i32> @test18(<2 x i32> %x, <2 x i32> %y) { ; CHECK-LABEL: @test18( -; CHECK-NEXT: [[TMP5:%.*]] = xor <2 x i32> %y, %x +; CHECK-NEXT: [[TMP5:%.*]] = xor <2 x i32> [[Y:%.*]], [[X:%.*]] ; CHECK-NEXT: ret <2 x i32> [[TMP5]] ; %tmp1 = xor <2 x i32> %x, %y -- 2.7.4