[all-commits] [llvm/llvm-project] a770f5: [InstCombine] When swapping GEPs, only keep inboun...

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon May 30 08:04:58 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a770f534e6f647d1f6a25544117e7b3d8a0c3486
      https://github.com/llvm/llvm-project/commit/a770f534e6f647d1f6a25544117e7b3d8a0c3486
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-05-30 (Mon, 30 May 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/test/Transforms/InstCombine/gep-combine-loop-invariant.ll
    M llvm/test/Transforms/LoopVectorize/first-order-recurrence.ll

  Log Message:
  -----------
  [InstCombine] When swapping GEPs, only keep inbounds if both are

If only one of the GEPs is inbounds, then after swapping, there is
no guarantee that one of them will be inbounds as well
(see e.g. https://alive2.llvm.org/ce/z/agaCnp).

This is only a partial fix, because even if both are inbounds, the
result is not necessarily inbounds (if the offsets have different
signs).




More information about the All-commits mailing list