Age | Commit message (Collapse) | Author | Files | Lines |
|
This patch aims to improve how parenting relationships
are represented in the AST.
Currently regular declarations can only be children of
special AST nodes which inherit from DeclContext, except
for a few special cases which are required by itanium mangling.
Having this parenting relationship well described helps
in tracking which entities are dependent, and an improvement
here would allow us to drop a lot of workarounds and to
get some difficult cases right.
This patch extends the ContextDecl tracking which currently
is used for mangling, in order to cover almost needed cases.
Template type aliases represent a specially difficult case
which is addressed by this patch.
They can be contexts for other declarations, but besides not
being DeclContexts, they also lack a declaration which
represents their specialization.
This patch addresses the type alias context problem by
storing the specialization arguments along with the ContextDecl
for entities declared in their context.
TODO:
* Move away from using ExpressionEvaluationContexts, and use the same
stack used for tracking the CurContext. Remove the separate ContextDecl
field, and have that functionally built in to the base Decl class,
so that we don't separatelly treack both a parent Decl and a parent
DeclContext.
* A function type has ParmVarDecls, and these can appear inside
aliases and template type aliases in particular, so a ParmvarDecl
needs a ContextDecl too.
|
|
NFC (#107776)
|
|
We were incorrectly making ISD::FMAXIMUM, ISD::FMINIMUM, and
ISD::FNEARBYINT legal with Zfhmin+Zfa when we really need Zfh+Zfa.
|
|
This is to try and fix buildbot failure on
[clang-ppc64-aix](https://lab.llvm.org/buildbot/#/builders/64/builds/881)
from my changes in #96630. I don't really know much about AIX so it
would be good to have someone more knowledgeable to say if visibility
macros on extern templates is needed on AIX similar to ELF. @compnerd
@tstellar
|
|
Close https://github.com/llvm/llvm-project/issues/107673
|
|
|
|
Implement large code model for GlobalAddressSDNode and ExternalSymbolSDNode.
See discussion on
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/388.
---------
Co-authored-by: Kuan-Lin Chen <rufus@andestech.com>
|
|
/llvm-project/mlir/lib/Dialect/Vector/IR/VectorOps.cpp:2923:29: error: 'dyn_cast' is deprecated: Use mlir::dyn_cast<U>() instead [-Werror,-Wdeprecated-declarations]
2923 | if (auto intAttr = attr.dyn_cast<IntegerAttr>()) {
| ^
/llvm-project/mlir/include/mlir/IR/Attributes.h:184:14: note: 'dyn_cast' has been explicitly marked deprecated here
184 | U Attribute::dyn_cast() const {
| ^
|
|
Added proxy header for the jmp_buf type and changed all use instances
from __jmp_buf * to the typedef alias jmp_buf , fixed the link to LLVM
in stack_t.h description
|
|
resolution in ELF" (#107788)
Reverts llvm/llvm-project#106193 while investigating bot failures
https://lab.llvm.org/buildbot/#/builders/169/builds/2989/steps/9/logs/stdio
|
|
from a llvm.mlir.constant op (#88314)
In cases where llvm.mlir.constant has an attribute with a different type than the returned type,
the folder use to create an incorrect DenseElementsAttr and crash.
Resolves #74236
|
|
ELF (#106193)
`StringMap<T>` creates a [copy of the
string](https://github.com/llvm/llvm-project/blob/d4c519e7b2ac21350ec08b23eda44bf4a2d3c974/llvm/include/llvm/ADT/StringMapEntry.h#L55-L58)
for entry insertions and intentionally keep copies [since the
implementation optimizes string memory
usage](https://github.com/llvm/llvm-project/blob/d4c519e7b2ac21350ec08b23eda44bf4a2d3c974/llvm/include/llvm/ADT/StringMap.h#L124).
On the other hand, linker keeps copies of symbol names [1] in
`lld::elf::parseFiles` [2] before invoking `compileBitcodeFiles` [3].
This change proposes to optimize away string copies inside
[LTO::GlobalResolutions](https://github.com/llvm/llvm-project/blob/24e791b4164986a1ca7776e3ae0292ef20d20c47/llvm/include/llvm/LTO/LTO.h#L409),
which will make LTO indexing more memory efficient for ELF. There are
similar opportunities for other (COFF, wasm, MachO) formats.
The optimization takes place for lld (ELF) only. For the rest of use
cases (gold plugin, `llvm-lto2`, etc), LTO owns a string saver to keep
copies and use global resolution key for de-duplication.
Together with @kazutakahirata's work to make `ComputeCrossModuleImport`
more memory efficient, we see a ~20% peak memory usage reduction in a
binary where peak memory usage needs to go down. Thanks to the
optimization in
https://github.com/llvm/llvm-project/commit/329ba523ccbbe68a12434926c92fd9a86494d958,
the max (as opposed to the sum) of `ComputeCrossModuleImport` or
`GlobalResolution` shows up in peak memory usage.
* Regarding correctness, the set of
[resolved](https://github.com/llvm/llvm-project/blob/80c47ad3aec9d7f22e1b1bdc88960a91b66f89f1/llvm/lib/LTO/LTO.cpp#L739)
[per-module
symbols](https://github.com/llvm/llvm-project/blob/80c47ad3aec9d7f22e1b1bdc88960a91b66f89f1/llvm/include/llvm/LTO/LTO.h#L188-L191)
is a subset of
[llvm::lto::InputFile::Symbols](https://github.com/llvm/llvm-project/blob/80c47ad3aec9d7f22e1b1bdc88960a91b66f89f1/llvm/include/llvm/LTO/LTO.h#L120).
And bitcode symbol parsing saves symbol name when iterating
`obj->symbols` in `BitcodeFile::parse` already. This change updates
`BitcodeFile::parseLazy` to keep copies of per-module undefined symbols.
* Presumably the undefined symbols in a LTO unit (copied in this patch
in linker unique saver) is a small set compared with the set of symbols
in global-resolution (copied before this patch), making this a
worthwhile trade-off. Benchmarking this change alone shows measurable
memory savings across various benchmarks.
[1] ELF
https://github.com/llvm/llvm-project/blob/1cea5c2138bef3d8fec75508df6dbb858e6e3560/lld/ELF/InputFiles.cpp#L1748
[2]
https://github.com/llvm/llvm-project/blob/ef7b18a53c0d186dcda1e322be6035407fdedb55/lld/ELF/Driver.cpp#L2863
[3]
https://github.com/llvm/llvm-project/blob/ef7b18a53c0d186dcda1e322be6035407fdedb55/lld/ELF/Driver.cpp#L2995
|
|
In 362da640dd18 "[SandboxIR][Bench] Test RAUW (#107440)" we started
using std::stringstream, but didn't include `<sstream>` for the
definition. This is resulting in a build failure on windows.
|
|
Migrate CTags/DFA/Directive Emitters to const RecordKeeper.
|
|
Eliminate DefInit::get() as its a duplicate of Record::getDefInit().
Use early return in `VarDefInit::instantiate`.
|
|
(#107738)
Cleaning up _all_ the scopes is a little too much. Only clean up until
the point here we started the scope relevant for the break/continue
statement.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
We could also use range-based for loops at several places, but I'm
leaving that to a subsequent patch.
|
|
aggregate initialization using a default member initializer" (#97308)
The PR reapply https://github.com/llvm/llvm-project/pull/92527.
Implemented CWG1815 and fixed the bugs mentioned in the comments of
https://github.com/llvm/llvm-project/pull/92527 and
https://github.com/llvm/llvm-project/pull/87933.
The reason why the original PR was reverted was that errors might occur
during the rebuild.
---------
Signed-off-by: yronglin <yronglin777@gmail.com>
|
|
align its size to 4KB on ARM64EC. (#107588)
This mimics the behavior of MSVC's link.exe. My guess is that the reason
for this approach is to facilitate tracking runtime IAT modifications.
An auxiliary IAT allows bypassing the call checker for imported function
calls. It's the OS's responsibility to ensure that, if runtime patching
occurs, the auxiliary IAT is reverted to enable call checking. Modifying
the IAT is a form of runtime patching, and ensuring that it doesn’t
share pages with other data likely helps with tracking accuracy.
Although alignment alone should ensure that the IAT occupies its own
pages, placing it at the beginning of the .rdata section might be an
optimization. This way, padding is only needed after the IAT, not
before. The auxiliary IAT seems to follow a similar idea but is
positioned at the end of the .rdata section.
|
|
(#107697)
Migrate LLVM RISCVTarget/VT Emitters to const RecordKeeper.
|
|
|
|
|
|
C1, C2 -> XOR(C1,AND(NEG(AND(X,1)),XOR(C1,C2))"
Use xor-bitselect pattern to avoid branching when selecting between 2 constants
|
|
(sbb), Y" fold
Move fold into LowerSELECTWithCmpZero so it can be used with (AND X,1) ==/!= 0 select cases
|
|
FIXME: Move this to the relevant block.
|
|
|
|
NEG(AND(X,1))"
|
|
comment describing fold for clarity. NFC.
Minor refactor step before extending fold to support more patterns.
|
|
|
|
As far as I can tell, V_SET_INACTIVE has never had tied operands.
|
|
|
|
|
|
|
|
Implement `&&`, `||` logical operators for vector type.
---------
Signed-off-by: yronglin <yronglin777@gmail.com>
|
|
reporting. (#106356)
This PR adds DK_Instrumentation enum to DiagnosticKind and
DiagnosticInfoInstrumentation is extended from DiagnosticsInfo for IR
instrumentation reporting.
|
|
|
|
We use OidGuidMap only to map an old GUID to a new one. We don't use
std::set's strengths like iterators staying valid or the ability to
traverse in a sorted order.
As a data point, during the ThinLTO indexing step of a large
application of ours, we create 440,000 mappings. Our memory profiler
reports reduction of 127MB in the peak memory usage (out of 4.991GB),
which is bigger than expected savings most likely due to some noise.
The savings should be about 8MB at the max load factor of DenseMap.
|
|
|
|
Reverts llvm/llvm-project#107159 as this is still causing
`TestSkinnyCorefile.py` to time out.
https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/as-lldb-cmake/11099/
https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/lldb-cmake/5544/
|
|
The Status constructor that takes an error has been removed in favor of
Status::FromError.
|
|
Fixes #107568.
|
|
Migrate libc-hdrgen backend to use const RecordKeeper
|
|
- Migrate MLIR backends to use a const RecordKeeper reference.
|
|
Instead, move it to CodeGenTarget class, and use it in both
PatternParser and SearchableTableEmitter.
|