summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM
diff options
context:
space:
mode:
authorSam Parker <sam.parker@arm.com>2018-09-12 09:11:48 +0000
committerSam Parker <sam.parker@arm.com>2018-09-12 09:11:48 +0000
commit569b24549edc485e36b4428a486e3e776e2f5a0b (patch)
tree0983337edb64754afbaa8ac6092292d50a0d00ba /llvm/lib/Target/ARM
parenteaf4fd749bbcea2187b23bd4742702f707907858 (diff)
downloadbcm5719-llvm-569b24549edc485e36b4428a486e3e776e2f5a0b.tar.gz
bcm5719-llvm-569b24549edc485e36b4428a486e3e776e2f5a0b.zip
[ARM] Allow bitcasts in ARMCodeGenPrepare
Allow bitcasts in the use-def chains, treating them as sources. Differential Revision: https://reviews.llvm.org/D50758 llvm-svn: 342032
Diffstat (limited to 'llvm/lib/Target/ARM')
-rw-r--r--llvm/lib/Target/ARM/ARMCodeGenPrepare.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Target/ARM/ARMCodeGenPrepare.cpp b/llvm/lib/Target/ARM/ARMCodeGenPrepare.cpp
index f7df39ac385..bc33e65b067 100644
--- a/llvm/lib/Target/ARM/ARMCodeGenPrepare.cpp
+++ b/llvm/lib/Target/ARM/ARMCodeGenPrepare.cpp
@@ -209,6 +209,8 @@ static bool isSource(Value *V) {
return true;
else if (isa<LoadInst>(V))
return true;
+ else if (isa<BitCastInst>(V))
+ return true;
else if (auto *Call = dyn_cast<CallInst>(V))
return Call->hasRetAttr(Attribute::AttrKind::ZExt);
return false;
@@ -545,11 +547,8 @@ bool ARMCodeGenPrepare::isSupportedValue(Value *V) {
isa<LoadInst>(V))
return isSupportedType(V);
- if (auto *Trunc = dyn_cast<TruncInst>(V))
- return isSupportedType(Trunc->getOperand(0));
-
- if (auto *ZExt = dyn_cast<ZExtInst>(V))
- return isSupportedType(ZExt->getOperand(0));
+ if (isa<CastInst>(V) && !isa<SExtInst>(V))
+ return isSupportedType(cast<CastInst>(V)->getOperand(0));
// Special cases for calls as we need to check for zeroext
// TODO We should accept calls even if they don't have zeroext, as they can
OpenPOWER on IntegriCloud