[PATCH] D108131: AMDGPU: During img instruction ret value construction cater for non int values

David Stuttard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 16 07:45:46 PDT 2021


dstuttard created this revision.
Herald added subscribers: foad, kerbowa, hiraditya, t-tye, tpr, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm.
dstuttard requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Make sure return type is int type.

Change-Id: I5b2076fd027bd1b0bd2c3494184a278eb04a538f


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108131

Files:
  llvm/lib/Target/AMDGPU/SIISelLowering.cpp


Index: llvm/lib/Target/AMDGPU/SIISelLowering.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -5948,6 +5948,9 @@
 
   EVT LegalReqRetVT = ReqRetVT;
   if (!ReqRetVT.isVector()) {
+    if (!Data.getValueType().isInteger())
+      Data = DAG.getNode(ISD::BITCAST, DL,
+                         Data.getValueType().changeTypeToInteger(), Data);
     Data = DAG.getNode(ISD::TRUNCATE, DL, ReqRetVT.changeTypeToInteger(), Data);
   } else {
     // We need to widen the return vector to a legal type


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108131.366629.patch
Type: text/x-patch
Size: 613 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210816/46e5afc0/attachment.bin>


More information about the llvm-commits mailing list