Skip to content

Distinct Attributes. #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 130 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
569716f
[flang][hlfir] Fix multiple return declaration type
tblah Jun 14, 2023
f523b9a
[flang] don't allow conversions between logical and floating point
tblah Jun 14, 2023
3f8d8c1
[flang][hlfir] Add hlfir.count intrinsic
jacob-crawley Jun 12, 2023
4511d3c
[InstSimplify] Add test for icmp of uadd.sat/usub.sat (NFC)
nikic Jun 19, 2023
f6a8775
[InstSimplify] Fold icmp of uadd.sat/usub.sat (PR63381)
nikic Jun 19, 2023
5400257
[FuncSpec] Add Freeze and CallBase to the InstCostVisitor.
labrinea Jun 19, 2023
6947db2
lldb: do more than 1 kilobyte at a time to vastly increase binary syn…
russelltg Jun 19, 2023
664b7a4
[SCCP] Fix conversion of range to constant for vectors (PR63380)
nikic Jun 19, 2023
65a2cde
Remove extra closing `)` from MLIR --view-op-graph GraphViz emission
joker-eph Jun 19, 2023
9ef73f2
Emit MLIR trampoline wrapper function with LLVM private linkage
joker-eph Jun 19, 2023
6f2e92c
Re-land [LLD] Allow usage of LLD as a library
aganea Jun 19, 2023
7e22921
[lldb][AArch64] Add thread local storage tpidr register
DavidSpickett Jun 19, 2023
a032dc1
[MLIR][OpenMP] Refactoring createTargetData in OMPIRBuilder
TIFitis Jun 19, 2023
c26fe19
[BasicAA] Add test for PR63266 (NFC)
nikic Jun 19, 2023
85232b0
HIP: Directly call isfinite builtins
arsenm Nov 20, 2022
f407a73
clang/HIP: Remove __llvm_amdgcn_* wrapper hacks
arsenm Nov 22, 2022
d8655fb
[libc++][NFC] Rename __lower_bound_impl to __lower_bound
ldionne Jun 16, 2023
dc71a77
[libc++][NFC] Move several .fail.cpp tests to .verify.cpp
ldionne Jun 16, 2023
c7d3c84
[libc++] Split sources for <filesystem>
ldionne Jun 12, 2023
c5a412d
[RISCV] Add support for XCVbitmanip extension in CV32E40P
melonedo Jun 14, 2023
9d4c1be
[mlir] Add support for LLVMIR comdat operation
DavidTruby Jun 16, 2023
d46d968
[BBUtils] Don't add 'then' block to a loop if it's terminated with un…
d-makogon Jun 8, 2023
028cf8c
[OpenMP] Implement printing TDGs to dot files
Munesanz Jun 15, 2023
ce9d3f0
[FuncSpec] Promote stack values before specialization.
labrinea Jun 19, 2023
cbd9585
[CVP] Add test for PR63330 (NFC)
nikic Jun 19, 2023
90b55f2
[CVP] Don't freeze value if guaranteed non-undef
nikic Jun 19, 2023
3956a34
[libc++] Move non operator new definitions outside of new.cpp
ldionne Jun 14, 2023
aabea3d
[mlir][Vector] Let VectorToLLVM operate on non-ModuleOp
nicolasvasilache Jun 19, 2023
8c80d01
[mlir][NVGPU] NFC - Add a more convenient C++ builder for nvgpu::MmaS…
nicolasvasilache Jun 19, 2023
798b641
[LSR] Add test for for issue leading to revert of abfeda5af329b5.
fhahn Jun 19, 2023
fa45f81
[clang][Serialization][RISCV] Increase the number of reserved predefi…
rofirrim Jun 19, 2023
66511b4
[DebugMetadata][DwarfDebug] Support function-local types in lexical b…
dzhidzhoev Jun 19, 2023
ab927a9
[AMDGPU] Fix operand class of v_ldexp_f16 src1
Sisyph Jun 12, 2023
d0f56c3
[AArch64] Add and expand the testing of fmin/fmax reduction. NFC
davemgreen Jun 19, 2023
3fa96d6
Reland "[gn build] Port 2700da5fe28d (lld/unittests etc)"
nico Jun 19, 2023
f25003d
[gn] port 3956a34e4fc6
nico Jun 19, 2023
ce02978
[gn] port c7d3c84449f4
nico Jun 19, 2023
3f1e450
Revert "[mlir][Vector] Let VectorToLLVM operate on non-ModuleOp"
nicolasvasilache Jun 19, 2023
72e5989
[mlir][Vector] Let VectorToLLVM operate on non-ModuleOp
nicolasvasilache Jun 19, 2023
3f05d04
[libc++] Update status after Varna meeting.
mordante Jun 17, 2023
e8b3ba2
[gn] port 6f2e92c10cebca5 better (lld/unittests)
nico Jun 19, 2023
a4f0764
[libc++] Marks __cpp_lib_bitops as implemented.
mordante Jun 18, 2023
cdcfc5e
[libc++][regex] Removes operator!=.
mordante Aug 16, 2022
f805c79
[libc++] "Implements" new SI prefixis.
mordante Jun 17, 2023
b4bb621
[BOLT] Implement composed relocations
mtvec Jun 19, 2023
bb4f4a3
[CVP] Add additional tests for PR63330 (NFC)
nikic Jun 19, 2023
7cfc82f
[CVP] Use simpler urem expansion when LHS >= RHS (PR63330)
nikic Jun 19, 2023
923dbb0
[llvm-mca][TimelineView] Skip invalid entries when printing the json …
adibiagio Jun 19, 2023
5aa03b6
[libc++][NFC] Apply clang-format on large parts of the code base
ldionne Jun 16, 2023
6c93b0d
[NFC] Add libc++ formatting commit to the git-blame ignore file
ldionne Jun 19, 2023
734881a
[Hexagon] Fix range checks for immediate operands
Jun 19, 2023
cb9b01f
ValueTracking: Handle compare to nan and -inf constants in fcmpToClas…
arsenm May 24, 2023
2a488b4
clang: Add __builtin_elementwise_round
arsenm Jan 5, 2023
7c89581
AMDGPU: Remove amdgpu-waves-per-eu support in old attribute pass
arsenm Dec 10, 2021
1288e72
[libc++][NFC] Sort header list in header_information.py
ldionne Jun 19, 2023
7972a6e
[DAGCombiner][NFC] Factor out ByteProvider
jrbyrnes May 8, 2023
632ccc5
[mlir][sparse][gpu] remove tuple as one of the spmm_buffer_size outpu…
Jun 19, 2023
eb74917
[AMDGPU] Reimplement the GFX11 early release VGPRs optimization
jayfoad Jun 19, 2023
c4039c1
[gn build] Port eb7491769a51
llvmgnsyncbot Jun 19, 2023
a8a8119
[mlir] Fix a rare use-after free in dialect loading
d0k Jun 19, 2023
ac2d6df
[AMDGPU] Add basic support for extended i8 perm matching
jrbyrnes May 8, 2023
dae5cd7
Recommit "[LSR] Consider post-inc form when creating extends/truncates."
fhahn Jun 19, 2023
aeb99dc
Revert "[DebugMetadata][DwarfDebug] Support function-local types in l…
dzhidzhoev Jun 19, 2023
706b547
[AIX][TLS] Relax front end diagnostics to accept the local-exec TLS m…
amy-kwan Jun 17, 2023
d565980
[AIX][TLS] Generate 64-bit local-exec access code sequence
amy-kwan Jun 17, 2023
1390675
[SpecialCaseList] Remove TrigramIndex
ellishg Jun 19, 2023
3350ec9
[libc++] Add missing 'return 0' from main functions in tests
ldionne Jun 19, 2023
2da4517
Reland "[DebugMetadata][DwarfDebug] Support function-local types in l…
dzhidzhoev Jun 19, 2023
21e1651
[libc] Remove the requirement of a platform-flush operation in File a…
Jun 16, 2023
2e6bb8c
[DebugInfo] Support more than 2 operands in DWARF operations
slinder1 Jun 19, 2023
407dcaf
[Driver] Correct -fnoxray-link-deps to -fno-xray-link-deps
MaskRay Jun 19, 2023
b3a08fa
[AMDGPU] Remove unused macro CNT_MASK
jayfoad Jun 19, 2023
4b6d41c
[AMDGPU] Do not release VGPRs if there may be pending scratch stores
jayfoad Jun 19, 2023
5866935
[DebugInfo] Add DW_OP_LLVM_user extension point
slinder1 May 17, 2023
b7a86d0
[xray][test] Test __xray_typedevent after D43668
MaskRay Jun 19, 2023
199f7dd
[XRay][X86] Remove sled version 0 support from patchCustomEvent
MaskRay Jun 19, 2023
fec7c64
Revert "Reland "[DebugMetadata][DwarfDebug] Support function-local ty…
dzhidzhoev Jun 19, 2023
cb9ac70
Reland "[DebugMetadata][DwarfDebug] Support function-local types in l…
dzhidzhoev Jun 19, 2023
a132f5e
[BOLT] Fix a warning in release builds
kazutakahirata Jun 20, 2023
3fa3cb4
[XRay] Make llvm.xray.typedevent parameter type match __xray_typedevent
MaskRay Jun 20, 2023
dafaa84
[XRay] Make llvm.xray.customevent parameter type match __xray_custome…
MaskRay Jun 20, 2023
516e326
[X86][AMX] set Stride to Tile's Col when doing combine amxcast and st…
yubingex007-a11y Jun 19, 2023
cb353dc
[LV] Add cost model for simd vector select instructions of type float
vfdff Jun 20, 2023
7ac0ff5
[lldb] Make test for D153043 independent of external symbols
Jun 20, 2023
a18b17b
[lldb] Make the test for D153043 linux-only
Jun 20, 2023
f8a4cd0
[xray][AArch64] Rewrite trampoline
MaskRay Jun 20, 2023
a3b9c15
[tools] Use llvm::is_contained (NFC)
kazutakahirata Jun 20, 2023
18ec203
[mlir][transform] Add ApplyRegisteredPassOp transform op
matthias-springer Jun 20, 2023
ab32cc6
[include-cleaner] Bailout on invalid code for the command-line tool
hokein Jun 19, 2023
c307502
[clangd] Index the type of a non-type template parameter
HighCommander4 Jun 20, 2023
aa7b127
[AMDGPU] Start documenting calling conventions. NFC
rovka Jun 7, 2023
d116f20
Fixup D151996
rovka Jun 20, 2023
aad5141
Revert "Prevent deadlocks in death tests."
martinboehme Jun 20, 2023
99610fa
Revert "[AMDGPU] Start documenting calling conventions. NFC"
rovka Jun 20, 2023
56e33d9
[CSKY][test][NFC] Add more tests of multiplication with immediates
benshi001 Jun 19, 2023
6d05f3f
[CSKY] Optimize multiplication with immediates
benshi001 Jun 19, 2023
189d944
[docs] Fix GEP faq references to undefined behavior [NFC]
nunoplopes Jun 20, 2023
c146df9
[clang][DebugInfo] Emit DW_AT_deleted on any deleted member function
Michael137 Jun 19, 2023
f6be081
[llvm-profdata] Fix llvm-profdata help and make sure it remains in sync
serge-sans-paille Jun 19, 2023
5c5eff4
[AMDGPU] Start documenting calling conventions. NFC
rovka Jun 7, 2023
041bfe4
[AMDGPU] Document amdgpu_cs_chain[_preserve] CCs. NFC
rovka Jun 7, 2023
06ebed3
[SCEVNormalization] Short circuit case with no loops (NFC)
nikic Jun 20, 2023
c63d2b2
[mlir][transform] Add TransformRewriter
matthias-springer Jun 20, 2023
fc06262
[llc][MISched] Add `-misched-detail-resource-booking` to llc.
fpetrogalli Jun 20, 2023
25f8b1a
Revert "[llc][MISched] Add `-misched-detail-resource-booking` to llc."
fpetrogalli Jun 20, 2023
37db9ca
[llc][MISched] Add `-misched-detail-resource-booking` to llc.
fpetrogalli Jun 20, 2023
dec42ff
[AMDGPU][GFX11] Add test coverage for FMA instructions.
kosarev Jun 20, 2023
c7430ff
[CodeGen][test] Add missing `REQUIRES`.
fpetrogalli Jun 20, 2023
1c64c41
[clang][index] Fix cast warning
jansvoboda11 Jun 20, 2023
2d3e6c4
[AMDGPU] Drop GFX11 runs for dagcombine-fma-fmad.ll and fma.f16.ll.
kosarev Jun 20, 2023
b6f3062
[Coroutines] Store the index for final suspend point in the exception…
ChuanqiXu9 Jun 20, 2023
36d5034
[clang][NFC] Drop alignment in builtin-nondeterministic-value test
ManuelJBrito Jun 11, 2023
ef9159c
[AArch64] Add Cortex-A510 specific scheduling
harviniriawan Jun 20, 2023
e2b19ef
[mlir] mark libraries in mlir/examples as such
ftynse Jun 19, 2023
f6c1796
[DWARFLinker] add DWARFUnit::getIndexedAddressOffset().
avl-llvm Jun 19, 2023
6bea833
Revert "Reland "[DebugMetadata][DwarfDebug] Support function-local ty…
dzhidzhoev Jun 20, 2023
149f309
[include-cleaner] Ignore the ParmVarDecl itself in WalkAST.cpp
hokein Jun 20, 2023
87da4b6
[mlir][Pass] Check supported op types before running a pass
matthias-springer Jun 20, 2023
8784b6a
[Clang] Allow bitcode linking when the input is LLVM-IR
jhuber6 Jun 7, 2023
efacdfc
[LinkerWrapper] Support linking vendor bitcode late
jhuber6 Jun 8, 2023
8cf8956
[lld][Arm] Big Endian - Byte invariant support.
simpal01 May 18, 2023
1d27ad2
[AArch64] Add tablegen patterns for fp16 fcvtn2.
davemgreen Jun 20, 2023
2efdacf
[LoongArch] Add missing chains and remove unnecessary `SDNPSideEffect…
SixWeining Jun 20, 2023
5dbd511
[libc][math] Improve tanhf performance.
lntue Jun 15, 2023
0ae409c
[libc][math] Slightly improve sinhf and coshf performance.
lntue Jun 15, 2023
46aa659
[libc][math] Improve exp2f performance.
lntue Jun 16, 2023
1f1385d
[LoongArch] Indent LoongArchInstrInfo.td a little bit. NFC
SixWeining Jun 20, 2023
699adde
[AMDGPU] Use verify<domtree> instead of intra-pass asserts.
pravinjagtap Jun 20, 2023
3dd319e
[LoongArch] Optimize conditional selection of integer
SixWeining Jun 20, 2023
eb3ca15
[mlir] Add a builtin distinct attribute
gysit Jun 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ dd3c26a045c081620375a878159f536758baba6e
f98ee40f4b5d7474fc67e82824bf6abbaedb7b1c
2238dcc39358353cac21df75c3c3286ab20b8f53
f9008e6366c2496b1ca1785b891d5578174ad63e

# [libc++][NFC] Apply clang-format on large parts of the code base
5aa03b648b827128d439f705cd7d57d59673741d
5 changes: 3 additions & 2 deletions bolt/include/bolt/Core/BinarySection.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class BinarySection {

// Relocations associated with this section. Relocation offsets are
// wrt. to the original section address and size.
using RelocationSetType = std::set<Relocation, std::less<>>;
using RelocationSetType = std::multiset<Relocation, std::less<>>;
RelocationSetType Relocations;

// Dynamic relocations associated with this section. Relocation offsets are
Expand Down Expand Up @@ -345,7 +345,8 @@ class BinarySection {
bool removeRelocationAt(uint64_t Offset) {
auto Itr = Relocations.find(Offset);
if (Itr != Relocations.end()) {
Relocations.erase(Itr);
auto End = Relocations.upper_bound(Offset);
Relocations.erase(Itr, End);
return true;
}
return false;
Expand Down
31 changes: 30 additions & 1 deletion bolt/include/bolt/Core/Relocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
#ifndef BOLT_CORE_RELOCATION_H
#define BOLT_CORE_RELOCATION_H

#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/TargetParser/Triple.h"

namespace llvm {
class MCStreamer;
class MCSymbol;
class raw_ostream;

Expand Down Expand Up @@ -122,8 +123,36 @@ struct Relocation {
/// responsible for setting the position correctly.
size_t emit(MCStreamer *Streamer) const;

/// Emit a group of composed relocations. All relocations must have the same
/// offset. If std::distance(Begin, End) == 1, this is equivalent to
/// Begin->emit(Streamer).
template <typename RelocIt>
static size_t emit(RelocIt Begin, RelocIt End, MCStreamer *Streamer) {
if (Begin == End)
return 0;

const MCExpr *Value = nullptr;

for (auto RI = Begin; RI != End; ++RI) {
assert(RI->Offset == Begin->Offset &&
"emitting composed relocations with different offsets");
Value = RI->createExpr(Streamer, Value);
}

assert(Value && "failed to create relocation value");
auto Size = std::prev(End)->getSize();
Streamer->emitValue(Value, Size);
return Size;
}

/// Print a relocation to \p OS.
void print(raw_ostream &OS) const;

private:
const MCExpr *createExpr(MCStreamer *Streamer) const;
const MCExpr *createExpr(MCStreamer *Streamer,
const MCExpr *RetainedValue) const;
static MCBinaryExpr::Opcode getComposeOpcodeFor(uint64_t Type);
};

/// Relocation ordering by offset.
Expand Down
55 changes: 38 additions & 17 deletions bolt/lib/Core/BinarySection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,46 @@ void BinarySection::emitAsData(MCStreamer &Streamer,
Streamer.emitBytes(SectionContents);
} else {
uint64_t SectionOffset = 0;
for (const Relocation &Relocation : relocations()) {
assert(Relocation.Offset < SectionContents.size() && "overflow detected");
for (auto RI = Relocations.begin(), RE = Relocations.end(); RI != RE;) {
auto RelocationOffset = RI->Offset;
assert(RelocationOffset < SectionContents.size() && "overflow detected");

if (SectionOffset < RelocationOffset) {
Streamer.emitBytes(SectionContents.substr(
SectionOffset, RelocationOffset - SectionOffset));
SectionOffset = RelocationOffset;
}

// Get iterators to all relocations with the same offset. Usually, there
// is only one such relocation but there can be more for composed
// relocations.
auto ROI = RI;
auto ROE = Relocations.upper_bound(RelocationOffset);

// Start from the next offset on the next iteration.
RI = ROE;

// Skip undefined symbols.
if (BC.UndefinedSymbols.count(Relocation.Symbol))
auto HasUndefSym = [this](const auto &Relocation) {
return BC.UndefinedSymbols.count(Relocation.Symbol);
};

if (std::any_of(ROI, ROE, HasUndefSym))
continue;
if (SectionOffset < Relocation.Offset) {
Streamer.emitBytes(SectionContents.substr(
SectionOffset, Relocation.Offset - SectionOffset));
SectionOffset = Relocation.Offset;

#ifndef NDEBUG
for (const auto &Relocation : make_range(ROI, ROE)) {
LLVM_DEBUG(
dbgs() << "BOLT-DEBUG: emitting relocation for symbol "
<< (Relocation.Symbol ? Relocation.Symbol->getName()
: StringRef("<none>"))
<< " at offset 0x" << Twine::utohexstr(Relocation.Offset)
<< " with size "
<< Relocation::getSizeForType(Relocation.Type) << '\n');
}
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: emitting relocation for symbol "
<< (Relocation.Symbol ? Relocation.Symbol->getName()
: StringRef("<none>"))
<< " at offset 0x"
<< Twine::utohexstr(Relocation.Offset) << " with size "
<< Relocation::getSizeForType(Relocation.Type) << '\n');
size_t RelocationSize = Relocation.emit(&Streamer);
#endif

size_t RelocationSize = Relocation::emit(ROI, ROE, &Streamer);
SectionOffset += RelocationSize;
}
assert(SectionOffset <= SectionContents.size() && "overflow error");
Expand Down Expand Up @@ -221,9 +244,7 @@ BinarySection::reorderRelocations(bool Inplace) const {
assert(NewRel.Offset < getSize());
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: moving " << Rel << " -> " << NewRel
<< "\n");
auto Res = NewRelocations.emplace(std::move(NewRel));
(void)Res;
assert(Res.second && "Can't overwrite existing relocation");
NewRelocations.emplace(std::move(NewRel));
}
return NewRelocations;
}
Expand Down
55 changes: 32 additions & 23 deletions bolt/lib/Core/Relocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,39 +817,48 @@ uint64_t Relocation::getRelative() {

size_t Relocation::emit(MCStreamer *Streamer) const {
const size_t Size = getSizeForType(Type);
const auto *Value = createExpr(Streamer);
Streamer->emitValue(Value, Size);
return Size;
}

const MCExpr *Relocation::createExpr(MCStreamer *Streamer) const {
MCContext &Ctx = Streamer->getContext();
const MCExpr *Value = nullptr;

if (Symbol && Addend) {
Value = MCBinaryExpr::createAdd(MCSymbolRefExpr::create(Symbol, Ctx),
MCConstantExpr::create(Addend, Ctx), Ctx);
} else if (Symbol) {
Value = MCSymbolRefExpr::create(Symbol, Ctx);
} else {
Value = MCConstantExpr::create(Addend, Ctx);
}

if (isPCRelative(Type)) {
MCSymbol *TempLabel = Ctx.createNamedTempSymbol();
Streamer->emitLabel(TempLabel);
const MCExpr *Value = nullptr;
if (Symbol) {
Value = MCSymbolRefExpr::create(Symbol, Ctx);
if (Addend) {
Value = MCBinaryExpr::createAdd(
Value, MCConstantExpr::create(Addend, Ctx), Ctx);
}
} else {
Value = MCConstantExpr::create(Addend, Ctx);
}
Value = MCBinaryExpr::createSub(
Value, MCSymbolRefExpr::create(TempLabel, Ctx), Ctx);
Streamer->emitValue(Value, Size);

return Size;
}

if (Symbol && Addend) {
auto Value =
MCBinaryExpr::createAdd(MCSymbolRefExpr::create(Symbol, Ctx),
MCConstantExpr::create(Addend, Ctx), Ctx);
Streamer->emitValue(Value, Size);
} else if (Symbol) {
Streamer->emitSymbolValue(Symbol, Size);
} else {
Streamer->emitIntValue(Addend, Size);
return Value;
}

const MCExpr *Relocation::createExpr(MCStreamer *Streamer,
const MCExpr *RetainedValue) const {
const auto *Value = createExpr(Streamer);

if (RetainedValue) {
Value = MCBinaryExpr::create(getComposeOpcodeFor(Type), RetainedValue,
Value, Streamer->getContext());
}

return Size;
return Value;
}

MCBinaryExpr::Opcode Relocation::getComposeOpcodeFor(uint64_t Type) {
llvm_unreachable("not implemented");
}

#define ELF_RELOC(name, value) #name,
Expand Down
4 changes: 4 additions & 0 deletions clang-tools-extra/include-cleaner/lib/WalkAST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ class ASTWalker : public RecursiveASTVisitor<ASTWalker> {
return true;
}
bool VisitVarDecl(VarDecl *VD) {
// Ignore the parameter decl itself (its children were handled elsewhere),
// as they don't contribute to the main-file #include.
if (llvm::isa<ParmVarDecl>(VD))
return true;
// Mark declaration from definition as it needs type-checking.
if (VD->isThisDeclarationADefinition())
report(VD->getLocation(), VD);
Expand Down
10 changes: 9 additions & 1 deletion clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,18 @@ class Action : public clang::ASTFrontendAction {
}

void EndSourceFile() override {
const auto &SM = getCompilerInstance().getSourceManager();
if (SM.getDiagnostics().hasUncompilableErrorOccurred()) {
llvm::errs()
<< "Skipping file " << getCurrentFile()
<< " due to compiler errors. clang-include-cleaner expects to "
"work on compilable source code.\n";
return;
}

if (!HTMLReportPath.empty())
writeHTML();

const auto &SM = getCompilerInstance().getSourceManager();
auto &HS = getCompilerInstance().getPreprocessor().getHeaderSearchInfo();
llvm::StringRef Path =
SM.getFileEntryForID(SM.getMainFileID())->tryGetRealPathName();
Expand Down
4 changes: 2 additions & 2 deletions clang-tools-extra/include-cleaner/unittests/AnalysisTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ TEST_F(WalkUsedTest, Basic) {
#include "header.h"
#include "private.h"

void $bar^bar($private^Private $p^p) {
// No reference reported for the Parameter "p".
void $bar^bar($private^Private p) {
$foo^foo();
std::$vector^vector $vconstructor^$v^v;
$builtin^__builtin_popcount(1);
Expand Down Expand Up @@ -120,7 +121,6 @@ TEST_F(WalkUsedTest, Basic) {
offsetToProviders(AST, SM),
UnorderedElementsAre(
Pair(Code.point("bar"), UnorderedElementsAre(MainFile)),
Pair(Code.point("p"), UnorderedElementsAre(MainFile)),
Pair(Code.point("private"),
UnorderedElementsAre(PublicFile, PrivateFile)),
Pair(Code.point("foo"), UnorderedElementsAre(HeaderFile)),
Expand Down
4 changes: 4 additions & 0 deletions clang/docs/LanguageExtensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,10 @@ Unless specified otherwise operation(±0) = ±0 and operation(±infinity) = ±in
rounding halfway cases to even (that is, to the nearest value
that is an even integer), regardless of the current rounding
direction.
T __builtin_elementwise_round(T x) round x to the nearest integer value in floating point format, floating point types
rounding halfway cases away from zero, regardless of the
current rounding direction. May raise floating-point
exceptions.
T __builtin_elementwise_trunc(T x) return the integral value nearest to but no larger in floating point types
magnitude than x
T __builtin_elementwise_canonicalize(T x) return the platform specific canonical encoding floating point types
Expand Down
4 changes: 4 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ Non-comprehensive list of changes in this release
variable as a way to disable color diagnostics.
- Clang now supports ``__builtin_isfpclass``, which checks if the specified
floating-point value falls into any of the specified data classes.
- Added ``__builtin_elementwise_round`` for builtin for floating
point types. This allows access to ``llvm.round`` for
arbitrary floating-point and vector of floating-point types.


New Compiler Flags
------------------
Expand Down
1 change: 1 addition & 0 deletions clang/include/clang/Basic/Builtins.def
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ BUILTIN(__builtin_elementwise_log, "v.", "nct")
BUILTIN(__builtin_elementwise_log2, "v.", "nct")
BUILTIN(__builtin_elementwise_log10, "v.", "nct")
BUILTIN(__builtin_elementwise_roundeven, "v.", "nct")
BUILTIN(__builtin_elementwise_round, "v.", "nct")
BUILTIN(__builtin_elementwise_sin, "v.", "nct")
BUILTIN(__builtin_elementwise_trunc, "v.", "nct")
BUILTIN(__builtin_elementwise_canonicalize, "v.", "nct")
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/CodeGen/CodeGenAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class CodeGenAction : public ASTFrontendAction {

std::unique_ptr<llvm::Module> loadModule(llvm::MemoryBufferRef MBRef);

/// Load bitcode modules to link into our module from the options.
bool loadLinkModules(CompilerInstance &CI);

protected:
/// Create a new code generation action. If the optional \p _VMContext
/// parameter is supplied, the action uses it without taking ownership,
Expand Down
6 changes: 2 additions & 4 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -2266,10 +2266,8 @@ defm xray_function_index : BoolFOption<"xray-function-index",
" expense of single-function patching performance">>;

def fxray_link_deps : Flag<["-"], "fxray-link-deps">, Group<f_Group>,
Flags<[CC1Option]>,
HelpText<"Tells clang to add the link dependencies for XRay.">;
def fnoxray_link_deps : Flag<["-"], "fnoxray-link-deps">, Group<f_Group>,
Flags<[CC1Option]>;
HelpText<"Link XRay runtime library when -fxray-instrument is specified (default)">;
def fno_xray_link_deps : Flag<["-"], "fno-xray-link-deps">, Group<f_Group>;

def fxray_instrumentation_bundle :
Joined<["-"], "fxray-instrumentation-bundle=">,
Expand Down
10 changes: 9 additions & 1 deletion clang/include/clang/Serialization/ASTBitCodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1099,14 +1099,22 @@ enum PredefinedTypeIDs {
// \brief WebAssembly reference types with auto numeration
#define WASM_TYPE(Name, Id, SingletonId) PREDEF_TYPE_##Id##_ID,
#include "clang/Basic/WebAssemblyReferenceTypes.def"
// Sentinel value. Considered a predefined type but not useable as one.
PREDEF_TYPE_LAST_ID
};

/// The number of predefined type IDs that are reserved for
/// the PREDEF_TYPE_* constants.
///
/// Type IDs for non-predefined types will start at
/// NUM_PREDEF_TYPE_IDs.
const unsigned NUM_PREDEF_TYPE_IDS = 300;
const unsigned NUM_PREDEF_TYPE_IDS = 500;

// Ensure we do not overrun the predefined types we reserved
// in the enum PredefinedTypeIDs above.
static_assert(PREDEF_TYPE_LAST_ID < NUM_PREDEF_TYPE_IDS,
"Too many enumerators in PredefinedTypeIDs. Review the value of "
"NUM_PREDEF_TYPE_IDS");

/// Record codes for each kind of type.
///
Expand Down
3 changes: 3 additions & 0 deletions clang/lib/CodeGen/CGBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3194,6 +3194,9 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
case Builtin::BI__builtin_elementwise_roundeven:
return RValue::get(emitUnaryBuiltin(*this, E, llvm::Intrinsic::roundeven,
"elt.roundeven"));
case Builtin::BI__builtin_elementwise_round:
return RValue::get(emitUnaryBuiltin(*this, E, llvm::Intrinsic::round,
"elt.round"));
case Builtin::BI__builtin_elementwise_sin:
return RValue::get(
emitUnaryBuiltin(*this, E, llvm::Intrinsic::sin, "elt.sin"));
Expand Down
Loading