Skip to content

Commit

Permalink
AMDGPU: Fix isTypeDesirableForOp for i16
Browse files Browse the repository at this point in the history
This should do nothing for targets without i16.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289235 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
arsenm committed Dec 9, 2016
1 parent 70df293 commit f811020
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions lib/Target/AMDGPU/SIISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,22 @@ bool SITargetLowering::shouldConvertConstantLoadToIntImm(const APInt &Imm,
}

bool SITargetLowering::isTypeDesirableForOp(unsigned Op, EVT VT) const {

// i16 is not desirable unless it is a load or a store.
if (VT == MVT::i16 && Op != ISD::LOAD && Op != ISD::STORE)
return false;
if (Subtarget->has16BitInsts() && VT == MVT::i16) {
switch (Op) {
case ISD::LOAD:
case ISD::STORE:

// These operations are done with 32-bit instructions anyway.
case ISD::AND:
case ISD::OR:
case ISD::XOR:
case ISD::SELECT:
// TODO: Extensions?
return true;
default:
return false;
}
}

// SimplifySetCC uses this function to determine whether or not it should
// create setcc with i1 operands. We don't have instructions for i1 setcc.
Expand Down

0 comments on commit f811020

Please sign in to comment.