[InstCombine] NEW Baseline tests for InstCombine optimization to merge GEP instructio...
authorWilliam Huang <williamjhuang@google.com>
Thu, 12 May 2022 00:32:03 +0000 (00:32 +0000)
committerWilliam Huang <williamjhuang@google.com>
Thu, 19 May 2022 18:46:18 +0000 (18:46 +0000)
commit6107cdc9295d339304ce3e88e0b038db661d2bcb
treec17e90568332baddc217afc12912768a33ebc231
parentac2f0a6f1d4b3f5ff61dac33d9aba395d79b6a3d
[InstCombine] NEW Baseline tests for InstCombine optimization to merge GEP instructions with constant indices

Splitted the merge constant-indexed GEP optimization into two smaller transformations: 1. Merging GEP of GEP if both are constant-indexed. 2. Swapping constant indexed GEP in a chain of (non-constant) GEP to the end, so that 1 can be applied repeatedly.
There is existing code to partially  handle transformation 1, but it only deals with limited cases

Unit tests are breaking down into two parts for the 2 transformations.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D125438
llvm/test/Transforms/InstCombine/gep-canonicalize-constant-indices.ll [new file with mode: 0644]
llvm/test/Transforms/InstCombine/gep-merge-constant-indices.ll [new file with mode: 0644]