[PATCH] D148362: [SLP]Fix cost estimation for buildvectors with extracts and/or constants.
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 19 02:46:27 PDT 2023
RKSimon accepted this revision.
RKSimon added a comment.
This revision is now accepted and ready to land.
LGTM with one optional minor
================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:2258
Value *Op1) {
- return getVectorInstrCostHelper(nullptr, Val, Index, false /* HasRealUse */);
+ return getVectorInstrCostHelper(nullptr, Val, Index,
+ Opcode == Instruction::InsertElement && Op0 &&
----------------
Pull out the HasRealUse computation.
```
bool HasRealUse = Opcode == Instruction::InsertElement && Op0 && !isa<UndefValue>(Op0);
return getVectorInstrCostHelper(nullptr, Val, Index, HasRealIUse);
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148362/new/
https://reviews.llvm.org/D148362
More information about the llvm-commits
mailing list