Skip to content

Commit 72440d0

Browse files
committed
invert wcslen condition
1 parent 0e951d8 commit 72440d0

File tree

4 files changed

+9
-14
lines changed

4 files changed

+9
-14
lines changed

llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,13 @@ static cl::opt<bool, true>
135135
cl::location(DisableLIRP::Strlen), cl::init(false),
136136
cl::ReallyHidden);
137137

138-
/// Some target libraries have a significant call overhead for `wcslen`,
139-
/// which can degrade performance when the input string is not long enough
140-
/// to justify the cost. To avoid unnecessary performance penalties,
141-
/// we disable it by default.
142138
bool DisableLIRP::Wcslen;
143-
static cl::opt<bool, true> EnableLIRPWcslen(
144-
"enable-loop-idiom-wcslen",
145-
cl::desc("Proceed with loop idiom recognize pass, "
146-
"enable conversion of loop(s) to wcslen."),
147-
cl::location(DisableLIRP::Wcslen), cl::init(true),
148-
cl::callback([](const bool &) { DisableLIRP::Wcslen = false; }),
149-
cl::ReallyHidden);
139+
static cl::opt<bool, true>
140+
EnableLIRPWcslen("disable-loop-idiom-wcslen",
141+
cl::desc("Proceed with loop idiom recognize pass, "
142+
"enable conversion of loop(s) to wcslen."),
143+
cl::location(DisableLIRP::Wcslen), cl::init(false),
144+
cl::ReallyHidden);
150145

151146
static cl::opt<bool> UseLIRCodeSizeHeurs(
152147
"use-lir-code-size-heurs",

llvm/test/Transforms/LoopIdiom/strlen-not-emittable.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt -passes='loop(loop-idiom),verify' -enable-loop-idiom-wcslen < %s -S | FileCheck %s
1+
; RUN: opt -passes='loop(loop-idiom),verify' < %s -S | FileCheck %s
22

33
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
44
target triple = "x86_64-unknown-linux-gnu"

llvm/test/Transforms/LoopIdiom/wcslen16.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2-
; RUN: opt -passes='loop(loop-idiom),verify' -enable-loop-idiom-wcslen < %s -S | FileCheck %s
2+
; RUN: opt -passes='loop(loop-idiom),verify' < %s -S | FileCheck %s
33

44
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
55
target triple = "x86_64-unknown-linux-gnu"

llvm/test/Transforms/LoopIdiom/wcslen32.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2-
; RUN: opt -passes='loop(loop-idiom),verify' -enable-loop-idiom-wcslen < %s -S | FileCheck %s
2+
; RUN: opt -passes='loop(loop-idiom),verify' < %s -S | FileCheck %s
33

44
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
55
target triple = "x86_64-unknown-linux-gnu"

0 commit comments

Comments
 (0)