- Aug 04, 2021
-
-
Dmitry Vyukov authored
Currently we effectively duplicate "once" logic for __cxa_guard_acquire and pthread_once. Unify the implementations. This is not a no-op change: - constants used for pthread_once are changed to match __cxa_guard_acquire (__cxa_guard_acquire constants are tied to ABI, but it does not seem to be the case for pthread_once) - pthread_once now also uses PotentiallyBlockingRegion annotations - __cxa_guard_acquire checks thr->in_ignored_lib to skip user synchronization It's unclear if these 2 differences are intentional or a mere sloppy inconsistency. Since all tests still pass, let's assume the latter. Reviewed By: vitalybuka, melver Differential Revision: https://reviews.llvm.org/D107359
-
Dmitry Vyukov authored
Atomic functions are semi-hot in profiles. The CHECKs verify values passed by compiler and they never fired, so replace them with DCHECKs. Reviewed By: vitalybuka, melver Differential Revision: https://reviews.llvm.org/D107373
-
Dmitry Vyukov authored
1. Add some comments. 2. Use kInvalidStackID instead of literal 0. 3. Add more LIKELY/UNLIKELY. Reviewed By: vitalybuka, melver Differential Revision: https://reviews.llvm.org/D107371
-
David Spickett authored
Like Windows on x86-64, Windows on arm64 uses structured exception handling, so we don't emit .debug_frame. See: https://docs.microsoft.com/en-us/cpp/build/arm64-exception-handling?view=msvc-160 Reviewed By: ostannard Differential Revision: https://reviews.llvm.org/D107440
-
Tim Northover authored
Forgot "git add" for a new file.
-
Jaroslav Sevcik authored
Summary: In the spirit of https://reviews.llvm.org/D70846, we only return functions with matching mangled name from Apple/DebugNamesDWARFIndex::GetFunction if eFunctionNameTypeFull is requested. This speeds up lookup in the presence of large amount of class methods of the same name (a typical examples would be constructors of templates with many instantiations or overloaded operators). Reviewers: labath, teemperor Reviewed By: labath, teemperor Subscribers: aprantl, arphaman, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D73191
-
Matthias Springer authored
Differential Revision: https://reviews.llvm.org/D107439
-
Serge Pavlov authored
This reverts commit 16ff91eb. Several errors were reported mainly test-suite execution time. Reverted for investigation.
-
Simon Pilgrim authored
Our list of slow/fast tuning feature flags has become pretty extensive and is randomly interleaved with ISA and Security (Retpoline etc.) flags, not even based on when the ISAs/flags were introduced, making it tricky to locate them. Plus we started treating tuning flags separately some time ago, so this patch tries to group the flags to match. I've left them mostly in the same order within each group - I'm happy to rearrange them further if there are specific ISA or Tuning flags that you think should be kept closer together. Differential Revision: https://reviews.llvm.org/D107370
-
Kim-Anh Tran authored
This patch fixes the lookup of locations in .debug_loclists, if they are split in a .dwp file. Mainly, we need to consider the cu index offsets. Reviewed By: jankratochvil Differential Revision: https://reviews.llvm.org/D107161
-
David Spickett authored
We use CMAKE_SYSTEM_PROCESSOR to set the host_arch lit feature. This is going to be the same value as CMAKE_HOST_SYSTEM_PROCESSOR, which on windows is set to the value of the PROCESSOR_ARCHITECTURE environment variable. https://cmake.org/cmake/help/latest/variable/CMAKE_HOST_SYSTEM_PROCESSOR.html#cmake-host-system-processor On Windows on Arm this is "ARM64", not "AArch64" as we currently look for. https://docs.microsoft.com/en-us/windows/win32/winprog64/wow64-implementation-details#environment-variables Add ARM64 to the unsupported list. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D107361
-
Raphael Isemann authored
As pointed out in D107434 by Walter, D103172 also changed two for loops that were actually not just iterating over some DIEs but also using the iteration variable later on for some other things. This patch reverts the respective faulty parts of D103172.
-
Tim Northover authored
If there's a region of the stack reserved for potential tail call arguments (only the case when we guarantee tail calls will be honoured), this is right next to the incoming stored return address, not necessarily next to the callee-saved area, so combining the two into a single figure leads to incorrect offsets in some edge cases.
-
Serge Pavlov authored
Clang has builtin function '__builtin_isnan', which implements C library function 'isnan'. This function now is implemented entirely in clang codegen, which expands the function into set of IR operations. There are three mechanisms by which the expansion can be made. * The most common mechanism is using an unordered comparison made by instruction 'fcmp uno'. This simple solution is target-independent and works well in most cases. It however is not suitable if floating point exceptions are tracked. Corresponding IEEE 754 operation and C function must never raise FP exception, even if the argument is a signaling NaN. Compare instructions usually does not have such property, they raise 'invalid' exception in such case. So this mechanism is unsuitable when exception behavior is strict. In particular it could result in unexpected trapping if argument is SNaN. * Another solution was implemented in https://reviews.llvm.org/D95948. It is used in the cases when raising FP exceptions by 'isnan' is not allowed. This solution implements 'isnan' using integer operations. It solves the problem of exceptions, but offers one solution for all targets, however some can do the check in more efficient way. * Solution implemented by https://reviews.llvm.org/D96568 introduced a hook 'clang::TargetCodeGenInfo::testFPKind', which injects target specific code into IR. Now only SystemZ implements this hook and it generates a call to target specific intrinsic function. Although these mechanisms allow to implement 'isnan' with enough efficiency, expanding 'isnan' in clang has drawbacks: * The operation 'isnan' is hidden behind generic integer operations or target-specific intrinsics. It complicates analysis and can prevent some optimizations. * IR can be created by tools other than clang, in this case treatment of 'isnan' has to be duplicated in that tool. Another issue with the current implementation of 'isnan' comes from the use of options '-ffast-math' or '-fno-honor-nans'. If such option is specified, 'fcmp uno' may be optimized to 'false'. It is valid optimization in general, but it results in 'isnan' always returning 'false'. For example, in some libc++ implementations the following code returns 'false': std::isnan(std::numeric_limits<float>::quiet_NaN()) The options '-ffast-math' and '-fno-honor-nans' imply that FP operation operands are never NaNs. This assumption however should not be applied to the functions that check FP number properties, including 'isnan'. If such function returns expected result instead of actually making checks, it becomes useless in many cases. The option '-ffast-math' is often used for performance critical code, as it can speed up execution by the expense of manual treatment of corner cases. If 'isnan' returns assumed result, a user cannot use it in the manual treatment of NaNs and has to invent replacements, like making the check using integer operations. There is a discussion in https://reviews.llvm.org/D18513#387418, which also expresses the opinion, that limitations imposed by '-ffast-math' should be applied only to 'math' functions but not to 'tests'. To overcome these drawbacks, this change introduces a new IR intrinsic function 'llvm.isnan', which realizes the check as specified by IEEE-754 and C standards in target-agnostic way. During IR transformations it does not undergo undesirable optimizations. It reaches instruction selection, where is lowered in target-dependent way. The lowering can vary depending on options like '-ffast-math' or '-ffp-model' so the resulting code satisfies requested semantics. Differential Revision: https://reviews.llvm.org/D104854
-
Andre Vieira authored
Differential Revision: https://reviews.llvm.org/D107376
-
Sjoerd Meijer authored
This adds support for specialising recursive functions. For example: int Global = 1; void recursiveFunc(int *arg) { if (*arg < 4) { print(*arg); recursiveFunc(*arg + 1); } } void main() { recursiveFunc(&Global); } After 3 iterations of function specialisation, followed by inlining of the specialised versions of recursiveFunc, the main function looks like this: void main() { print(1); print(2); print(3); } To support this, the following has been added: - Update the solver and state of the new specialised functions, - An optimisation to propagate constant stack values after each iteration of function specialisation, which is necessary for the next iteration to recognise the constant values and trigger. Specialising recursive functions is (at the moment) controlled by option -func-specialization-max-iters and is opt-in for compile-time reasons. I.e., the default is -func-specialization-max-iters=1, but for the example above we would need to use -func-specialization-max-iters=3. Future work is to see if we can increase the default, or improve the cost-model/heuristics to control compile-times. Differential Revision: https://reviews.llvm.org/D106426 -
Senran Zhang authored
This allows users accessing options in libSupport before invoking `cl::ParseCommandLineOptions`, and also matches the behavior before D105959. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D106334
-
Adrian Kuegel authored
The dependency is needed after 1b00b94f Differential Revision: https://reviews.llvm.org/D107426
-
Esme-Yi authored
-
Stephen Neuendorffer authored
The existing vector transforms reduce the dimension of transfer_read ops. However, beyond a certain point, the vector op actually has to be reduced to a scalar load, since we can't load a zero-dimension vector. This handles this case. Note that in the longer term, it may be preferaby to support zero-dimension vectors. see https://llvm.discourse.group/t/should-we-have-0-d-vectors/3097. Differential Revision: https://reviews.llvm.org/D103432
-
hsmahesha authored
While collecting reachable callees (from kernels), ignore call graph node which does not have associated function or associated function is not a definition. Reviewed By: rampitec Differential Revision: https://reviews.llvm.org/D107329
-
Senran Zhang authored
Constant::getSplatValue has O(N) time complexity in the worst case, where N is the # of elements in a vector. So we call Constant::getAggregateElement first and return earlier if possible to avoid unnecessary getSplatValue calls. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D107252
-
Matthias Springer authored
This test ensures that an error is generated from the Python side when running a module pass on a function. The test used to instantiate ViewOpGraph, however, this pass was changed into a general "any op" pass in D106253. Therefore, a different pass must be used in this test. Differential Revision: https://reviews.llvm.org/D107424
-
Heejin Ahn authored
- Rename `wasm.catch` intrinsic to `wasm.catch.exn`, because we are planning to add a separate `wasm.catch.longjmp` intrinsic which returns two values. - Rename several variables - Remove an unnecessary parameter from `canLongjmp` and `isEmAsmCall` from LowerEmscriptenEHSjLj pass - Add `-verify-machineinstrs` in a test for a safety measure - Add more comments + fix some errors in comments - Replace `std::vector` with `SmallVector` for cases likely with small number of elements - Renamed `EnableEH`/`EnableSjLj` to `EnableEmEH`/`EnableEmSjLj`: We are soon going to add `EnableWasmSjLj`, so this makes the distincion clearer Reviewed By: tlively Differential Revision: https://reviews.llvm.org/D107405
-
Arthur Eubanks authored
Previously we would emit constant pool entries for ldr inline asm at the very end of AsmPrinter::doFinalization(). However, if we're emitting dwarf aranges, that would end all sections with aranges. Then if we have constant pool entries to be emitted in those same sections, we'd hit an assert that the section has already been ended. We want to emit constant pool entries before emitting dwarf aranges. This patch splits out arm32/64's constant pool entry emission into its own MCTargetStreamer virtual method. Fixes PR51208 Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D107314
-
Matthias Springer authored
* New pass option `max-label-len`: Truncate attributes/result types that have more #chars. * New pass option `print-attrs`: Activate/deactivate rendering of attributes. * New pass option `printResultTypes`: Activate/deactivate rendering of result types. Differential Revision: https://reviews.llvm.org/D106337
-
Vitaly Buka authored
Followup for D105522 Differential Revision: https://reviews.llvm.org/D107398
-
Jacob Hegna authored
-
Matthias Springer authored
* Visualize blocks and regions as subgraphs. * Generate DOT file directly instead of using `GraphTraits`. `GraphTraits` does not support subgraphs. Differential Revision: https://reviews.llvm.org/D106253
-
Christian Kandeler authored
This is needed for clients that want to highlight virtual functions differently. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D107145
-
Aart Bik authored
Also makes style consistent with the "surrounding" text that appears on one webpage in MLIR doc Reviewed By: grosul1 Differential Revision: https://reviews.llvm.org/D107418
-
Vitaly Buka authored
Similar to qsort, bsearch can be called from non-instrumented code of glibc. When it happends tls for arguments can be in uninitialized state. Unlike to qsort, bsearch does not move data, so we don't need to check or initialize searched memory or key. Intrumented comparator will do that on it's own. Differential Revision: https://reviews.llvm.org/D107387
-
Jessica Paquette authored
This allows us to handle the s88 G_SELECTS: https://godbolt.org/z/5s18M4erY Weird types like this can result in weird merges. Widening to s128 first and then clamping down avoids that situation. Differential Revision: https://reviews.llvm.org/D107415
-
Matthias Springer authored
Insertion point should be set before creating new operations. Differential Revision: https://reviews.llvm.org/D107326
-
wlei authored
This change tried to integrate a new count based aggregated type of perf script. The only difference of the format is that an aggregated count is added at the head of the original sample which means the same samples are repeated to the given count times. This is used to reduce the perf script size. e.g. ``` 2 4005dc 400634 400684 7f68c5788793 0x4005c8/0x4005dc/P/-/-/0 .... ``` Implemented by a dedicated PerfReader `AggregatedHybridPerfReader`. Differential Revision: https://reviews.llvm.org/D107192
-
Rob Suderman authored
We can propagate the shape from tosa.cond_if operands into the true/false regions then through the connected blocks. Then, using the tosa.yield ops we can determine what all possible return types are. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D105940
-
Dan Liew authored
On macOS the unit tests currently rely on libmalloc being used for allocations (due to no functioning interceptors) but also having the ASan/TSan allocator initialized in the same process. This leads to crashes with the macOS 12.0 libmalloc nano allocator so disable use of the allocator while running unit tests as a workaround. rdar://80086125 Differential Revision: https://reviews.llvm.org/D107412
-
Rob Suderman authored
Handles shape inference for identity, cast, and rescale. These were missed during the initialy elementwise work. This includes resize shape propagation which includes both attribute and input type based propagation. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D105845
-
Shimin Cui authored
Currently, in OptimizeGlobalAddressOfMalloc, the transformation for global loads assumes that they have the same Type. With the support of ConstantExpr (https://reviews.llvm.org/D106589), this may not be true any more (as seen in the test case), and we miss the code to handle this, This is to fix that. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D107397
-
Michael Kruse authored
-