[PATCH] D84324: AMDGPU/GlobalISel: Lower G_FREM

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 07:12:59 PDT 2020


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2737
+    auto Div =
+        MIRBuilder.buildInstr(TargetOpcode::G_FDIV, {Ty}, {Src0Reg, Src1Reg});
+    auto Floor = MIRBuilder.buildInstr(TargetOpcode::G_FFLOOR, {Ty}, {Div});
----------------
buildFDiv? These are all dropping the flags too


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2738
+        MIRBuilder.buildInstr(TargetOpcode::G_FDIV, {Ty}, {Src0Reg, Src1Reg});
+    auto Floor = MIRBuilder.buildInstr(TargetOpcode::G_FFLOOR, {Ty}, {Div});
+    auto Mul = MIRBuilder.buildFMul(Ty, Floor, Src1Reg);
----------------
buildFFloor?


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2738
+        MIRBuilder.buildInstr(TargetOpcode::G_FDIV, {Ty}, {Src0Reg, Src1Reg});
+    auto Floor = MIRBuilder.buildInstr(TargetOpcode::G_FFLOOR, {Ty}, {Div});
+    auto Mul = MIRBuilder.buildFMul(Ty, Floor, Src1Reg);
----------------
arsenm wrote:
> buildFFloor?
Is this a correct handling of frem? The AMDGPU dag expansion uses ISD::FTRUNC, but I'm not sure that was ever correct


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

https://reviews.llvm.org/D84324





More information about the llvm-commits mailing list