[PATCH] D73021: [ARM] Basic gather scatter cost model
Anna Welker via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 20 07:54:12 PST 2020
anwel added inline comments.
================
Comment at: llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp:901
+
+ // And (aligned) i32 gather will not need to be vectorized.
+ if (EltSize == 32)
----------------
nit: An ?
================
Comment at: llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp:918
+ ->getPrimitiveSizeInBits();
+ // Scale need to be correct (which is only relevant for i16s).
+ if (Scale != 8 && Scale != EltSize)
----------------
nit: needs
================
Comment at: llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp:922-924
+ if (auto ZExt = dyn_cast<ZExtInst>(GEP->getOperand(1)))
+ if (ZExt->getOperand(0)->getType()->getScalarSizeInBits() <= EltSize)
+ return VectorCost;
----------------
The gather/scatter pass can also handle a sext here, in the manner that it will just leave it the way it is and use the result if it's of the correct type. That increases `VectorCost` by the cost of the sext, but doesn't necessarily mean that building a gather is more expensive than expanding.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73021/new/
https://reviews.llvm.org/D73021
More information about the llvm-commits
mailing list