summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorFlorian Hahn <florian.hahn@arm.com>2018-04-26 10:26:17 +0000
committerFlorian Hahn <florian.hahn@arm.com>2018-04-26 10:26:17 +0000
commitfd2bc11248f76b2131a1630761ea43ce01ec010d (patch)
treec70b10d36276a6c03d40d340f43032ba7caab9ad /llvm/lib/Transforms
parenta2fb1d18d2bc2b263872724ea27c6b1b6b8702f5 (diff)
downloadbcm5719-llvm-fd2bc11248f76b2131a1630761ea43ce01ec010d.tar.gz
bcm5719-llvm-fd2bc11248f76b2131a1630761ea43ce01ec010d.zip
[LoopInterchange] Ignore debug intrinsics during legality checks.
Reviewers: aprantl, mcrosier, karthikthecool Reviewed By: aprantl Subscribers: mattd, vsk, #debug-info, llvm-commits Differential Revision: https://reviews.llvm.org/D45379 llvm-svn: 330931
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopInterchange.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
index 45d76fdb7c9..b10ec265891 100644
--- a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
@@ -923,7 +923,8 @@ bool LoopInterchangeLegality::currentLimitations() {
// instruction.
bool FoundInduction = false;
- for (const Instruction &I : llvm::reverse(*InnerLoopLatch)) {
+ for (const Instruction &I :
+ llvm::reverse(InnerLoopLatch->instructionsWithoutDebug())) {
if (isa<BranchInst>(I) || isa<CmpInst>(I) || isa<TruncInst>(I) ||
isa<ZExtInst>(I))
continue;
@@ -976,10 +977,9 @@ bool LoopInterchangeLegality::canInterchangeLoops(unsigned InnerLoopId,
});
return false;
}
-
// Check if outer and inner loop contain legal instructions only.
for (auto *BB : OuterLoop->blocks())
- for (Instruction &I : *BB)
+ for (Instruction &I : BB->instructionsWithoutDebug())
if (CallInst *CI = dyn_cast<CallInst>(&I)) {
// readnone functions do not prevent interchanging.
if (CI->doesNotReadMemory())
OpenPOWER on IntegriCloud