[PATCH] D25805: [AMDGPU] Perform uchar to float combine for ISD::SINT_TO_FP

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 20 08:42:37 PDT 2016

tstellarAMD added inline comments.

Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:3525-3527
+    if (Src.getOpcode() == ISD::ZERO_EXTEND &&
+        Src.getOperand(0).getOpcode() == ISD::SRL)
+      Src = Src.getOperand(0);
I think calling simplifyDemandedBits either here or in performUCharToFloat combine will eliminate the need for this code.

Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:3560
+  case ISD::SINT_TO_FP:
   case ISD::UINT_TO_FP: {
tstellarAMD wrote:
> I don't think this is correct, because it's replacing SINT_TO_FP with CVT_F32_UBYTE0, which is an unsigned conversion.
Nevermind, I see that this transform is correct, because performUCharToFloatCombine() is checking that the high bits are all zero.


More information about the llvm-commits mailing list