[llvm] [DAG][X86] Bitfield insertion can combine into SHL + SHRD (PR #220182)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 06:07:37 PDT 2026


================
@@ -8837,6 +8837,43 @@ static SDValue visitORCommutative(SelectionDAG &DAG, SDValue N0, SDValue N1,
   return SDValue();
 }
 
+// Fold an OR with a masked destination and a left-shifted
+// source into a shift + double-precision shift (SHRD):
+static SDValue combineOrOnSHLToSHRD(SDNode *N, SDLoc &DL, SelectionDAG &DAG) {
----------------
RKSimon wrote:

Don't use SHRD (x86-specific)
```suggestion
static SDValue combineOrOnSHLToFSHR(SDNode *N, SDLoc &DL, SelectionDAG &DAG) {
```

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


More information about the llvm-commits mailing list