aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOperand.cpp
diff options
context:
space:
mode:
authorSander de Smalen <sander.desmalen@arm.com>2023-02-06 11:03:52 +0000
committerSander de Smalen <sander.desmalen@arm.com>2023-02-07 11:47:51 +0000
commite6eb84a191ca2a1afd5789c5bb398da68bb6065e (patch)
treef9f6f3759e4d4dabf8e2c53e40ca2822a36ade46 /llvm/lib/CodeGen/MachineOperand.cpp
parentce6de98b80ada8efbff93766b5303db5ab052efc (diff)
downloadllvm-e6eb84a191ca2a1afd5789c5bb398da68bb6065e.zip
llvm-e6eb84a191ca2a1afd5789c5bb398da68bb6065e.tar.gz
llvm-e6eb84a191ca2a1afd5789c5bb398da68bb6065e.tar.bz2
[LoopVectorize] Use DataLayout::getIndexType instead of i32 for non-constant GEP indices.
This is specifically relevant for loops that vectorize using a scalable VF, where the code results in: %vscale = call i32 llvm.vscale.i32() %vf.part1 = mul i32 %vscale, 4 %gep = getelementptr ..., i32 %vf.part1 Which InstCombine then changes into: %vscale = call i32 llvm.vscale.i32() %vf.part1 = mul i32 %vscale, 4 %vf.part1.zext = sext i32 %vf.part1 to i64 %gep = getelementptr ..., i32 %vf.part1.zext D143016 tried to remove these extends, but that only works when the call to llvm.vscale.i32() has a single use. After doing any kind of CSE on these calls the combine no longer kicks in. It seems more sensible to ask DataLayout what type to use, rather than relying on InstCombine to insert the extend and hoping it can fold it away. I've only changed this for indices that are not constant, because I vaguely remember there was a reason for sticking with i32. It would also mean patching up loads more tests. Reviewed By: paulwalker-arm Differential Revision: https://reviews.llvm.org/D143267
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
0 files changed, 0 insertions, 0 deletions