[llvm] [DAG] Constant fold ISD::FSHL/FSHR nodes (PR #154480)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 20 04:17:37 PDT 2025


================
@@ -7054,6 +7066,30 @@ SDValue SelectionDAG::FoldConstantArithmetic(unsigned Opcode, const SDLoc &DL,
     }
   }
 
+  // Handle trinary-op special cases.
+  if (NumOps == 3) {
----------------
RKSimon wrote:

we're unlikely to have any other integer ternary cases to handle tbh - better to just check `Opcode == ISD::FSHL || Opcode == ISD::FSHR` and remove the FoldValue helper for now.

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


More information about the llvm-commits mailing list