Skip to content

Commit 179d2f9

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:d2b8acc10464 into amd-gfx:f8992209d7db
Local branch amd-gfx f899220 Merged main:8c0090030bf8 into amd-gfx:4088678579a3 Remote branch main d2b8acc [RISCV] Swap the order of SEWGreaterThanOrEqualAndLessThan64 and SEWGreaterThanOrEqual. (llvm#120649)
2 parents f899220 + d2b8acc commit 179d2f9

File tree

184 files changed

+2102
-2331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+2102
-2331
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,6 @@ New Compiler Flags
445445
- The ``-Warray-compare-cxx26`` warning has been added to warn about array comparison
446446
starting from C++26, this warning is enabled as an error by default.
447447

448-
- '-fsanitize-merge' (default) and '-fno-sanitize-merge' have been added for
449-
fine-grained control of which UBSan checks are allowed to be merged by the
450-
backend (for example, -fno-sanitize-merge=bool,enum).
451-
452448
Deprecated Compiler Flags
453449
-------------------------
454450

@@ -488,8 +484,6 @@ Removed Compiler Flags
488484
derivatives) is now removed, since it's no longer possible to suppress the
489485
diagnostic (see above). Users can expect an `unknown warning` diagnostic if
490486
it's still in use.
491-
- The experimental flag '-ubsan-unique-traps' has been removed. It is
492-
superseded by '-fno-sanitize-merge'.
493487

