[PATCH] [Reassociate] Add initial support for vector instructions.

Sanjay Patel spatel at rotateright.com
Mon Feb 23 09:07:25 PST 2015


================
Comment at: lib/Transforms/Scalar/Reassociate.cpp:2091
@@ -2092,3 +2090,3 @@
 
-  // Don't optimize vector instructions.
-  if (I->getType()->isVectorTy())
+  // Don't optimize vector Xor instructions.
+  if (I->getType()->isVectorTy() && I->getOpcode() == Instruction::Xor)
----------------
Can you add a bit to the comment to explain?
Is this because we want to distinguish zero'ing idioms? 

================
Comment at: test/Transforms/Reassociate/fast-ReassociateVector.ll:4
@@ +3,3 @@
+; 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
----------------
I assume all of the floating point transforms apply identically to doubles as well as floats. Can you change some of these tests to use doubles so we have some coverage for those?

http://reviews.llvm.org/D7566

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list