[llvm] Select immediate binop optimization (PR #212163)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 01:07:44 PDT 2026


================
@@ -3064,6 +3064,14 @@ class LLVM_ABI TargetLoweringBase {
     return Value == 0;
   }
 
+  /// Return true if the specified immediate is legal immediate operation,
+  /// that is the target has instructions which can perform the operation
+  /// with the immediate without having to materialize the immediate into a
+  /// register.
+  virtual bool isLegalImmediate(unsigned Opc, const SDValue Val) const {
----------------
arsenm wrote:

This is a bad target hook, and don't we already have one for this?

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


More information about the llvm-commits mailing list