[PATCH] D37389: [AMDGPU] Produce madak and madmk from the two-address pass
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 6 18:27:26 PDT 2017
arsenm 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) &&
----------------
You don't need the isFullCopy check. COPY can't be used to materialize an immediate. Def->isMoveImm() instead of the separate opcode checks
================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:2133
+ if (!IsF16 && !Src0Mods && !Src1Mods && !Clamp && !Omod) {
+ if (auto Imm = getFoldableImm(Src2))
+ return BuildMI(*MBB, MI, MI.getDebugLoc(), get(AMDGPU::V_MADAK_F32))
----------------
Braces
================
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)
----------------
What if this is an f16 mac?
https://reviews.llvm.org/D37389
More information about the llvm-commits
mailing list