[llvm] [X86] Attempt to fold trunc(srl(load(p), amt) -> load(p+amt/8) (PR #165266)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 28 01:32:29 PDT 2025


================
@@ -54652,6 +54653,39 @@ static SDValue combineTruncate(SDNode *N, SelectionDAG &DAG,
   if (SDValue V = combinePMULH(Src, VT, DL, DAG, Subtarget))
     return V;
 
+  // Fold trunc(srl(load(p),amt) -> load(p+amt/8)
----------------
RKSimon wrote:

```suggestion
  // Fold trunc(srl(load(p),amt)) -> load(p+amt/8)
```

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


More information about the llvm-commits mailing list