[ARM][MVE] Teach MVEGatherScatterLowering to merge successive getelementpointers
authorAnna Welker <anna.welker@arm.com>
Tue, 28 Jul 2020 16:28:19 +0000 (17:28 +0100)
committerAnna Welker <anna.welker@arm.com>
Tue, 28 Jul 2020 16:31:20 +0000 (17:31 +0100)
commit0c64233bb7ae760d36a0af3a22324810787fa4ca
treedce6c3aa2cfadeaa0a5526481f383d28f0e118db
parent3fb0de820796cc6e322c8378713d375d9870a353
[ARM][MVE] Teach MVEGatherScatterLowering to merge successive getelementpointers

A patch following up on the introduction of pointer induction variables, adding
a preprocessing step to the address optimisation in the MVEGatherScatterLowering
pass. If the getelementpointer that is the address is itself using a
getelementpointer as base, they will be merged into one by summing up the
offsets, after checking that this will not cause an overflow (this can be
repeated recursively).

Differential Revision: https://reviews.llvm.org/D84027
llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
llvm/test/CodeGen/Thumb2/mve-gather-ind16-scaled.ll
llvm/test/CodeGen/Thumb2/mve-gather-ind32-scaled.ll
llvm/test/CodeGen/Thumb2/mve-gather-ind8-unscaled.ll
llvm/test/CodeGen/Thumb2/mve-gather-scatter-ptr-address.ll [new file with mode: 0644]
llvm/test/CodeGen/Thumb2/mve-scatter-ind16-scaled.ll
llvm/test/CodeGen/Thumb2/mve-scatter-ind32-scaled.ll
llvm/test/CodeGen/Thumb2/mve-scatter-ind8-unscaled.ll