- May 26, 2023
-
-
Arthur Eubanks authored
EarlyFPM cleans up the output of the frontend. This isn't necessary in post link pipelines as the pre link pipeline already ran this. ~0.4% savings in ThinLTO builds: https://llvm-compile-time-tracker.com/compare.php?from=8a5d4eb775c644d8683f24817d44c510d2b853b7&to=3580252a2162eadca0da99f1eeaa112f74a0353d&stat=instructions:u Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D145403
-
Bjorn Pettersson authored
Need to finalize the DIBuilder to avoid leak sanitizer errors like this: Direct leak of 48 byte(s) in 1 object(s) allocated from: #0 0x55c99ea1761d in operator new(unsigned long) #1 0x55c9a518ae49 in operator new #2 0x55c9a518ae49 in llvm::MDTuple::getImpl(...) #3 0x55c9a4f1b1ec in getTemporary #4 0x55c9a4f1b1ec in llvm::DIBuilder::createFunction(...) -
Jacques Pienaar authored
For block arg locs a common case is no/uknown location (where the producer signifies they don't care about blockarg location). Also avoid needing to dynamically resize opnames during parsing. Assumed to be post lazy loading change, so chose version 3. Differential Revision: https://reviews.llvm.org/D151038
-
Laszlo Kindrat authored
Currently, the dialects precede the registered operations in the context object, which means that the latter is destroyed first. At the same time, Operation::~Operation dereferences the registered operation when destroying properties, which can cause use-after-free (e.g. if a dialect owns an op). This patch fixes that by changing the order of the members so that dialects come after registered operations. Differential Revision: https://reviews.llvm.org/D151440
-
Arthur Eubanks authored
We already have -print-on-crash which dumps the IR to stderr on a crash, but it's more useful to dump to a file. Introduce -print-on-crash-path to dump the IR to a file. Making -print-on-crash a string option is confusing if you only pass -print-on-crash and it swallows up the next command line arg, which is why this is a new option. Perhaps we could retire the dump to stderr version if people don't use it, but not sure how much people find that useful. Reviewed By: jamieschmeiser Differential Revision: https://reviews.llvm.org/D151170
-
- May 25, 2023
-
-
Roy Sundahl authored
# Darwin Sanitizers Stable ABI We wish to make it possible to include the AddressSanitizer (ASan) runtime implementation in OSes and for this we need a stable ASan ABI. Based on previous discussions about this topic, our understanding is that freezing the present ABI would impose an excessive burden on other sanitizer developers and for unrelated platforms. Therefore, we propose adding a secondary stable ABI for our use and anyone else in the community seeking the same. We believe that we can define a stable ABI with minimal burden on the community, expecting only to keep existing tests running and implementing stubs when new features are added. We are okay with trading performance for stability with no impact for existing users of ASan while minimizing the maintenance burden for ASan maintainers. We wish to commit this functionality to the LLVM project to maintain it there. This new and stable ABI will abstract away the implementation details allowing new and novel approaches to ASan for developers, researchers and others. ## Details Rather than adding a lot of conditional code to the LLVM instrumentation phase, which would incur excessive complexity and maintenance cost of adding conditional code into all places that emit a runtime call, we propose a “shim” layer which will map the unstable ABI to the stable ABI: * A static library (.a library) shim that maps the existing ASan ABI to a generalized, smaller and stable ABI. The library would implement the __asan functions and call into the new ABI. For example: * `void __asan_load1(uptr p) { __asan_abi_loadn(p, 1, true); }` * `void __asan_load2(uptr p) { __asan_abi_loadn(p, 2, true); }` * `void __asan_noabort_load16(uptr p) { __asan_abi_loadn(p, 16, false); }` * `void __asan_poison_cxx_array_cookie(uptr p) { __asan_abi_pac(p); }` * This “shim” library would only be used by people who opt in: A compilation flag in the Clang driver will be used to gate the use of the stable ABI workflow. * Utilize the existing ability for the ASan instrumentation to prefer runtime calls instead of inlined direct shadow memory accesses. * Pursue (under the new driver flag) a better separation of abstraction and implementation with: * LLVM instrumentation: Calling out for all poisoning, checking and unpoisoning. * Runtime: Implementing the stable ABI and being responsible of implementation details of the shadow memory. ## Maintenance Our aim is that the maintenance burden on the sanitizer developer community be negligible. Stable ABI tests will always pass for non-Darwin platforms. Changes to the existing ABI which would require a change to the shim have been infrequent as the ASan ABI is already relatively stable. Rarely, a change that impacts the contract between LLVM and the shim will occur. Among such foreseeable changes are: 1) changes to a function signature, 2) additions of new functions, or 3) deprecation of an existing function. Following are some examples of reasonable responses to those changes: * Example: An existing ABI function is changed to return the input parameter on success or NULL on failure. In this scenario, a reasonable change to the shim would be to modify the function signature appropriately and to simply guess at a common-sense implementation. * `uptr __asan_load1(uptr p) { __asan_abi_loadn(p, 1, true); return p; }` * Example: An additional function is added for performance reasons. It has a very similar function signature to other similarly named functions and logically is an extension of that same pattern. In this case it would make sense to apply the same logic as the existing entry points: * `void __asan_load128(uptr p) { __asan_abi_loadn(p, 128, true); }` * Example: An entry point is added to the existing ABI for which there is no obvious stable ABI implementation: In this case, doing nothing in a no-op stub would be acceptable, assuming existing features of ASan can still work without an actual implementation of this new function. * `void __asan_prefetch(uptr p) { }` * Example: An entrypoint in the existing ABI is deprecated and/or deleted: * (Delete the entrypoint from the shim.) We’re looking for buy-in for this level of support. (Note: Upon acceptance of the general concepts herein, we will add a controlling clang flag, cmake integration, contract for the stable ABI, and the appropriate test infrastructure.) Reviewed By: eugenis, vitalybuka, MaskRay Differential Revision: https://reviews.llvm.org/D143675 -
Marco Elver authored
Stacktraces should no longer show __asan_wrap_, but the "normal" function name. Reflect that in tests.
-
Jean Perier authored
The copy must made according to the actual type, not the dummy type. In case the dummy is polymorphic, these types will be different and the dynamic type of the copy passed in the call should be the one of the actual. There is no support for "class(t), value" yet (it is hitting a TODO in CallInterface that is moot for HLFIR but has not been lifted for lack of proper testing) so the bug was dormant, but D151271 created a situation where a copy is needed with polymorphic dummies and exposed the bug. This led to a compile time assert "value.isScalar() && fir::isa_trivial(value.getType())" in "hlfir::genAssociateExpr". Differential Revision: https://reviews.llvm.org/D151413
-
Denis Antrushin authored
!make.implicit metadata attached to branch means it will very likely be eliminated (together with associated cmp instruction). Reviewed By: apilipenko Differential Revision: https://reviews.llvm.org/D149747
-
Thurston Dang authored
release_to_os has been failing on powerpc64 since yesterday. Temporarily disabling the test to prevent this error from hiding other potential problems.
-
Laszlo Kindrat authored
This patch adds an overload for the `map_to_vector` helper template, exposing a parameter to control the size of the resulting `SmallVector`. A few call sites in mlir are updated to illustrate and test the change. Differential Revision: https://reviews.llvm.org/D150601
-
Teresa Johnson authored
As pointed out in https://discourse.llvm.org/t/undeterministic-thin-index-file/69985, the block count added to distributed ThinLTO index files breaks incremental builds on ThinLTO - if any linked file has a different number of BBs, then the accumulated sum placed in the index files will change, causing all ThinLTO backend compiles to be redone. This was only used for partial sample profiles, and was therefore removed for other cases (3adc6e03). Subsequent testing did not show a performance effect of disabling this feature even for partial sample profiles. Therefore, switch the default to false. If this does not cause a noticeable performance degradation after the default flip, we can remove this support completely. Differential Revision: https://reviews.llvm.org/D151249
-
Mark Santaniello authored
CPU profile indicated memcmp was hot due to the two rfind calls in getCanonicalFnName. If UseSymbolTable is false, we can avoid the cost entirely. For CSSPGO profiles I've measured ~5% speedup with this change. Profile similarity before/after matches 100%. Reviewed By: wenlei Differential Revision: https://reviews.llvm.org/D151441
-
Guray Ozen authored
This work enables folding memref alias pass for`vector.load` Reviewed By: qcolombet Differential Revision: https://reviews.llvm.org/D151447
-
Jay Foad authored
Differential Revision: https://reviews.llvm.org/D151421
-
Jay Foad authored
Add overloads of sshl_ov, ushl_ov, sshl_sat and ushl_sat that take the shift amount as unsigned instead of APInt. This matches what we do for the normal shift operators and can help to avoid creating temporary APInts in some cases. Differential Revision: https://reviews.llvm.org/D151420
-
Guillaume Chatelet authored
Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D151450
-
Jay Foad authored
Differential Revision: https://reviews.llvm.org/D151456
-
Nikolas Klauser authored
@Mordante noticed that this was missing while making `<format>` non-experimental. Reviewed By: ldionne, Mordante, #libc Spies: libcxx-commits, Mordante Differential Revision: https://reviews.llvm.org/D151240
-
Nikolas Klauser authored
Reviewed By: #libc, ldionne Spies: Mordante, libcxx-commits, ldionne, mikhail.ramalho Differential Revision: https://reviews.llvm.org/D144394
-
Philip Reames authored
-
Martin Braenne authored
This patch adds a test that crashes without the fix. Reviewed By: ymandel Differential Revision: https://reviews.llvm.org/D151201
-
Thorsten Schütt authored
Note that the builders are protected by is64Bit(). More fine-grained availibility checks. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D150790
-
Fangrui Song authored
The x86-64 medium code model utilizes large data sections, namely .lrodata, .lbss, and .ldata (along with some variants of .ldata). There is a proposal to extend the use of large data sections to the large code model as well[1]. This patch aims to place large data sections away from code sections in order to alleviate relocation overflow pressure caused by code sections referencing regular data sections. ``` .lrodata .rodata .text # if --ro-segment, MAXPAGESIZE alignment RELRO # MAXPAGESIZE alignment .data # MAXPAGESIZE alignment .bss .ldata # MAXPAGESIZE alignment .lbss ``` In comparison to GNU ld, which places .lbss, .lrodata, and .ldata after .bss, we place .lrodata above .rodata to minimize the number of permission transitions in the memory image. While GNU ld places .lbss after .bss, the subsequent sections don't reuse the file offset bytes of BSS. Our approach is to place .ldata and .lbss after .bss and create a PT_LOAD segment for .bss to large data section transition in the absence of SECTIONS commands. assignFileOffsets ensures we insert an alignment instead of allocating space for BSS, and therefore we don't waste more than MAXPAGESIZE bytes. We have a missing optimization to prevent all waste, but implementing it would introduce complexity and likely be error-prone. GNU ld's layout introduces 2 more MAXPAGESIZE alignments while ours introduces just one. [1]: https://groups.google.com/g/x86-64-abi/c/jnQdJeabxiU "Large data sections for the large code model" With help from Arthur Eubanks. Co-authored-by:
James Y Knight <jyknight@google.com> Reviewed By: aeubanks, tkoeppe Differential Revision: https://reviews.llvm.org/D150510
-
Jean Perier authored
Addresses comments not addressed in https://reviews.llvm.org/D151251 and https://reviews.llvm.org/D151247 - Fix typo in comments. - Update an expected test output to include the fir.allocmem argument. - Make a more generic type comparisons and cast when fetching value back from the AnyValueStack temporary storage. Differential Revision: https://reviews.llvm.org/D151428
-
Dhruv Chawla authored
When the worklist is initially being formed, there is no need to consider all nodes for pruning. This is because the first time calling getNextWorklistEntry will only clear those nodes which have no uses, with their operands being added to the worklist. However, when the worklist is created for the first time all nodes are added anyways, so this operation actually ends up adding no nodes. This patch adds a parameter IsCandidateForPruning to AddToWorklist with a default value of true to avoid having to update every call site. Differential Revision: https://reviews.llvm.org/D151416
-
Aliia Khasanova authored
Fix build file for https://github.com/llvm/llvm-project/commit/12648492998bd22d268eb1d4d476c6c3acc6c43d Differential Revision: https://reviews.llvm.org/D151427
-
Alexander Kornienko authored
Fix -Wunused-variable in release builds Reviewed By: krasimir Differential Revision: https://reviews.llvm.org/D151435
-
Simon Pilgrim authored
This will allow us to improve the diffs for D151400
-
Bjorn Pettersson authored
Make sure we do not crash in rfindDebugLoc when starting at instr_rend(). Solution is to see it as we start one MI before the first MI, so we can start searching forward at instr_begin() instead. This behavior is similar to how findPrevDebugLoc(instr_end()) works. Differential Revision: https://reviews.llvm.org/D150577
-
Bjorn Pettersson authored
- Add some unittests for the findDebugLoc, rfindDebugLoc, findPrevDebugLoc and rfindPrevDebugLoc helpers in MachineBasicBlock. - Clean up code comments and code formatting related to the functions mentioned above. This was extracted as a pre-commit to D150577, adn some of the tests are commented out since they would crash/assert in a rather uncontrolled way.
-
Alexey Lapshin authored
This patch fixes the problem introduced by D147066. As D147066 may change the contents of location expression, it started to calculate final attribute size. This patch uses more correct way to calculate size: DIEValue::sizeOf(). Differential Revision: https://reviews.llvm.org/D151348
-
Martin Braenne authored
Thanks to chapuni to pointing this out on https://reviews.llvm.org/D151183. Differential Revision: https://reviews.llvm.org/D151430
-
Marco Elver authored
Also implement StripFunctionName() on Windows to properly strip interceptor prefixes. Reported-by: https://lab.llvm.org/buildbot#builders/127/builds/48810
-
Guray Ozen authored
Folding mechanism does not recognize `ldmatrix` op. This work helps pass to recognize the op and fold the memref aliases. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D151412
-
Tom Eccles authored
InlineElementals created a regression when inlining elemental expressions where the type of the result of the hlfir.apply does not match the hlfir.yield. This patch ensures the pass doesn't match in these cases, fixing the regression. It isn't clear to me what the /right/ solution is: - Is it actually valid for the hlfir.apply to have a different type (even just different array bounds?). Should this be enforced in the verifier? - Inserting a convert if these types don't match doesn't work because fir.convert doesn't know how to convert a hlfir.expr. Should this be added? Test case is from @vzakhari Differential Revision: https://reviews.llvm.org/D151202
-
John Brawn authored
Currently we warn when MI->isBuiltinMacro, but this is only true for builtin macros that require processing when expanding. Checking SourceMgr.isWrittenInBuiltinFile in addition to this will mean that we catch all builtin macros, though we shouldn't warn on feature test macros. As part of doing this I've also moved the handling of undefining from CheckMacroName to HandleUndefDirective, as it doesn't really make sense to handle undefining in CheckMacroName but defining in HandleDefineDirective. It would be nice to instead handle both in CheckMacroName, but that isn't possible as the handling of defines requires looking at what the name is being defined to. Differential Revision: https://reviews.llvm.org/D144654
-
Felipe de Azevedo Piovezan authored
This will make it easier to add more cases in a subsequent commit and also better conforms to the coding guidelines. Differential Revision: https://reviews.llvm.org/D151328
-
LLVM GN Syncbot authored
-
Nico Weber authored
-