[llvm] [DAGCombiner][X86] Push bitcast/ext through freeze for loads (PR #163070)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 27 08:01:41 PDT 2025
RKSimon wrote:
We have a general mechanism to push FREEZE nodes up the DAG chain, if a node doesn't create undef/poison then its a candidate for allowing the FREEZE to be moved before it. This works well in general and avoids too much explicit handling of FREEZE in most folds. The problems we're currently hitting tend to be:
1. we should always allowing multiple operands to be frozen (same as InstCombine) - I started work on this again at #160914 - moving away from using ReplaceAllUsesOfValueWith as we kept encountering infinite loops (which is why I'm wary of your patch) - but the problems with LOAD nodes kept stalling work on it.
2. BITCAST(FREEZE(LOAD)) cases
3. EXT(FREEZE(LOAD)) cases - in particular if we lose value tracking handling to know when its sign/zero extended
4. FREEZE(LOAD(CONSTANT_POOL)) cases - do we even need a FREEZE for these? Maybe for vector loads with some undef elements. Again, it messes up value tracking.
https://github.com/llvm/llvm-project/pull/163070
More information about the llvm-commits
mailing list