[PATCH] D54882: [AMDGPU] Add sdwa support for ADD|SUB U64 decomposed Pseudos

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 26 08:36:37 PST 2018


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/SIPeepholeSDWA.cpp:902-909
+  if (!Vdst)
+    return false;
+  MachineOperand *Src0 = TII->getNamedOperand(MISucc, AMDGPU::OpName::src0);
+  if (!Src0)
+    return false;
+  MachineOperand *Src1 = TII->getNamedOperand(MISucc, AMDGPU::OpName::src1);
+  if (!Src1)
----------------
There's no point in checking these since they must be present


================
Comment at: lib/Target/AMDGPU/SIPeepholeSDWA.cpp:917-920
+  if (!CarryIn->isKill())
+    return false;
+  if (!CarryOut->isDead())
+    return false;
----------------
We don't want to rely on kill flags. You should check the uses of the vreg instead


================
Comment at: lib/Target/AMDGPU/SIPeepholeSDWA.cpp:961-962
 
+  } else if (MI.getOpcode() == AMDGPU::V_ADD_I32_e64 ||
+             MI.getOpcode() == AMDGPU::V_SUB_I32_e64) {
+    if (!opConvertedToVOP2(MI, ST))
----------------
You have code checking for the carry ins, but you don't handle those here


Repository:
  rL LLVM

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

https://reviews.llvm.org/D54882





More information about the llvm-commits mailing list