[PATCH] D124530: [X86] Fix gather/scatter with large scales (PR55021)
Pei, Gen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 28 03:06:27 PDT 2022
gpei added inline comments.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:31567
+ EVT IndexVT = Index.getValueType();
+ Index = DAG.getNode(ISD::SHL, dl, IndexVT, Index,
+ DAG.getConstant(Log2_32(ScaleVal), dl, IndexVT));
----------------
```
DATA_ADDR←BASE_ADDR + (SignExtend(VINDEX[i+31:i])*SCALE + DISP;
```
Gather will signextend(index) to 64-bit first, then multiple the scale. When Index is 32-bit, it may occur overflow if we just multiply scale to index.
BTW, can we just bail out in getUniformBase when the scale is not supported by the target.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124530/new/
https://reviews.llvm.org/D124530
More information about the llvm-commits
mailing list