summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSam Parker <sam.parker@arm.com>2018-08-16 12:24:40 +0000
committerSam Parker <sam.parker@arm.com>2018-08-16 12:24:40 +0000
commit0d51197051a6ca1f1bcd99b607bbd0956663d4ce (patch)
tree4db023a0611de9d1ed33a1c81deec575ee995aee /llvm/lib
parent7f2df7df4597772407307d44d8d02cc0f07e35c3 (diff)
downloadbcm5719-llvm-0d51197051a6ca1f1bcd99b607bbd0956663d4ce.tar.gz
bcm5719-llvm-0d51197051a6ca1f1bcd99b607bbd0956663d4ce.zip
[ARM] Ignore GEPs in ARMCodeGenPrepare
While searching through the use-def tree, ignore GetElementPtrInst instructions because they don't need promoting and neither do their indices. Otherwise, the wide indices prevent the transformation from happening. Differential Revision: https://reviews.llvm.org/D50762 llvm-svn: 339871
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARMCodeGenPrepare.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMCodeGenPrepare.cpp b/llvm/lib/Target/ARM/ARMCodeGenPrepare.cpp
index 296a22fa45a..7601680134e 100644
--- a/llvm/lib/Target/ARM/ARMCodeGenPrepare.cpp
+++ b/llvm/lib/Target/ARM/ARMCodeGenPrepare.cpp
@@ -582,6 +582,11 @@ bool ARMCodeGenPrepare::TryToPromote(Value *V) {
if (CurrentVisited.count(V))
return true;
+ // Ignore GEPs because they don't need promoting and the constant indices
+ // will prevent the transformation.
+ if (isa<GetElementPtrInst>(V))
+ return true;
+
if (!isSupportedValue(V) || (shouldPromote(V) && !isLegalToPromote(V))) {
LLVM_DEBUG(dbgs() << "ARM CGP: Can't handle: " << *V << "\n");
return false;
OpenPOWER on IntegriCloud