[llvm] [SystemZ] Add a SystemZ specific pre-RA scheduling strategy. (PR #135076)

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 24 04:03:40 PDT 2025


================
@@ -356,6 +356,17 @@ class SystemZInstrInfo : public SystemZGenInstrInfo {
                            SystemZII::FusedCompareType Type,
                            const MachineInstr *MI = nullptr) const;
 
+  // Return true if this is a load and test which can be optimized the
+  // same way as compare instruction.
+  bool isLoadAndTestAsCmp(const MachineInstr &MI) const;
+
+  // Return true if Compare is a comparison against zero.
+  bool isCompareZero(const MachineInstr &Compare) const;
+
+  // Return the source register of Compare, which is the unknown value
+  // being tested.
+  unsigned getCompareSourceReg(const MachineInstr &Compare) const;
----------------
JonPsson1 wrote:

No, that doesn't consider the Load And Test when used as a comparison. I could however simplify it a bit as this is actually supposed to only be called after isCompareZero() returns true.

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


More information about the llvm-commits mailing list