[PATCH] D88193: [SLP] Remove LHS and RHS from OperationData.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 06:02:54 PDT 2020


ABataev accepted this revision.
ABataev added a comment.
This revision is now accepted and ready to land.

LG



================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:6484
     bool operator==(const OperationData &OD) const {
-      assert(((Kind != OD.Kind) || ((!LHS == !OD.LHS) && (!RHS == !OD.RHS))) &&
+      assert(((Kind != OD.Kind) || (Opcode != 0 && OD.Opcode != 0)) &&
              "One of the comparing operations is incorrect.");
----------------
craig.topper wrote:
> I'm not entirely sure what this assert was trying to check before.
> 
> As far as I can tell there are 3 states OperationData could have
> - Kind is RK_None and Opcode is 0 and LHS/RHS wre. 
> - Kind is RK_None and Opcode is non-zero and LHS/RHS are null
> - Kind is not RK_None and Opcode is non-zero and LHS/RHS are non-null
> 
> So I think this was previously saying that if the Kinds are equal then the LHS/RHS in both should be null or non-null. Maybe I should have changed it to (Kind != OD.Kind) || ((Opcode != 0) == (OD.Opcode != 0))?
I think this assert is good in its current form.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88193/new/

https://reviews.llvm.org/D88193



More information about the llvm-commits mailing list