[PATCH] [Reassociation] Add support for reassociation with unsafe algebra.

Chad Rosier mcrosier at codeaurora.org
Thu Aug 14 07:32:52 PDT 2014


1. Support swapping the operand order once SLP vectorizer is OK with it
 I believe Erik addressed this here:
 http://llvm.org/viewvc/llvm-project?view=revision&revision=214485

2. Support for floating point vectors
3.  (maybe?) Support for integer vectors?

I have a follow up patch that addresses both of these.

================
Comment at: lib/Transforms/Scalar/Reassociate.cpp:884
@@ +883,3 @@
+      } else
+        ExpressionChanged->clearSubclassOptionalData();
+
----------------
Chandler Carruth wrote:
> Why not do this before or ofter the if, but outside of the if? It's duplicated in both sides.
The SubclassOptionalData contains the FastMathFlags, so we need to save and restore that state before we call clearSubclassOptionalData().  Also, the calls to getFastMathFlags() and setFastMathFlags() needs to be guarded by the isa<FPMathOperator> check.  Otherwise, we hit an assert.

================
Comment at: lib/Transforms/Scalar/Reassociate.cpp:1968
@@ -1849,1 +1967,3 @@
+    if (I->getType()->isVectorTy() || !I->hasUnsafeAlgebra())
+      return;
   }
----------------
I agree; I have a follow up patch that will take care of this..

http://reviews.llvm.org/D4129






More information about the llvm-commits mailing list