summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2016-12-09 17:57:43 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2016-12-09 17:57:43 +0000
commit7b00cf4706f7dd855096ef20313617fd89323337 (patch)
treebf8c0d11f47ada78145e85f3f14db98c69b2d951
parent6ea7a7a3108d30186bd413a166ddd0cfa79491a4 (diff)
downloadbcm5719-llvm-7b00cf4706f7dd855096ef20313617fd89323337.tar.gz
bcm5719-llvm-7b00cf4706f7dd855096ef20313617fd89323337.zip
AMDGPU: Fix isTypeDesirableForOp for i16
This should do nothing for targets without i16. llvm-svn: 289235
-rw-r--r--llvm/lib/Target/AMDGPU/SIISelLowering.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index eeab4821e50..0c35c2757a1 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -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.
OpenPOWER on IntegriCloud