[PATCH] D75408: [ConstantFolding] Make sure GEPs are fully folded

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 13:19:23 PST 2020


nikic planned changes to this revision.
nikic added a comment.

In D75408#1901690 <https://reviews.llvm.org/D75408#1901690>, @efriedma wrote:

> Making constant folding recurse after it transforms something probably makes sense.
>
> Practically, I'm not sure how much it matters, though.  "constprop" is not part of the normal pass pipeline; instcombine will iterate until it reaches a steady state.


Avoiding those extra fix-point iterations is really the goal here :) Constant folding in particular can fall into a small crack though, where we don't actually end up at a fixpoint after InstCombine finishes. An example: https://llvm.godbolt.org/z/V2bJYP. The reason is that constant //operand// folding is only performed during initial worklist population, presumably on the assumption that it does not require fixpoint iteration.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75408/new/

https://reviews.llvm.org/D75408





More information about the llvm-commits mailing list