[PATCH] D28907: [SLP] Fix for PR30787: Failure to beneficially vectorize 'copyable' elements in integer binary ops.
Dinar Temirbulatov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 31 05:41:55 PDT 2018
dtemirbulatov added inline comments.
================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:469
+ return InstructionsState(VL[BaseIndex], cast<Instruction>(VL[BaseIndex]),
+ cast<Instruction>(VL[AltIndex]), IsNonAlt);
+ else
----------------
RKSimon wrote:
> InstructionState was keeping the Base/Alt instructions the same if AltOpcodeNum ==0 (BaseIndex ==AltIndex) - why are you inserting nulls?
yes, correct, Thanks.
================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:1526
+static Value *getDefaultConstantForOpcode(unsigned Opcode, Type *Ty) {
+ switch(Opcode) {
----------------
RKSimon wrote:
> Can we use ConstantExpr::getBinOpIdentity instead?
no, ConstantExpr::getBinOpIdentity does support only commutative operations.
https://reviews.llvm.org/D28907
More information about the llvm-commits
mailing list