[PATCH] D64966: [AMDGPU/GlobalISel] Add llvm.amdgcn.fdiv.fast legalization.
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 18 18:13:44 PDT 2019
arsenm added a comment.
Can you also remove the case for it in AMDGPURegisterBankInfo? It should never make it to RegBankSelected
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp:1288-1293
+ const APFloat C0Val(BitsToFloat(0x6f800000));
+ const APFloat C1Val(BitsToFloat(0x2f800000));
+
+ auto C0 = B.buildFConstant(S32, C0Val);
+ auto C1 = B.buildFConstant(S32, C1Val);
+ auto C2 = B.buildFConstant(S32, 1.0);
----------------
We don't really need to use F_CONSTANT. You can just use G_CONSTANT and the constant values directly without going through APFloat
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp:1298
+
+ auto Mul0 = B.buildFMul(S32, RHS, Sel.getReg(0));
+
----------------
Should propagate the fast math flags
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp:1305-1308
+ B.buildInstr(TargetOpcode::G_FMUL)
+ .addDef(Res)
+ .addUse(Sel.getReg(0))
+ .addUse(Mul1.getReg(0));
----------------
buildFMul
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64966/new/
https://reviews.llvm.org/D64966
More information about the llvm-commits
mailing list