Skip to content

Commit 341ab02

Browse files
authored
merge main into amd-staging (#798)
2 parents 0e5a641 + 2e11a1b commit 341ab02

File tree

159 files changed

+8882
-2170
lines changed

Some content is hidden

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

159 files changed

+8882
-2170
lines changed

.ci/premerge_advisor_explain.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def main(
132132
comments_file_name = f"comments-{platform.system()}-{platform.machine()}"
133133
with open(comments_file_name, "w") as comment_file_handle:
134134
json.dump(comments, comment_file_handle)
135+
print(f"Wrote comments to {comments_file_name}")
135136

136137

137138
if __name__ == "__main__":

.github/workflows/premerge.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ jobs:
191191
with:
192192
name: workflow-args-windows
193193
path: |
194-
comments-Windows-x86_64
194+
comments-Windows-AMD64
195195
196196
premerge-check-macos:
197197
name: MacOS Premerge Checks

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,14 +1862,12 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
18621862
}
18631863

18641864
bool isNoop(const MCInst &Inst) const override {
1865-
return Inst.getOpcode() == AArch64::HINT &&
1866-
Inst.getOperand(0).getImm() == 0;
1865+
return Inst.getOpcode() == AArch64::NOP;
18671866
}
18681867

18691868
void createNoop(MCInst &Inst) const override {
1870-
Inst.setOpcode(AArch64::HINT);
1869+
Inst.setOpcode(AArch64::NOP);
18711870
Inst.clear();
1872-
Inst.addOperand(MCOperand::createImm(0));
18731871
}
18741872

18751873
bool isTrap(const MCInst &Inst) const override {

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,10 @@ Improvements to Clang's diagnostics
708708
Objective-C method and block declarations when calling format functions. It is part
709709
of the format-nonliteral diagnostic (#GH60718)
710710

711+
- Fixed a crash when enabling ``-fdiagnostics-format=sarif`` and the output
712+
carries messages like 'In file included from ...' or 'In module ...'.
713+
Now the include/import locations are written into `sarif.run.result.relatedLocations`.
714+
711715
Improvements to Clang's time-trace
712716
----------------------------------
713717

clang/include/clang/Analysis/FlowSensitive/Models/UncheckedStatusOrAccessModel.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "clang/ASTMatchers/ASTMatchers.h"
1414
#include "clang/Analysis/CFG.h"
1515
#include "clang/Analysis/FlowSensitive/CFGMatchSwitch.h"
16+
#include "clang/Analysis/FlowSensitive/CachedConstAccessorsLattice.h"
1617
#include "clang/Analysis/FlowSensitive/DataflowAnalysis.h"
1718
#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
1819
#include "clang/Analysis/FlowSensitive/MatchSwitch.h"
@@ -69,7 +70,8 @@ struct UncheckedStatusOrAccessModelOptions {};
6970

7071
// Dataflow analysis that discovers unsafe uses of StatusOr values.
7172
class UncheckedStatusOrAccessModel
72-
: public DataflowAnalysis<UncheckedStatusOrAccessModel, NoopLattice> {
73+
: public DataflowAnalysis<UncheckedStatusOrAccessModel,
74+
CachedConstAccessorsLattice<NoopLattice>> {
7375
public:
7476
explicit UncheckedStatusOrAccessModel(ASTContext &Ctx, Environment &Env);
7577

clang/include/clang/Basic/BuiltinsX86.td

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -408,39 +408,21 @@ let Features = "avx512f,vaes", Attributes = [NoThrow, Const, RequiredVectorWidth
408408
def aesdeclast512 : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, _Vector<8, long long int>)">;
409409
}
410410

411-
let Features = "gfni", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
411+
let Features = "gfni", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
412412
def vgf2p8affineinvqb_v16qi : X86Builtin<"_Vector<16, char>(_Vector<16, char>, _Vector<16, char>, _Constant char)">;
413-
}
414-
415-
let Features = "avx,gfni", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
416-
def vgf2p8affineinvqb_v32qi : X86Builtin<"_Vector<32, char>(_Vector<32, char>, _Vector<32, char>, _Constant char)">;
417-
}
418-
419-
let Features = "avx512f,gfni", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
420-
def vgf2p8affineinvqb_v64qi : X86Builtin<"_Vector<64, char>(_Vector<64, char>, _Vector<64, char>, _Constant char)">;
421-
}
422-
423-
let Features = "gfni", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
424413
def vgf2p8affineqb_v16qi : X86Builtin<"_Vector<16, char>(_Vector<16, char>, _Vector<16, char>, _Constant char)">;
425-
}
426-
427-
let Features = "avx,gfni", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
428-
def vgf2p8affineqb_v32qi : X86Builtin<"_Vector<32, char>(_Vector<32, char>, _Vector<32, char>, _Constant char)">;
429-
}
430-
431-
let Features = "avx512f,gfni", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
432-
def vgf2p8affineqb_v64qi : X86Builtin<"_Vector<64, char>(_Vector<64, char>, _Vector<64, char>, _Constant char)">;
433-
}
434-
435-
let Features = "gfni", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
436414
def vgf2p8mulb_v16qi : X86Builtin<"_Vector<16, char>(_Vector<16, char>, _Vector<16, char>)">;
437415
}
438416

439-
let Features = "avx,gfni", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
417+
let Features = "avx,gfni", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256>] in {
418+
def vgf2p8affineinvqb_v32qi : X86Builtin<"_Vector<32, char>(_Vector<32, char>, _Vector<32, char>, _Constant char)">;
419+
def vgf2p8affineqb_v32qi : X86Builtin<"_Vector<32, char>(_Vector<32, char>, _Vector<32, char>, _Constant char)">;
440420
def vgf2p8mulb_v32qi : X86Builtin<"_Vector<32, char>(_Vector<32, char>, _Vector<32, char>)">;
441421
}
442422

