[PATCH] D37389: [AMDGPU] Produce madak and madmk from the two-address pass

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 6 19:30:20 PDT 2017


rampitec added inline comments.


================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:2088
+  auto Def = MRI.getUniqueVRegDef(MO->getReg());
+  if (Def && (Def->isFullCopy() || Def->getOpcode() == AMDGPU::S_MOV_B32 ||
+              Def->getOpcode() == AMDGPU::V_MOV_B32_e32) &&
----------------
arsenm wrote:
> You don't need the isFullCopy check. COPY can't be used to materialize an immediate. Def->isMoveImm() instead of the separate opcode checks
isMoveImm() will catch cmov, so will not work. isFullCopy removed.


================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:2134
+    if (auto Imm = getFoldableImm(Src2))
+      return BuildMI(*MBB, MI, MI.getDebugLoc(), get(AMDGPU::V_MADAK_F32))
+               .add(*Dst)
----------------
arsenm wrote:
> What if this is an f16 mac?
"if (!IsF16 ..." on line 2132.


https://reviews.llvm.org/D37389





More information about the llvm-commits mailing list