summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-02-27 22:15:25 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-02-27 22:15:25 +0000
commiteb522e68bc8ee92d9ee38aced7719e3a1789b631 (patch)
tree226c01daee0eb90653e5f9e807bb39f044fd0ebf /llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
parentb2605f31ed27aceefbb135c3fb3178687f07741c (diff)
downloadbcm5719-llvm-eb522e68bc8ee92d9ee38aced7719e3a1789b631.tar.gz
bcm5719-llvm-eb522e68bc8ee92d9ee38aced7719e3a1789b631.zip
AMDGPU: Support v2i16/v2f16 packed operations
llvm-svn: 296396
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp b/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
index 23f124b637f..0652dacd9b0 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
@@ -181,12 +181,20 @@ bool AMDGPUCodeGenPrepare::isSigned(const SelectInst &I) const {
}
bool AMDGPUCodeGenPrepare::needsPromotionToI32(const Type *T) const {
- if (T->isIntegerTy() && T->getIntegerBitWidth() > 1 &&
- T->getIntegerBitWidth() <= 16)
+ const IntegerType *IntTy = dyn_cast<IntegerType>(T);
+ if (IntTy && IntTy->getBitWidth() > 1 && IntTy->getBitWidth() <= 16)
return true;
- if (!T->isVectorTy())
- return false;
- return needsPromotionToI32(cast<VectorType>(T)->getElementType());
+
+ if (const VectorType *VT = dyn_cast<VectorType>(T)) {
+ // TODO: The set of packed operations is more limited, so may want to
+ // promote some anyway.
+ if (ST->hasVOP3PInsts())
+ return false;
+
+ return needsPromotionToI32(VT->getElementType());
+ }
+
+ return false;
}
// Return true if the op promoted to i32 should have nsw set.
OpenPOWER on IntegriCloud