[PATCH] D48485: [InstCombine] allow shl+mul combos with shuffle (select) fold (PR37806)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 27 05:50:37 PDT 2018


spatel added a comment.

In https://reviews.llvm.org/D48485#1144839, @lebedev.ri wrote:

> Is this waiting for a review, or are there changes planned?


It's waiting for further review. (I screwed up the Phab state/history by clicking the wrong 'Add Action...' when I made the first revision.)
As Simon noted, there are other opcode pairs that we can handle. I think they can be added individually as follow-up patches, and the code will evolve into different shapes as needed.



================
Comment at: lib/Transforms/InstCombine/InstCombineVectorOps.cpp:1202-1203
 
-  BinaryOperator::BinaryOps Opc = B0->getOpcode();
-  Instruction *NewBO = ConstantsAreOp1 ? BinaryOperator::Create(Opc, X, NewC) :
-                                         BinaryOperator::Create(Opc, NewC, X);
+  Instruction *NewBO = ConstantsAreOp1 ? BinaryOperator::Create(Opc0, X, NewC) :
+                                         BinaryOperator::Create(Opc0, NewC, X);
 
----------------
lebedev.ri wrote:
> This is going to be confusing later on, given that we already have `Opc0` and `Opc1`.
> 
Is it just the abbreviated variable naming (damn that 80-col limit!)? If so, I could spell out 'Opcode' vs. 'Operand'. Or rearrange the logic some way?


https://reviews.llvm.org/D48485





More information about the llvm-commits mailing list