[PATCH] D70403: AMDGPU/GlobalISel: Legalize FDIV64

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 19:47:08 PST 2019


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp:1890
 
-  uint16_t Flags = MI.getFlags();
+  auto Flags = MI.getFlags();
 
----------------
All these auto substitutions are unrelated


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp:2125-2133
+    auto NumBC = B.buildBitcast(V2S32, LHS);
+    auto DenBC = B.buildBitcast(V2S32, RHS);
+    auto Scale0BC = B.buildBitcast(V2S32, DivScale0);
+    auto Scale1BC = B.buildBitcast(V2S32, DivScale1);
+
+    auto NumHi = B.buildExtractVectorElement(S32, NumBC, Hi);
+    auto DenHi = B.buildExtractVectorElement(S32, DenBC, Hi);
----------------
The ugliness of casting to a vector and extracting the elements isn't necessary. This isn't the canonical way to handle this in GlobalISel. You can use G_UNMERGE_VALUES to 2 S32 pieces more naturally


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70403





More information about the llvm-commits mailing list