443-
let Features = "avx512f,gfni", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
423+
let Features = "avx512f,gfni", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
424+
def vgf2p8affineinvqb_v64qi : X86Builtin<"_Vector<64, char>(_Vector<64, char>, _Vector<64, char>, _Constant char)">;
425+
def vgf2p8affineqb_v64qi : X86Builtin<"_Vector<64, char>(_Vector<64, char>, _Vector<64, char>, _Constant char)">;
444426
def vgf2p8mulb_v64qi : X86Builtin<"_Vector<64, char>(_Vector<64, char>, _Vector<64, char>)">;
445427
}
446428

clang/include/clang/Basic/Sarif.h

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ class SarifResult {
325325
std::string HostedViewerURI;
326326
llvm::SmallDenseMap<StringRef, std::string, 4> PartialFingerprints;
327327
llvm::SmallVector<CharSourceRange, 8> Locations;
328+
llvm::SmallVector<CharSourceRange, 8> RelatedLocations;
328329
llvm::SmallVector<ThreadFlow, 8> ThreadFlows;
329330
std::optional<SarifResultLevel> LevelOverride;
330331

@@ -354,16 +355,29 @@ class SarifResult {
354355
return *this;
355356
}
356357

357-
SarifResult setLocations(llvm::ArrayRef<CharSourceRange> DiagLocs) {
358+
SarifResult addLocations(llvm::ArrayRef<CharSourceRange> DiagLocs) {
358359
#ifndef NDEBUG
359360
for (const auto &Loc : DiagLocs) {
360361
assert(Loc.isCharRange() &&
361362
"SARIF Results require character granular source ranges!");
362363
}
363364
#endif
364-
Locations.assign(DiagLocs.begin(), DiagLocs.end());
365+
Locations.append(DiagLocs.begin(), DiagLocs.end());
365366
return *this;
366367
}
368+
369+
SarifResult addRelatedLocations(llvm::ArrayRef<CharSourceRange> DiagLocs) {
370+
#ifndef NDEBUG
371+
for (const auto &Loc : DiagLocs) {
372+
assert(
373+
Loc.isCharRange() &&
374+
"SARIF RelatedLocations require character granular source ranges!");
375+
}
376+
#endif
377+
RelatedLocations.append(DiagLocs.begin(), DiagLocs.end());
378+
return *this;
379+
}
380+
367381
SarifResult setThreadFlows(llvm::ArrayRef<ThreadFlow> ThreadFlowResults) {
368382
ThreadFlows.assign(ThreadFlowResults.begin(), ThreadFlowResults.end());
369383
return *this;

clang/include/clang/CIR/Dialect/IR/CIROps.td

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4756,6 +4756,27 @@ class CIR_UnaryFPToFPBuiltinOp<string mnemonic, string llvmOpName>
47564756
let llvmOp = llvmOpName;
47574757
}
47584758

4759+
def CIR_SqrtOp : CIR_UnaryFPToFPBuiltinOp<"sqrt", "SqrtOp"> {
4760+
let summary = "Floating-point square root operation";
4761+
4762+
let description = [{
4763+
Computes the square root of a floating-point value or vector.
4764+
4765+
The input must be either:
4766+
• a floating-point scalar type, or
4767+
• a vector whose element type is floating-point.
4768+
4769+
The result type must match the input type exactly.
4770+
4771+
Examples:
4772+
// scalar
4773+
%r = cir.sqrt %x : !cir.fp64
4774+
4775+
// vector
4776+
%v = cir.sqrt %vec : !cir.vector<!cir.fp32 x 4>
4777+
}];
4778+
}
4779+
47594780
def CIR_ACosOp : CIR_UnaryFPToFPBuiltinOp<"acos", "ACosOp"> {
47604781
let summary = "Computes the arcus cosine of the specified value";
47614782
let description = [{

clang/include/clang/Frontend/SARIFDiagnostic.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,20 @@ class SARIFDiagnostic : public DiagnosticRenderer {
6363
ArrayRef<CharSourceRange> Ranges,
6464
const Diagnostic &Diag);
6565

66+
SarifResult addRelatedLocationToResult(SarifResult Result, FullSourceLoc Loc,
67+
PresumedLoc PLoc);
68+
69+
llvm::SmallVector<CharSourceRange>
70+
getSarifLocation(FullSourceLoc Loc, PresumedLoc PLoc,
71+
ArrayRef<CharSourceRange> Ranges);
72+
6673
SarifRule addDiagnosticLevelToRule(SarifRule Rule,
6774
DiagnosticsEngine::Level Level);
6875

6976
llvm::StringRef emitFilename(StringRef Filename, const SourceManager &SM);
77+
78+
llvm::SmallVector<std::pair<FullSourceLoc, PresumedLoc>>
79+
RelatedLocationsCache;
7080
};
7181

7282
} // end namespace clang

clang/include/clang/Options/Options.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,8 @@ def mno_mpx : Flag<["-"], "mno-mpx">, Group<clang_ignored_legacy_options_Group>;
320320

321321
// Group that ignores all gcc optimizations that won't be implemented
322322
def clang_ignored_gcc_optimization_f_Group : OptionGroup<
323-
"<clang_ignored_gcc_optimization_f_Group>">, Group<f_Group>, Flags<[Ignored]>;
323+
"<clang_ignored_gcc_optimization_f_Group>">,
324+
Group<f_Group>, Flags<[Ignored]>, Visibility<[ClangOption, FlangOption]>;
324325

325326
class DiagnosticOpts<string base>
326327
: KeyPathAndMacro<"DiagnosticOpts->", base, "DIAG_"> {}

0 commit comments

Comments
 (0)