494488
Attribute Changes in Clang
495489
--------------------------
@@ -708,6 +702,9 @@ Improvements to Clang's diagnostics
708702
709703
- Fix -Wdangling false positives on conditional operators (#120206).
710704

705+
- Fixed a bug where Clang hung on an unsupported optional scope specifier ``::`` when parsing
706+
Objective-C. Clang now emits a diagnostic message instead of hanging.
707+
711708
Improvements to Clang's time-trace
712709
----------------------------------
713710

@@ -1210,6 +1207,11 @@ Sanitizers
12101207

12111208
- Implemented ``-f[no-]sanitize-trap=local-bounds``, and ``-f[no-]sanitize-recover=local-bounds``.
12121209

1210+
- ``-fsanitize-merge`` (default) and ``-fno-sanitize-merge`` have been added for
1211+
fine-grained, unified control of which UBSan checks can potentially be merged
1212+
by the compiler (for example,
1213+
``-fno-sanitize-merge=bool,enum,array-bounds,local-bounds``).
1214+
12131215
Python Binding Changes
12141216
----------------------
12151217
- Fixed an issue that led to crashes when calling ``Type.get_exception_specification_kind``.

clang/docs/UndefinedBehaviorSanitizer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ Stack traces and report symbolization
276276
If you want UBSan to print symbolized stack trace for each error report, you
277277
will need to:
278278

279-
#. Compile with ``-g`` and ``-fno-omit-frame-pointer`` to get proper debug
280-
information in your binary.
279+
#. Compile with ``-g``, ``-fno-sanitize-merge`` and ``-fno-omit-frame-pointer``
280+
to get proper debug information in your binary.
281281
#. Run your program with environment variable
282282
``UBSAN_OPTIONS=print_stacktrace=1``.
283283
#. Make sure ``llvm-symbolizer`` binary is in ``PATH``.

clang/include/clang/AST/Stmt.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,9 @@ class alignas(void *) Stmt {
114114
#define STMT(CLASS, PARENT)
115115
#define STMT_RANGE(BASE, FIRST, LAST)
116116
#define LAST_STMT_RANGE(BASE, FIRST, LAST) \
117-
static_assert( \
118-
llvm::isInt<NumStmtBits>(StmtClass::LAST##Class), \
119-
"The number of 'StmtClass'es is strictly bounded under two to " \
120-
"the power of 'NumStmtBits'");
117+
static_assert(llvm::isUInt<NumStmtBits>(StmtClass::LAST##Class), \
118+
"The number of 'StmtClass'es is strictly bound " \
119+
"by a bitfield of width NumStmtBits");
121120
#define ABSTRACT_STMT(STMT)
122121
#include "clang/AST/StmtNodes.inc"
123122

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,9 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
10301030
PB.registerScalarOptimizerLateEPCallback(
10311031
[this](FunctionPassManager &FPM, OptimizationLevel Level) {
10321032
BoundsCheckingPass::ReportingMode Mode;
1033+
bool Merge = CodeGenOpts.SanitizeMergeHandlers.has(
1034+
SanitizerKind::LocalBounds);
1035+
10331036
if (CodeGenOpts.SanitizeTrap.has(SanitizerKind::LocalBounds)) {
10341037
Mode = BoundsCheckingPass::ReportingMode::Trap;
10351038
} else if (CodeGenOpts.SanitizeMinimalRuntime) {
@@ -1041,7 +1044,8 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
10411044
? BoundsCheckingPass::ReportingMode::FullRuntime
10421045
: BoundsCheckingPass::ReportingMode::FullRuntimeAbort;
10431046
}
1044-
FPM.addPass(BoundsCheckingPass(Mode));
1047+
BoundsCheckingPass::BoundsCheckingOptions Options(Mode, Merge);
1048+
FPM.addPass(BoundsCheckingPass(Options));
10451049
});
10461050

10471051
// Don't add sanitizers if we are here from ThinLTO PostLink. That already

clang/lib/Parse/Parser.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2222,8 +2222,15 @@ bool Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec(
22222222
}
22232223
}
22242224

2225-
if (SS.isEmpty())
2225+
if (SS.isEmpty()) {
2226+
if (getLangOpts().ObjC && !getLangOpts().CPlusPlus &&
2227+
Tok.is(tok::coloncolon)) {
2228+
// ObjectiveC does not allow :: as as a scope token.
2229+
Diag(ConsumeToken(), diag::err_expected_type);
2230+
return true;
2231+
}
22262232
return false;
2233+
}
22272234

22282235
// A C++ scope specifier that isn't followed by a typename.
22292236
AnnotateScopeToken(SS, IsNewScope);

clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedLambdaCapturesChecker.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ class UncountedLambdaCapturesChecker
155155
if (!Init)
156156
return nullptr;
157157
TempExpr = dyn_cast<CXXBindTemporaryExpr>(Init->IgnoreParenCasts());
158+
if (!TempExpr)
159+
return nullptr;
158160
return dyn_cast_or_null<LambdaExpr>(TempExpr->getSubExpr());
159161
}
160162

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.UncountedLambdaCapturesChecker -verify %s
2+
// expected-no-diagnostics
3+
4+
struct Foo {
5+
int x;
6+
int y;
7+
Foo(int x, int y) : x(x) , y(y) { }
8+
~Foo() { }
9+
};
10+
11+
Foo bar(const Foo&);
12+
void foo() {
13+
int x = 7;
14+
int y = 5;
15+
bar(Foo(x, y));
16+
}

clang/test/CodeGen/bounds-checking.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
// RUN: %clang_cc1 -fsanitize=local-bounds -fsanitize-trap=local-bounds -emit-llvm -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
2-
// RUN: %clang_cc1 -fsanitize=array-bounds -O -emit-llvm -triple x86_64-apple-darwin10 %s -o - | not FileCheck %s
1+
// N.B. The clang driver defaults to -fsanitize-merge but clang_cc1 effectively
2+
// defaults to -fno-sanitize-merge.
33
// RUN: %clang_cc1 -fsanitize=array-bounds -O -fsanitize-trap=array-bounds -emit-llvm -triple x86_64-apple-darwin10 -DNO_DYNAMIC %s -o - | FileCheck %s
4+
// RUN: %clang_cc1 -fsanitize=array-bounds -O -emit-llvm -triple x86_64-apple-darwin10 %s -o - | not FileCheck %s
45
//
5-
// RUN: %clang_cc1 -fsanitize=local-bounds -fsanitize-trap=local-bounds -O3 -mllvm -bounds-checking-unique-traps -emit-llvm -triple x86_64-apple-darwin10 %s -o - | FileCheck %s --check-prefixes=NOOPTLOCAL
6-
// RUN: %clang_cc1 -fsanitize=local-bounds -fsanitize-trap=local-bounds -O3 -emit-llvm -triple x86_64-apple-darwin10 %s -o - | not FileCheck %s --check-prefixes=NOOPTLOCAL
6+
// RUN: %clang_cc1 -fsanitize=local-bounds -fsanitize-trap=local-bounds -emit-llvm -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
7+
//
8+
// RUN: %clang_cc1 -fsanitize=local-bounds -fsanitize-trap=local-bounds -O3 -emit-llvm -triple x86_64-apple-darwin10 %s -o - | FileCheck %s --check-prefixes=NOOPTLOCAL
9+
// RUN: %clang_cc1 -fsanitize=local-bounds -fsanitize-trap=local-bounds -fno-sanitize-merge -O3 -emit-llvm -triple x86_64-apple-darwin10 %s -o - | FileCheck %s --check-prefixes=NOOPTLOCAL
10+
// RUN: %clang_cc1 -fsanitize=local-bounds -fsanitize-trap=local-bounds -fsanitize-merge=local-bounds -O3 -emit-llvm -triple x86_64-apple-darwin10 %s -o - | not FileCheck %s --check-prefixes=NOOPTLOCAL
711
//
8-
// N.B. The clang driver defaults to -fsanitize-merge but clang_cc1 effectively
9-
// defaults to -fno-sanitize-merge.
1012
// RUN: %clang_cc1 -fsanitize=array-bounds -fsanitize-trap=array-bounds -O3 -emit-llvm -triple x86_64-apple-darwin10 %s -o - | FileCheck %s --check-prefixes=NOOPTARRAY
1113
// RUN: %clang_cc1 -fsanitize=array-bounds -fsanitize-trap=array-bounds -fno-sanitize-merge -O3 -emit-llvm -triple x86_64-apple-darwin10 %s -o - | FileCheck %s --check-prefixes=NOOPTARRAY
1214
// RUN: %clang_cc1 -fsanitize=array-bounds -fsanitize-trap=array-bounds -fsanitize-merge=array-bounds -O3 -emit-llvm -triple x86_64-apple-darwin10 %s -o - | not FileCheck %s --check-prefixes=NOOPTARRAY

clang/test/Driver/print-enabled-extensions/aarch64-armv9.4-a.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
5959
// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
6060
// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
61+
// CHECK-NEXT: FEAT_SVE2p1 Enable Scalable Vector Extension 2.1 instructions
6162
// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable Armv8.4-A TLB Range and Maintenance instructions
6263
// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
6364
// CHECK-NEXT: FEAT_TRF Enable Armv8.4-A Trace extension

clang/test/Driver/print-enabled-extensions/aarch64-armv9.5-a.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
6262
// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
6363
// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
64+
// CHECK-NEXT: FEAT_SVE2p1 Enable Scalable Vector Extension 2.1 instructions
6465
// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable Armv8.4-A TLB Range and Maintenance instructions
6566
// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
6667
// CHECK-NEXT: FEAT_TRF Enable Armv8.4-A Trace extension

clang/test/Parser/objc-coloncolon.m

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %clang_cc1 -x objective-c -fsyntax-only -Wno-objc-root-class -verify %s
2+
3+
int GV = 42;
4+
5+
@interface A
6+
+ (int) getGV;
7+
- (instancetype)init:(::A *) foo; // expected-error {{expected a type}}
8+
@end
9+
10+
@implementation A
11+
- (void)performSelector:(SEL)selector {}
12+
- (void)double:(int)firstArg :(int)secondArg colon:(int)thirdArg {}
13+
- (void)test {
14+
// The `::` below should not trigger an error.
15+
[self performSelector:@selector(double::colon:)];
16+
}
17+
+ (int) getGV { return ::GV; } // expected-error {{expected a type}}
18+
- (instancetype)init:(::A *) foo { return self; } // expected-error {{expected a type}}
19+
@end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Test to make sure the parser does not get stuck on the optional
2+
// scope specifier on the type B.
3+
// RUN: %clang_cc1 -fsyntax-only %s
4+
5+
class B;
6+
7+
@interface A
8+
- (void) init:(::B *) foo;
9+
@end

compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,23 @@ INTERCEPTOR(FILE *, fdopen, int fd, const char *mode) {
297297
return REAL(fdopen)(fd, mode);
298298
}
299299

300+
#if SANITIZER_INTERCEPT_OPEN_MEMSTREAM
301+
INTERCEPTOR(FILE *, open_memstream, char **buf, size_t *size) {
302+
__rtsan_notify_intercepted_call("open_memstream");
303+
return REAL(open_memstream)(buf, size);
304+
}
305+
306+
INTERCEPTOR(FILE *, fmemopen, void *buf, size_t size, const char *mode) {
307+
__rtsan_notify_intercepted_call("fmemopen");
308+
return REAL(fmemopen)(buf, size, mode);
309+
}
310+
#define RTSAN_MAYBE_INTERCEPT_OPEN_MEMSTREAM INTERCEPT_FUNCTION(open_memstream)
311+
#define RTSAN_MAYBE_INTERCEPT_FMEMOPEN INTERCEPT_FUNCTION(fmemopen)
312+
#else
313+
#define RTSAN_MAYBE_INTERCEPT_OPEN_MEMSTREAM
314+
#define RTSAN_MAYBE_INTERCEPT_FMEMOPEN
315+
#endif
316+
300317
INTERCEPTOR(int, puts, const char *s) {
301318
__rtsan_notify_intercepted_call("puts");
302319
return REAL(puts)(s);
@@ -807,6 +824,17 @@ INTERCEPTOR(int, epoll_pwait, int epfd, struct epoll_event *events,
807824
#define RTSAN_MAYBE_INTERCEPT_EPOLL_PWAIT
808825
#endif // SANITIZER_INTERCEPT_EPOLL
809826

827+
#if SANITIZER_INTERCEPT_PPOLL
828+
INTERCEPTOR(int, ppoll, struct pollfd *fds, nfds_t n, const struct timespec *ts,
829+
const sigset_t *set) {
830+
__rtsan_notify_intercepted_call("ppoll");
831+
return REAL(ppoll)(fds, n, ts, set);
832+
}
833+
#define RTSAN_MAYBE_INTERCEPT_PPOLL INTERCEPT_FUNCTION(ppoll)
834+
#else
835+
#define RTSAN_MAYBE_INTERCEPT_PPOLL
836+
#endif
837+
810838
#if SANITIZER_INTERCEPT_KQUEUE
811839
INTERCEPTOR(int, kqueue, void) {
812840
__rtsan_notify_intercepted_call("kqueue");
@@ -944,6 +972,8 @@ void __rtsan::InitializeInterceptors() {
944972
INTERCEPT_FUNCTION(fputs);
945973
INTERCEPT_FUNCTION(fdopen);
946974
INTERCEPT_FUNCTION(freopen);
975+
RTSAN_MAYBE_INTERCEPT_OPEN_MEMSTREAM;
976+
RTSAN_MAYBE_INTERCEPT_FMEMOPEN;
947977
INTERCEPT_FUNCTION(lseek);
948978
RTSAN_MAYBE_INTERCEPT_LSEEK64;
949979
INTERCEPT_FUNCTION(dup);
@@ -1000,6 +1030,7 @@ void __rtsan::InitializeInterceptors() {
10001030
RTSAN_MAYBE_INTERCEPT_EPOLL_CTL;
10011031
RTSAN_MAYBE_INTERCEPT_EPOLL_WAIT;
10021032
RTSAN_MAYBE_INTERCEPT_EPOLL_PWAIT;
1033+
RTSAN_MAYBE_INTERCEPT_PPOLL;
10031034
RTSAN_MAYBE_INTERCEPT_KQUEUE;
10041035
RTSAN_MAYBE_INTERCEPT_KEVENT;
10051036
RTSAN_MAYBE_INTERCEPT_KEVENT64;

compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,31 @@ TEST_F(RtsanFileTest, FopenDiesWhenRealtime) {
353353
ExpectNonRealtimeSurvival(Func);
354354
}
355355

356+
#if SANITIZER_INTERCEPT_OPEN_MEMSTREAM
357+
TEST_F(RtsanFileTest, OpenMemstreamDiesWhenRealtime) {
358+
char *buffer;
359+
size_t size;
360+
auto Func = [&buffer, &size]() {
361+
FILE *f = open_memstream(&buffer, &size);
362+
EXPECT_THAT(f, Ne(nullptr));
363+
};
364+
365+
ExpectRealtimeDeath(Func, "open_memstream");
366+
ExpectNonRealtimeSurvival(Func);
367+
}
368+
369+
TEST_F(RtsanFileTest, FmemOpenDiesWhenRealtime) {
370+
char buffer[1024];
371+
auto Func = [&buffer]() {
372+
FILE *f = fmemopen(&buffer, sizeof(buffer), "w");
373+
EXPECT_THAT(f, Ne(nullptr));
374+
};
375+
376+
ExpectRealtimeDeath(Func, "fmemopen");
377+
ExpectNonRealtimeSurvival(Func);
378+
}
379+
#endif
380+
356381
class RtsanOpenedFileTest : public RtsanFileTest {
357382
protected:
358383
void SetUp() override {
@@ -1056,6 +1081,21 @@ TEST_F(EpollTest, EpollPWaitDiesWhenRealtime) {
10561081
}
10571082
#endif // SANITIZER_INTERCEPT_EPOLL
10581083

1084+
#if SANITIZER_INTERCEPT_PPOLL
1085+
TEST(TestRtsanInterceptors, PpollDiesWhenRealtime) {
1086+
struct pollfd fds[1];
1087+
fds[0].fd = 0;
1088+
fds[0].events = POLLIN;
1089+
1090+
timespec ts = {0};
1091+
1092+
auto Func = [&fds, &ts]() { ppoll(fds, 1, &ts, nullptr); };
1093+
1094+
ExpectRealtimeDeath(Func, "ppoll");
1095+
ExpectNonRealtimeSurvival(Func);
1096+
}
1097+
#endif
1098+
10591099
#if SANITIZER_INTERCEPT_KQUEUE
10601100
TEST(TestRtsanInterceptors, KqueueDiesWhenRealtime) {
10611101
auto Func = []() { kqueue(); };

flang/lib/Lower/IO.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "flang/Optimizer/Builder/Todo.h"
3333
#include "flang/Optimizer/Dialect/FIRDialect.h"
3434
#include "flang/Optimizer/Dialect/Support/FIRContext.h"
35+
#include "flang/Optimizer/Support/InternalNames.h"
3536
#include "flang/Parser/parse-tree.h"
3637
#include "flang/Runtime/io-api-consts.h"
3738
#include "flang/Semantics/runtime-type-info.h"
@@ -298,9 +299,10 @@ getNonTbpDefinedIoTableAddr(Fortran::lower::AbstractConverter &converter,
298299
mlir::Location loc = converter.getCurrentLocation();
299300
mlir::Type refTy = fir::ReferenceType::get(mlir::NoneType::get(context));
300301
std::string suffix = ".nonTbpDefinedIoTable";
301-
std::string tableMangleName = definedIoProcMap.empty()
302-
? "default" + suffix
303-
: converter.mangleName(suffix);
302+
std::string tableMangleName =
303+
definedIoProcMap.empty()
304+
? fir::NameUniquer::doGenerated("default" + suffix)
305+
: converter.mangleName(suffix);
304306
if (auto table = builder.getNamedGlobal(tableMangleName))
305307
return builder.createConvert(
306308
loc, refTy,

flang/lib/Optimizer/CodeGen/CodeGen.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2990,10 +2990,12 @@ struct GlobalOpConversion : public fir::FIROpConversion<fir::GlobalOp> {
29902990
g.setAlignment(*global.getAlignment());
29912991

29922992
auto module = global->getParentOfType<mlir::ModuleOp>();
2993+
auto gpuMod = global->getParentOfType<mlir::gpu::GPUModuleOp>();
29932994
// Add comdat if necessary
29942995
if (fir::getTargetTriple(module).supportsCOMDAT() &&
29952996
(linkage == mlir::LLVM::Linkage::Linkonce ||
2996-
linkage == mlir::LLVM::Linkage::LinkonceODR)) {
2997+
linkage == mlir::LLVM::Linkage::LinkonceODR) &&
2998+
!gpuMod) {
29972999
addComdat(g, rewriter, module);
29983000
}
29993001

flang/lib/Optimizer/HLFIR/Transforms/InlineElementals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class InlineElementalsPass
125125
mlir::RewritePatternSet patterns(context);
126126
patterns.insert<InlineElementalConversion>(context);
127127

128-
if (mlir::failed(mlir::applyPatternsAndFoldGreedily(
128+
if (mlir::failed(mlir::applyPatternsGreedily(
129129
getOperation(), std::move(patterns), config))) {
130130
mlir::emitError(getOperation()->getLoc(),
131131
"failure in HLFIR elemental inlining");

flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIRIntrinsics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,8 @@ class LowerHLFIRIntrinsics
520520
config.enableRegionSimplification =
521521
mlir::GreedySimplifyRegionLevel::Disabled;
522522

523-
if (mlir::failed(mlir::applyPatternsAndFoldGreedily(
524-
module, std::move(patterns), config))) {
523+
if (mlir::failed(
524+
mlir::applyPatternsGreedily(module, std::move(patterns), config))) {
525525
mlir::emitError(mlir::UnknownLoc::get(context),
526526
"failure in HLFIR intrinsic lowering");
527527
signalPassFailure();

flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ class OptimizedBufferizationPass
13721372
// patterns.insert<ReductionMaskConversion<hlfir::MaxvalOp>>(context);
13731373
// patterns.insert<ReductionMaskConversion<hlfir::MinvalOp>>(context);
13741374

1375-
if (mlir::failed(mlir::applyPatternsAndFoldGreedily(
1375+
if (mlir::failed(mlir::applyPatternsGreedily(
13761376
getOperation(), std::move(patterns), config))) {
13771377
mlir::emitError(getOperation()->getLoc(),
13781378
"failure in HLFIR optimized bufferization");

flang/lib/Optimizer/HLFIR/Transforms/SimplifyHLFIRIntrinsics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ class SimplifyHLFIRIntrinsics
491491
patterns.insert<SumAsElementalConversion>(context);
492492
patterns.insert<CShiftAsElementalConversion>(context);
493493

494-
if (mlir::failed(mlir::applyPatternsAndFoldGreedily(
494+
if (mlir::failed(mlir::applyPatternsGreedily(
495495
getOperation(), std::move(patterns), config))) {
496496
mlir::emitError(getOperation()->getLoc(),
497497
"failure in HLFIR intrinsic simplification");

flang/lib/Optimizer/Transforms/AlgebraicSimplification.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ struct AlgebraicSimplification
3939
void AlgebraicSimplification::runOnOperation() {
4040
RewritePatternSet patterns(&getContext());
4141
populateMathAlgebraicSimplificationPatterns(patterns);
42-
(void)applyPatternsAndFoldGreedily(getOperation(), std::move(patterns),
43-
config);
42+
(void)applyPatternsGreedily(getOperation(), std::move(patterns), config);
4443
}
4544

4645
std::unique_ptr<mlir::Pass> fir::createAlgebraicSimplificationPass() {

0 commit comments

Comments
 (0)