[PATCH] D41126: [SelectionDAG] Fixed f16-from-vector promotion problem

Tim Renouf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 14:41:44 PST 2017


tpr added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:1977
 // STORE promotion handlers.
 SDValue DAGTypeLegalizer::PromoteFloatRes_BITCAST(SDNode *N) {
+  // If the bitcast is between scalar and v1 (in either direction), we need to
----------------
arsenm wrote:
> I don't think here should be encountering a v1* anything. i.e. getTypeAction(v1f16) should not be a TypePromoteFloat?
OK, thanks, I'll have a look at that.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:1979
+  // If the bitcast is between scalar and v1 (in either direction), we need to
+  // keep a bitcast between i16 and v1i16.
   EVT VT = N->getValueType(0);
----------------
arsenm wrote:
> Shouldn't this be v1f16?
I believe the idea of fp16_to_fp is that its input is an f16 but as an i16 type. That's what the code seems to be doing. This all seems to be to cope with f16 on hw that does not implement f16, so it does not do any of this on AMDGPU gfx800 and later because that implements hw f16.


================
Comment at: test/CodeGen/AMDGPU/unpack-half.ll:9
+
+define amdgpu_gs void @main(i32 inreg) local_unnamed_addr #0 {
+.entry:
----------------
arsenm wrote:
> instnamer and check something
Do you think I need to check something even though the point of this test is to check that the compiler does not get a fatal error?

What do you mean "instnamer"?


https://reviews.llvm.org/D41126





More information about the llvm-commits mailing list