[llvm] [AMDGPU] Allow SCC-only implicit defs and mark SOP2 SALU as rematerializable (PR #187084)

Romanov Vlad via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 24 02:45:04 PDT 2026


================
@@ -197,6 +198,14 @@ class LLVM_ABI TargetInstrInfo : public MCInstrInfo {
     return false;
   }
 
+  /// Returns true if this instruction can be safely rematerialized at UseIdx
+  /// even if it has implicit physical register defs that are live.
+  virtual bool isImplicitDefRematerializableAt(const MachineInstr &MI,
+                                               SlotIndex UseIdx,
+                                               LiveIntervals &LIS) const {
+    return true;
----------------
romanovvlad wrote:

Returning `true` is a way to preserve existing behavior for other backends.
Also see https://github.com/llvm/llvm-project/pull/187084/changes/BASE..f0a79c31d377f11d17583df139818c124a5ae4e4#r2980270977

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


More information about the llvm-commits mailing list