[PATCH] D39906: [InstCombine] Allowing GEP Instructions with loop Invariant operands to combine

DIVYA SHANMUGHAN via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 09:07:01 PST 2017


DIVYA added a comment.

For the testcase in https://bugs.llvm.org/show_bug.cgi?id=23163, the patch will not create extra instructions , since the operands are not loop invariants.
And for the cases where the extra instructions are produced, gep(gep ...) merging optimization happens only when the second  operands are loop invariant , and hence LICM pass  will move them out of the loop.
Also, I am checking if the first operand of Src is not  loop invariant.Since , if the first operand of Src Gep  is loop invariant and both the second operands  are  also loop invariants, then they shouldn't be combined as LICM will anyway hoist them out of the loop and combining will only create extra instructions.


https://reviews.llvm.org/D39906





More information about the llvm-commits mailing list