Skip to content

Commit c18fda0

Browse files
authored
[LoopVectorize] Use new single string variant of reportVectorizationFailure (#120414)
1 parent a3bb2d6 commit c18fda0

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,6 @@ bool LoopVectorizationLegality::canVectorizeOuterLoop() {
666666
// Check whether we are able to set up outer loop induction.
667667
if (!setupOuterLoopInductions()) {
668668
reportVectorizationFailure("Unsupported outer loop Phi(s)",
669-
"Unsupported outer loop Phi(s)",
670669
"UnsupportedPhi", ORE, TheLoop);
671670
if (DoExtraAnalysis)
672671
Result = false;
@@ -962,7 +961,6 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
962961
Type *T = ST->getValueOperand()->getType();
963962
if (!VectorType::isValidElementType(T)) {
964963
reportVectorizationFailure("Store instruction cannot be vectorized",
965-
"store instruction cannot be vectorized",
966964
"CantVectorizeStore", ORE, TheLoop, ST);
967965
return false;
968966
}
@@ -975,7 +973,6 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
975973
assert(VecTy && "did not find vectorized version of stored type");
976974
if (!TTI->isLegalNTStore(VecTy, ST->getAlign())) {
977975
reportVectorizationFailure(
978-
"nontemporal store instruction cannot be vectorized",
979976
"nontemporal store instruction cannot be vectorized",
980977
"CantVectorizeNontemporalStore", ORE, TheLoop, ST);
981978
return false;
@@ -990,7 +987,6 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
990987
assert(VecTy && "did not find vectorized version of load type");
991988
if (!TTI->isLegalNTLoad(VecTy, LD->getAlign())) {
992989
reportVectorizationFailure(
993-
"nontemporal load instruction cannot be vectorized",
994990
"nontemporal load instruction cannot be vectorized",
995991
"CantVectorizeNontemporalLoad", ORE, TheLoop, LD);
996992
return false;
@@ -1020,7 +1016,6 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
10201016
continue;
10211017
}
10221018
reportVectorizationFailure("Value cannot be used outside the loop",
1023-
"value cannot be used outside the loop",
10241019
"ValueUsedOutsideLoop", ORE, TheLoop, &I);
10251020
return false;
10261021
}
@@ -1442,9 +1437,7 @@ bool LoopVectorizationLegality::blockCanBePredicated(
14421437
bool LoopVectorizationLegality::canVectorizeWithIfConvert() {
14431438
if (!EnableIfConversion) {
14441439
reportVectorizationFailure("If-conversion is disabled",
1445-
"if-conversion is disabled",
1446-
"IfConversionDisabled",
1447-
ORE, TheLoop);
1440+
"IfConversionDisabled", ORE, TheLoop);
14481441
return false;
14491442
}
14501443

@@ -1493,14 +1486,12 @@ bool LoopVectorizationLegality::canVectorizeWithIfConvert() {
14931486
if (isa<SwitchInst>(BB->getTerminator())) {
14941487
if (TheLoop->isLoopExiting(BB)) {
14951488
reportVectorizationFailure("Loop contains an unsupported switch",
1496-
"loop contains an unsupported switch",
14971489
"LoopContainsUnsupportedSwitch", ORE,
14981490
TheLoop, BB->getTerminator());
14991491
return false;
15001492
}
15011493
} else if (!isa<BranchInst>(BB->getTerminator())) {
15021494
reportVectorizationFailure("Loop contains an unsupported terminator",
1503-
"loop contains an unsupported terminator",
15041495
"LoopContainsUnsupportedTerminator", ORE,
15051496
TheLoop, BB->getTerminator());
15061497
return false;
@@ -1510,8 +1501,7 @@ bool LoopVectorizationLegality::canVectorizeWithIfConvert() {
15101501
if (blockNeedsPredication(BB) &&
15111502
!blockCanBePredicated(BB, SafePointers, MaskedOp)) {
15121503
reportVectorizationFailure(
1513-
"Control flow cannot be substituted for a select",
1514-
"control flow cannot be substituted for a select", "NoCFGForSelect",
1504+
"Control flow cannot be substituted for a select", "NoCFGForSelect",
15151505
ORE, TheLoop, BB->getTerminator());
15161506
return false;
15171507
}
@@ -1700,8 +1690,6 @@ bool LoopVectorizationLegality::isVectorizableEarlyExitLoop() {
17001690
return false;
17011691
} else if (!IsSafeOperation(&I)) {
17021692
reportVectorizationFailure("Early exit loop contains operations that "
1703-
"cannot be speculatively executed",
1704-
"Early exit loop contains operations that "
17051693
"cannot be speculatively executed",
17061694
"UnsafeOperationsEarlyExitLoop", ORE,
17071695
TheLoop);
@@ -1764,9 +1752,7 @@ bool LoopVectorizationLegality::canVectorize(bool UseVPlanNativePath) {
17641752

17651753
if (!canVectorizeOuterLoop()) {
17661754
reportVectorizationFailure("Unsupported outer loop",
1767-
"unsupported outer loop",
1768-
"UnsupportedOuterLoop",
1769-
ORE, TheLoop);
1755+
"UnsupportedOuterLoop", ORE, TheLoop);
17701756
// TODO: Implement DoExtraAnalysis when subsequent legal checks support
17711757
// outer loops.
17721758
return false;

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4274,7 +4274,6 @@ LoopVectorizationCostModel::computeMaxVF(ElementCount UserVF, unsigned UserIC) {
42744274

42754275
if (TC == 0) {
42764276
reportVectorizationFailure(
4277-
"Unable to calculate the loop count due to complex control flow",
42784277
"unable to calculate the loop count due to complex control flow",
42794278
"UnknownLoopCountComplexCFG", ORE, TheLoop);
42804279
return FixedScalableVFPair::getNone();
@@ -9360,7 +9359,6 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range) {
93609359
addExitUsersForFirstOrderRecurrences(*Plan, ExitUsersToFix);
93619360
if (!addUsersInExitBlocks(*Plan, ExitUsersToFix)) {
93629361
reportVectorizationFailure(
9363-
"Some exit values in loop with uncountable exit not supported yet",
93649362
"Some exit values in loop with uncountable exit not supported yet",
93659363
"UncountableEarlyExitLoopsUnsupportedExitValue", ORE, OrigLoop);
93669364
return nullptr;

llvm/test/Transforms/LoopVectorize/X86/vectorization-remarks-missed.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
; }
4242
; return k;
4343
; }
44-
; CHECK: remark: source.cpp:29:7: loop not vectorized: control flow cannot be substituted for a select
44+
; CHECK: remark: source.cpp:29:7: loop not vectorized: Control flow cannot be substituted for a select
4545
; CHECK: remark: source.cpp:27:3: loop not vectorized
4646

4747
; YAML: --- !Analysis
@@ -104,7 +104,7 @@
104104
; YAML-NEXT: Function: test_multiple_failures
105105
; YAML-NEXT: Args:
106106
; YAML-NEXT: - String: 'loop not vectorized: '
107-
; YAML-NEXT: - String: control flow cannot be substituted for a select
107+
; YAML-NEXT: - String: Control flow cannot be substituted for a select
108108
; YAML-NEXT: ...
109109
; YAML-NEXT: --- !Analysis
110110
; YAML-NEXT: Pass: loop-vectorize

0 commit comments

Comments
 (0)