Skip to content

Commit 2713369

Browse files
rebase
Created using spr 1.3.7
2 parents 08d3f97 + 0b8d9fc commit 2713369

File tree

39 files changed

+1305
-2442
lines changed

39 files changed

+1305
-2442
lines changed

clang/include/clang/Basic/LangOptions.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ LANGOPT(BranchTargetEnforcement, 1, 0, NotCompatible, "Branch-target enforcement
454454
LANGOPT(BranchProtectionPAuthLR, 1, 0, NotCompatible, "Use PC as a diversifier using PAuthLR NOP instructions.")
455455
LANGOPT(GuardedControlStack, 1, 0, NotCompatible, "Guarded control stack enabled")
456456

457-
LANGOPT(SpeculativeLoadHardening, 1, 0, NotCompatible, "Speculative load hardening enabled")
457+
LANGOPT(SpeculativeLoadHardening, 1, 0, Benign, "Speculative load hardening enabled")
458458

459459
LANGOPT(RelativeCXXABIVTables, 1, 0, NotCompatible,
460460
"Use an ABI-incompatible v-table layout that uses relative references")

clang/test/ClangScanDeps/strip-codegen-args.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// CHECK-NOT: "-flto"
1717
// CHECK-NOT: "-fno-autolink"
1818
// CHECK-NOT: "-mrelax-relocations=no"
19+
// CHECK-NOT: "-mspeculative-load-hardening"
1920
// CHECK: ]
2021
// CHECK: "name": "A"
2122
// CHECK: }
@@ -39,6 +40,11 @@
3940
"command": "clang -Imodules/A -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -O2 -flto=full -fsyntax-only DIR/t3.m",
4041
"file": "DIR/t2.m"
4142
}
43+
{
44+
"directory": "DIR",
45+
"command": "clang -Imodules/A -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -O2 -mspeculative-load-hardening -fsyntax-only DIR/t3.m",
46+
"file": "DIR/t3.m"
47+
}
4248
]
4349

4450
//--- modules/A/module.modulemap

