[llvm] [DAGCombiner][X86] Push bitcast/ext through freeze for loads (PR #163070)

Guy David via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 26 09:15:16 PDT 2025


================
@@ -16944,6 +16944,23 @@ SDValue DAGCombiner::visitFREEZE(SDNode *N) {
   if (N0.getOpcode() == ISD::SRA || N0.getOpcode() == ISD::SRL)
     return SDValue();
 
+  // fold: bitcast(freeze(load)) -> freeze(bitcast(load))
----------------
guy-david wrote:

@RKSimon Regarding https://github.com/llvm/llvm-project/pull/164618, how does it scale w.r.t. extensions?
I tried to address your comment with the last commit.

And a general question about `FREEZE` operations- is there a point in the lowering where we should strip them entirely? It seems quite cumbersome that every optimization has to potentially peel these in every use case.

https://github.com/llvm/llvm-project/pull/163070


More information about the llvm-commits mailing list