Skip to content

Commit e3abad5

Browse files
committed
Removed datalayout from test, improved debug message, and clarified comment.
1 parent f51d9f6 commit e3abad5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

llvm/lib/Transforms/Scalar/LoopInterchange.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,6 @@ static cl::opt<unsigned int> MaxLoopNestDepth(
101101
"loop-interchange-max-loop-nest-depth", cl::init(10), cl::Hidden,
102102
cl::desc("Maximum depth of loop nest considered for the transform"));
103103

104-
// This is mainly for testing purposes, and certain tests that rely on
105-
// behaviour that is more difficult to trigger otherwise.
106-
static cl::opt<bool> SkipLoopsWithZeroBTC(
107-
"loop-interchange-skip-zero-btc", cl::init(true), cl::Hidden,
108-
cl::desc("Do not consider loops with a backedge taken count of 0"));
109-
110104
// We prefer cache cost to vectorization by default.
111105
static cl::list<RuleTy> Profitabilities(
112106
"loop-interchange-profitabilities", cl::ZeroOrMore,
@@ -126,6 +120,13 @@ static cl::list<RuleTy> Profitabilities(
126120
"Ignore profitability, force interchange (does not "
127121
"work with other options)")));
128122

123+
// FIXME: this option exists mainly for a couple of tests that check some
124+
// corner cases that is more difficult to trigger otherwise; these tests should
125+
// be rewritten and this option removed if possible.
126+
static cl::opt<bool> SkipLoopsWithZeroBTC(
127+
"loop-interchange-skip-zero-btc", cl::init(true), cl::Hidden,
128+
cl::desc("Do not consider loops with a backedge taken count of 0"));
129+
129130
#ifndef NDEBUG
130131
static bool noDuplicateRulesAndIgnore(ArrayRef<RuleTy> Rules) {
131132
SmallSet<RuleTy, 4> Set;
@@ -438,7 +439,8 @@ static bool isComputableLoopNest(ScalarEvolution *SE,
438439
// true, isn't really a loop and we don't want to consider it as a
439440
// candidate.
440441
if (ExitCountOuter && SkipLoopsWithZeroBTC && ExitCountOuter->isZero()) {
441-
LLVM_DEBUG(dbgs() << "Single iteration loop\n");
442+
LLVM_DEBUG(dbgs() << "The loop back-edge isn't taken, rejecting single "
443+
"iteration loop\n");
442444
return false;
443445
}
444446
if (L->getNumBackEdges() != 1) {

llvm/test/Transforms/LoopInterchange/zero-btc.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
22
; RUN: opt < %s -passes=loop-interchange -loop-interchange-profitabilities=ignore -cache-line-size=64 -verify-dom-info -verify-loop-info -verify-scev -verify-loop-lcssa -S | FileCheck %s
33

4-
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"
5-
64
; Test case for issue: https://github.com/llvm/llvm-project/issues/163954
75

86
define void @test() {

0 commit comments

Comments
 (0)