[PATCH] D150324: [X86] Make constant `mul` -> `shl` + `add`/`sub` work for vector types
Phoebe Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 8 01:30:42 PDT 2023
pengfei accepted this revision.
pengfei added a comment.
This revision is now accepted and ready to land.
LGTM.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:48707-48710
+ if (VT.isVector() && VT.isSimple()) {
+ EVT EleVT = VT.getVectorElementType();
+ if (EleVT != MVT::i8 && EleVT != MVT::i16 && EleVT != MVT::i32 &&
+ EleVT != MVT::i64)
----------------
Maybe just `VT.isVector() && VT.isInteger()` given we made sure it's legal type by line 48691.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:48722-48724
+ if (auto *RawC = getTargetConstantFromNode(N->getOperand(1)))
+ if (auto *SplatC = RawC->getSplatValue())
+ C = &(SplatC->getUniqueInteger());
----------------
In which case we need to analyze target constant?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150324/new/
https://reviews.llvm.org/D150324
More information about the llvm-commits
mailing list