flang/lib/Optimizer/Builder/CUDAIntrinsicCall.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,13 +1122,7 @@ CUDAIntrinsicLibrary::genSyncThreadsOr(mlir::Type resultType,
11221122
void CUDAIntrinsicLibrary::genSyncWarp(
11231123
llvm::ArrayRef<fir::ExtendedValue> args) {
11241124
assert(args.size() == 1);
1125-
constexpr llvm::StringLiteral funcName = "llvm.nvvm.bar.warp.sync";
1126-
mlir::Value mask = fir::getBase(args[0]);
1127-
mlir::FunctionType funcType =
1128-
mlir::FunctionType::get(builder.getContext(), {mask.getType()}, {});
1129-
auto funcOp = builder.createFunction(loc, funcName, funcType);
1130-
llvm::SmallVector<mlir::Value> argsList{mask};
1131-
fir::CallOp::create(builder, loc, funcOp, argsList);
1125+
mlir::NVVM::SyncWarpOp::create(builder, loc, fir::getBase(args[0]));
11321126
}
11331127

11341128
// THIS_GRID

flang/test/Lower/CUDA/cuda-device-proc.cuf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ end
105105

106106
! CHECK-LABEL: func.func @_QPdevsub() attributes {cuf.proc_attr = #cuf.cuda_proc<global>}
107107
! CHECK: nvvm.barrier0
108-
! CHECK: fir.call @llvm.nvvm.bar.warp.sync(%c1{{.*}}) fastmath<contract> : (i32) -> ()
108+
! CHECK: nvvm.bar.warp.sync %c1{{.*}} : i32
109109
! CHECK: fir.call @llvm.nvvm.membar.gl() fastmath<contract> : () -> ()
110110
! CHECK: fir.call @llvm.nvvm.membar.cta() fastmath<contract> : () -> ()
111111
! CHECK: fir.call @llvm.nvvm.membar.sys() fastmath<contract> : () -> ()
@@ -219,7 +219,7 @@ end
219219
! CHECK-LABEL: func.func @_QPhost1()
220220
! CHECK: cuf.kernel
221221
! CHECK: nvvm.barrier0
222-
! CHECK: fir.call @llvm.nvvm.bar.warp.sync(%c1{{.*}}) fastmath<contract> : (i32) -> ()
222+
! CHECK: nvvm.bar.warp.sync %c1{{.*}} : i32
223223
! CHECK: fir.call @llvm.nvvm.barrier0.and(%c1{{.*}}) fastmath<contract> : (i32) -> i32
224224
! CHECK: fir.call @llvm.nvvm.barrier0.popc(%c1{{.*}}) fastmath<contract> : (i32) -> i32
225225
! CHECK: fir.call @llvm.nvvm.barrier0.or(%c1{{.*}}) fastmath<contract> : (i32) -> i32

libcxx/utils/ci/buildkite-pipeline.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ steps:
103103
queue: libcxx-builders
104104
os: aix
105105
<<: *common
106-
skip: "https://github.com/llvm/llvm-project/issues/162516"
107106

108107
- label: AIX (64-bit)
109108
command: libcxx/utils/ci/run-buildbot aix
@@ -115,7 +114,6 @@ steps:
115114
queue: libcxx-builders
116115
os: aix
117116
<<: *common
118-
skip: "https://github.com/llvm/llvm-project/issues/162516"
119117

120118
- group: ':freebsd: FreeBSD'
121119
steps:

llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/LibraryResolver.h

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,21 @@ class LibraryManager {
211211
return FilteredView(Libraries.begin(), Libraries.end(), S, K);
212212
}
213213

214+
using LibraryFilterFn = std::function<bool(const LibraryInfo &)>;
215+
void getLibraries(LibState S, PathType K,
216+
std::vector<std::shared_ptr<LibraryInfo>> &Outs,
217+
LibraryFilterFn Filter = nullptr) const {
218+
std::shared_lock<std::shared_mutex> Lock(Mtx);
219+
for (const auto &[_, Entry] : Libraries) {
220+
const auto &Info = *Entry;
221+
if (Info.getKind() != K || Info.getState() != S)
222+
continue;
223+
if (Filter && !Filter(Info))
224+
continue;
225+
Outs.push_back(Entry);
226+
}
227+
}
228+
214229
void forEachLibrary(const LibraryVisitor &visitor) const {
215230
std::unique_lock<std::shared_mutex> Lock(Mtx);
216231
for (const auto &[_, entry] : Libraries) {
@@ -220,14 +235,14 @@ class LibraryManager {
220235
}
221236

222237
bool isLoaded(StringRef Path) const {
223-
std::unique_lock<std::shared_mutex> Lock(Mtx);
238+
std::shared_lock<std::shared_mutex> Lock(Mtx);
224239
if (auto It = Libraries.find(Path.str()); It != Libraries.end())
225240
return It->second->getState() == LibState::Loaded;
226241
return false;
227242
}
228243

229244
bool isQueried(StringRef Path) const {
230-
std::unique_lock<std::shared_mutex> Lock(Mtx);
245+
std::shared_lock<std::shared_mutex> Lock(Mtx);
231246
if (auto It = Libraries.find(Path.str()); It != Libraries.end())
232247
return It->second->getState() == LibState::Queried;
233248
return false;

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4046,6 +4046,8 @@ static SDValue foldSubCtlzNot(SDNode *N, SelectionDAG &DAG) {
40464046
m_ConstInt(AndMask)))) {
40474047
// Type Legalisation Pattern:
40484048
// (sub (ctlz (and (xor Op XorMask) AndMask)) BitWidthDiff)
4049+
if (BitWidthDiff.getZExtValue() >= BitWidth)
4050+
return SDValue();
40494051
unsigned AndMaskWidth = BitWidth - BitWidthDiff.getZExtValue();
40504052
if (!(AndMask.isMask(AndMaskWidth) && XorMask.countr_one() >= AndMaskWidth))
40514053
return SDValue();

llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryResolver.cpp

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,17 @@ class SymbolSearchContext {
184184
public:
185185
SymbolSearchContext(SymbolQuery &Q) : Q(Q) {}
186186

187-
bool hasSearched(LibraryInfo *Lib) const { return Searched.count(Lib); }
187+
bool hasSearched(const LibraryInfo *Lib) const { return Searched.count(Lib); }
188188

189-
void markSearched(LibraryInfo *Lib) { Searched.insert(Lib); }
189+
void markSearched(const LibraryInfo *Lib) { Searched.insert(Lib); }
190190

191191
inline bool allResolved() const { return Q.allResolved(); }
192192

193193
SymbolQuery &query() { return Q; }
194194

195195
private:
196196
SymbolQuery &Q;
197-
DenseSet<LibraryInfo *> Searched;
197+
DenseSet<const LibraryInfo *> Searched;
198198
};
199199

200200
void LibraryResolver::resolveSymbolsInLibrary(
@@ -226,19 +226,18 @@ void LibraryResolver::resolveSymbolsInLibrary(
226226
return EnumerateResult::Continue;
227227
},
228228
Opts);
229+
};
229230

231+
if (!Lib.hasFilter()) {
232+
LLVM_DEBUG(dbgs() << "Building filter for library: " << Lib.getFullPath()
233+
<< "\n";);
234+
enumerateSymbolsIfNeeded();
230235
if (DiscoveredSymbols.empty()) {
231236
LLVM_DEBUG(dbgs() << " No symbols and remove library : "
232237
<< Lib.getFullPath() << "\n";);
233238
LibMgr.removeLibrary(Lib.getFullPath());
234239
return;
235240
}
236-
};
237-
238-
if (!Lib.hasFilter()) {
239-
LLVM_DEBUG(dbgs() << "Building filter for library: " << Lib.getFullPath()
240-
<< "\n";);
241-
enumerateSymbolsIfNeeded();
242241
SmallVector<StringRef> SymbolVec;
243242
SymbolVec.reserve(DiscoveredSymbols.size());
244243
for (const auto &KV : DiscoveredSymbols)
@@ -288,24 +287,22 @@ void LibraryResolver::searchSymbolsInLibraries(
288287

289288
SymbolSearchContext Ctx(Q);
290289
while (!Ctx.allResolved()) {
290+
std::vector<std::shared_ptr<LibraryInfo>> Libs;
291+
LibMgr.getLibraries(S, K, Libs, [&](const LibraryInfo &Lib) {
292+
return !Ctx.hasSearched(&Lib);
293+
});
291294

292-
for (auto &Lib : LibMgr.getView(S, K)) {
293-
if (Ctx.hasSearched(Lib.get()))
294-
continue;
295+
if (Libs.empty() && !scanLibrariesIfNeeded(K, scanBatchSize))
296+
break; // no more new libs to scan
295297

298+
for (auto &Lib : Libs) {
296299
// can use Async here?
297300
resolveSymbolsInLibrary(*Lib, Ctx.query(), Config.Options);
298301
Ctx.markSearched(Lib.get());
299302

300303
if (Ctx.allResolved())
301304
return;
302305
}
303-
304-
if (Ctx.allResolved())
305-
return;
306-
307-
if (!scanLibrariesIfNeeded(K, scanBatchSize))
308-
break; // no more new libs to scan
309306
}
310307
};
311308

llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void handleError(Error Err, StringRef context = "") {
5050
}
5151

5252
bool ObjectFileLoader::isArchitectureCompatible(const object::ObjectFile &Obj) {
53-
Triple HostTriple(sys::getDefaultTargetTriple());
53+
Triple HostTriple(sys::getProcessTriple());
5454
Triple ObjTriple = Obj.makeTriple();
5555

5656
LLVM_DEBUG({

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class AArch64TTIImpl final : public BasicTTIImplBase<AArch64TTIImpl> {
312312
}
313313

314314
bool isLegalMaskedLoadStore(Type *DataType, Align Alignment) const {
315-
if (!ST->hasSVE())
315+
if (!ST->isSVEorStreamingSVEAvailable())
316316
return false;
317317

318318
// For fixed vectors, avoid scalarization if using SVE for them.

0 commit comments

Comments
 (0)