[PATCH] D109031: [AMDGPU] Introduce optimizeCompareInstr

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 1 02:04:12 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:8007
+                                       const MachineRegisterInfo *MRI) const {
+  if (SrcReg2 && SrcReg.isPhysical())
+    return false;
----------------
Did you mean `SrcReg2 || SrcReg.isPhysical()`?


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:8014-8015
+    // s_cmp_eq_i32 (s_and_b32 $src, 1), 1 => s_and_b32 $src, 1
+    // s_cmp_lt_u32 (s_and_b32 $src, 1), 1 => s_and_b32 $src, 1
+    // s_cmp_lt_i32 (s_and_b32 $src, 1), 1 => s_and_b32 $src, 1
+    // s_cmp_eq_u64 (s_and_b64 $src, 1), 1 => s_and_b64 $src, 1
----------------
These two should be `ge` instead of `lt`?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109031/new/

https://reviews.llvm.org/D109031



More information about the llvm-commits mailing list