Skip to content

Commit

Permalink
AMDGPU: During img instruction ret value construction cater for non i…
Browse files Browse the repository at this point in the history
…nt values

Make sure return type is int type.

Differential Revision: https://reviews.llvm.org/D108131

Change-Id: Ic02f07d1234cd51b6ed78c3fecd2cb1d6acd5644
  • Loading branch information
dstutt committed Aug 17, 2021
1 parent 4f21e6a commit ebdb0d0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llvm/lib/Target/AMDGPU/SIISelLowering.cpp
Expand Up @@ -5948,6 +5948,9 @@ static SDValue constructRetValue(SelectionDAG &DAG,

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
Expand Down

0 comments on commit ebdb0d0

Please sign in to comment.