OSDN Git Service

[DAGCombiner] [CodeGenPrepare] More comprehensive GEP splitting
authorLuis Marques <luismarques@lowrisc.org>
Mon, 17 Jun 2019 10:54:12 +0000 (10:54 +0000)
committerLuis Marques <luismarques@lowrisc.org>
Mon, 17 Jun 2019 10:54:12 +0000 (10:54 +0000)
commite36a3e35dd7a237c54955b068b6ca0252b485116
tree4d5940c7005e4add91112c2fc1168b5f1dd6f8be
parentba4b2d50e144b6cfbed01ccc25629c34b228db87
[DAGCombiner] [CodeGenPrepare] More comprehensive GEP splitting

Some GEPs were not being split, presumably because that split would just be
undone by the DAGCombiner. Not performing those splits can prevent important
optimizations, such as preventing the element indices / member offsets from
being (partially) folded into load/store instruction immediates. This patch:

- Makes the splits also occur in the cases where the base address and the GEP
  are in the same BB.
- Ensures that the DAGCombiner doesn't reassociate them back again.

Differential Revision: https://reviews.llvm.org/D60294

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363544 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenPrepare.cpp
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/Target/RISCV/RISCVISelLowering.h
test/CodeGen/AMDGPU/salu-to-valu.ll
test/CodeGen/ARM/misched-fusion-aes.ll
test/CodeGen/ARM/vector-spilling.ll
test/CodeGen/RISCV/split-offsets.ll [new file with mode: 0644]
test/CodeGen/SystemZ/int-add-08.ll
test/CodeGen/SystemZ/int-sub-05.ll