[all-commits] [llvm/llvm-project] d56b0a: [ConstantHoist] Remove check for notional overinde...

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Jan 19 02:34:47 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d56b0ad441a34ae6c353c823969397b451f053a6
      https://github.com/llvm/llvm-project/commit/d56b0ad441a34ae6c353c823969397b451f053a6
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-01-19 (Wed, 19 Jan 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
    A llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep-overindexing.ll

  Log Message:
  -----------
  [ConstantHoist] Remove check for notional overindexing

ConstantHoist currently only hoists GEPs if there is no notional
overindexing. As this transform only hoists address arithmetic,
it shouldn't care about whether any overindexing occurs or not.

There is one caveat: If the hoisted base GEP is inbounds, and a
later non-inbounds GEP is rewritten in terms of it, the value
may be incorrectly poisoned. To avoid this, restrict the transform
to inbounds GEPs for now, as the notional overindexing check
effectively did that as well. The inbounds restriction could be
dropped by dropping inbounds from the base GEP expression.

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




More information about the All-commits mailing list