- May 24, 2022
-
-
Lian Wang authored
Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D126276
-
Fraser Cormack authored
This patch fixes another bug in the RVV frame lowering. While some frame objects with non-default stack IDs (such scalable-vector alloca instructions) are considered in the target-independent max alignment calculations, others (for example, during calling-convention lowering) are not. This means we'd occasionally align the base of the stack to only 16 bytes, with no way to ensure that the RVV section contained within that is aligned to anything higher. Reviewed By: StephenFan Differential Revision: https://reviews.llvm.org/D125973
-
Fraser Cormack authored
This patch addresses several alignment issues in the stack frame when RVV objects are taken into account. One bug is that the RVV stack was never guaranteed to keep the alignment of the stack *as a whole*. We must maintain a 16-byte aligned stack at all times, especially when calling other functions. With the standard V extension, this is conveniently happening since VLEN is at least 128 and always 16-byte aligned. However, we support Zvl64b which does not guarantee this. To fix this, the RVV stack size is rounded up to be aligned to 16 bytes. This in practice generally makes us allocate a stack sized at least 2*VLEN in size, and a multiple of 2. |------------------------------| -- <-- FP | 8-byte callee-save | | | |------------------------------| | | | one VLENB-sized RVV object | | | |------------------------------| | | | 8-byte local variable | | | |------------------------------| -- <-- SP (must be aligned to 16) In the example above, with Zvl64b we are decrementing SP by 12 bytes which does not leave SP correctly aligned. We therefore introduce an extra VLENB-sized amount used for alignment. This would therefore ensure the total stack size was 16 bytes (48 for Zvl128b, 80 for Zvl256b, etc): |------------------------------| -- <-- FP | 8-byte callee-save | | | |------------------------------| | | | one VLENB-sized padding obj | | | | one VLENB-sized RVV object | | | |------------------------------| | | | 8-byte local variable | | | |------------------------------| -- <-- SP A new RVV invariant has been introduced in this patch, which is that the base of the RVV stack itself is now always aligned to 16 bytes, not 8 as before. This keeps us more in line with the scalar stack and should be easier to reason about. The calculation of the RVV padding has thus changed to be the amount required to align the scalar local variable section to the RVV section's alignment. This amount is further rounded up when setting up the initial stack to keep everything aligned: |------------------------------| -- <-- FP | 8-byte callee-save | |------------------------------| | | | RVV objects | | (aligned to at least 16) | | | |------------------------------| | RVV padding of 8 bytes | |------------------------------| | 8-byte local variable | |------------------------------| -- <-- SP In the example above, it's clear that we need 8 bytes of padding to keep the RVV section aligned to 16 when using SP. But to keep SP *itself* aligned to 16 we can't decrement the initial stack pointer by 24 - we have to round up to 32. With the RVV section correctly aligned, the second bug fixed by this patch is that RVV objects themselves are now correctly aligned. We were previously only guaranteeing an alignment of 8 bytes, even if they required a higher alignment. This is relatively simple and in practice we see more rounding up of VLEN amounts to account for alignment in between objects: |------------------------------| | RVV object (aligned to 16) | |------------------------------| | no padding necessary | |------------------------------| | 2*VLENB RVV object (align 16)| |------------------------------| | VLENB alignment padding | |------------------------------| | RVV object (align 32) | |------------------------------| | 3*VLENB alignment padding | |------------------------------| | VLENB RVV object (align 32) | |------------------------------| -- <-- base of RVV section Note that a lot of the regressions in codegen owing to the new alignment rules are correct but actually only strictly necessary for Zvl64b (and Zvl32b but that's not really supported). I plan a follow-up patch to take the known VLEN into account when padding for alignment. Reviewed By: StephenFan Differential Revision: https://reviews.llvm.org/D125787 -
LLVM GN Syncbot authored
-
Luo, Yuanke authored
The previous solution depends on variable name to record the shape information. However it is not reliable, because in release build compiler would not set the variable name. It can be accomplished with an additional option `fno-discard-value-names`, but it is not acceptable for users. This patch is to preconfigure the tile register with machine instruction. It follow the same way what sigle configure does. In the future we can fall back to multiple configure when single configure fails due to the shape dependency issue. The algorithm to configure the tile register is simple in the patch. We may improve it in the future. It configure tile register based on basic block. Compiler would spill the tile register if it live out the basic block. After the configure there should be no spill across tile confgiure in the register alloction. Just like fast register allocation the algorithm walk the instruction in reverse order. When the shape dependency doesn't meet, it insert ldtilecfg after the last instruction that define the shape. In post configuration compiler also walk the basic block to collect the physical tile register number and generate instruction to fill the stack slot for the correponding shape information. TODO: There is some following work in D125602. The risk is modifying the fast RA may cause regression as fast RA is usded for different targets. We may create an independent RA for tile register. Differential Revision: https://reviews.llvm.org/D125075
-
Chen Zheng authored
MachineCycle can handle irreducible loop. Natural loop analysis (MachineLoop) can not return correct loop depth if the loop is irreducible loop. And MachineSink is sensitive to the loop depth, see MachineSinking::isProfitableToSinkTo(). This patch tries to use MachineCycle so that we can handle irreducible loop better. Reviewed By: sameerds, MatzeB Differential Revision: https://reviews.llvm.org/D123995
-
Shraiysh Vaishay authored
This patch adds basic support for `omp task` to the OpenMPIRBuilder. The outlined function after code extraction is called from a wrapper function with appropriate arguments. This wrapper function is passed to the runtime calls for task allocation. This approach is different from the Clang approach - clang directly emits the runtime call to the outlined function. The outlining utility (OutlineInfo) simply outlines the code and generates a function call to the outlined function. After the function has been generated by the outlining utility, there is no easy way to alter the function arguments without meddling with the outlining itself. Hence the wrapper function approach is taken. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D71989
-
Peter Klausler authored
Forward references to ENTRY names to pass them as actual procedure arguments don't work in all cases, exposing some basic ordering problems in name resolution for these symbols. Refactor; create all the necessary procedure symbols, and either function result or host association symbols (for subroutines), at the time that the subprogrma scope is created, so that the names exist in the scope as text "before" the ENTRY is processed in name resolution. Some processing remains in PostEntryStmt() so that we can check that an ENTRY with an explicit distinct RESULT doesn't also have declarations for the ENTRY name. Differential Revision: https://reviews.llvm.org/D126142
-
Sotiris Apostolakis authored
This reverts commit a111fb96.
-
Sotiris Apostolakis authored
This patch optimizes the transformation of selects to a branch when the heuristics deemed it profitable. It aggressively sinks eligible instructions to the newly created true/false blocks to prevent their execution on the common path and interleaves dependence slices to maximize ILP. Depends on D120232 Reviewed By: davidxl Differential Revision: https://reviews.llvm.org/D120233
-
Brad Smith authored
The test specifies a CPU arch but not a particular OS. So if run on OpenBSD it acts as if it's an OpenBSD/hexagon system. OpenBSD uses __guard_local instead of __stack_chk_guard so the test will fail. So specify an OS other than OpenBSD fixes the test. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D126265
-
Hyoun Kyu Cho authored
Exposes interface to free up caching data structure in DWARFDebugLine and DWARFUnit for memory management This is minimum changes extracted from https://reviews.llvm.org/D78950. The old patch tried to add LRU eviction of caching data structure. Due to multiple layers of interfaces that users could be using, it was not clear where to put the functionality. While we work out on where to put that functionality, it'll be great to add this minimum interface change so that the user could implement their own memory management. More specifically: * Add a clearLineTable method for DWARFDebugLine which erases the given offset from the LineTableMap. * DWARFDebugContext adds the clearLineTableForUnit method that leverages clearLineTable to remove the object corresponding to a given compile unit, for memory management purposes. When it is referred to again, the line table object will be repopulated. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D90006
-
usama hameed authored
-
usama hameed authored
Added a separate check for unevaluated statements. Updated InfiniteLoopCheck to use new check Differential Revision: https://reviews.llvm.org/D126246
-
usama hameed authored
Differential Revision: https://reviews.llvm.org/D126034
-
Wolfgang Pieb authored
This is a preparatory patch for the MDNode resize functionality. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D125994
-
Sotiris Apostolakis authored
This patch adds the loop-level heuristics for determining whether branches are more profitable than conditional moves. These heuristics apply to only inner-most loops. Depends on D120231 Reviewed By: davidxl Differential Revision: https://reviews.llvm.org/D120232
-
Sotiris Apostolakis authored
This patch adds the base heuristics for determining whether branches are more profitable than conditional moves. Base heuristics apply to all code apart from inner-most loops. Depends on D122259 Reviewed By: davidxl Differential Revision: https://reviews.llvm.org/D120231
-
Vy Nguyen authored
- fixed inconsistent indents and spaces - prevent extraneous formatting changes in other patches Differential Revision: https://reviews.llvm.org/D126262
-
Peter Klausler authored
The binding names of inner procedures with BIND(C) are not exposed to the loader and should be ignored for potential conflict errors. Differential Revision: https://reviews.llvm.org/D126141
-
Peter Klausler authored
Intrinsic module names are not in the user's namespace, so they are free to declare global names that conflict with intrinsic modules. Differential Revision: https://reviews.llvm.org/D126140
-
Xeonacid authored
Make old JIT ExecutionEngine tests unsupported for RISCV, like many other architectures included. Reviewed By: reames Differential Revision: https://reviews.llvm.org/D126188
-
Peter Klausler authored
The character length value in the derived type component information table entry is already in units of characters, not bytes, so don't divide by the per-character byte size. Differential Revision: https://reviews.llvm.org/D126139
-
Sam Clegg authored
It turns out we were already allocating static address space for TLS data along with the non-TLS static data, but this space was going unused/ignored. With this change, we include the TLS segment in `__wasm_init_memory` (which does the work of loading the passive segments into memory when a module is first loaded). We also set the `__tls_base` global to point to the start of this segment. This means that the runtime can use this static copy of the TLS data for the first/primary thread if it chooses, rather than doing a runtime allocation prior to calling `__wasm_init_tls`. Practically speaking, this will allow emscripten to avoid dynamic allocation of TLS region on the main thread. Differential Revision: https://reviews.llvm.org/D126107
-
Hendrik Greving authored
Fixes a bug preventing moving the loop's metadata to an outer loop's header, which happens if the loop's exit is also the header of an outer loop. Adjusts test for above. Fixes #55416. Differential Revision: https://reviews.llvm.org/D125574
-
Hendrik Greving authored
Adds a test to expose #55416. Differential Revision: https://reviews.llvm.org/D125696
-
Mehdi Amini authored
-
Mehdi Amini authored
-
Mehdi Amini authored
-
Vitaly Buka authored
-
Jamie Schmeiser authored
A new hidden option -print-on-crash that prints the IR as it was upon entering the last pass when there is a crash. The IR is saved in its print form before each pass is started and a signal handler is registered. If the compilation crashes, the signal handler will print the saved IR to dbgs(). This option can be modified using -print-module-scope to get the IR for the complete module. Note that this option only works with the new pass manager. Reviewed By: yrouban Differential Revision: https://reviews.llvm.org/D86657
-
Tom Stellard authored
As discussed in https://discourse.llvm.org/t/creating-a-new-repository-for-release-branch-pull-requests/61339 Reviewed By: asl Differential Revision: https://reviews.llvm.org/D125851
-
Alex Brachet authored
utils looks different from the other directory names in the docs, see https://libc.llvm.org/source_layout.html#the-utils-directory Differential revision: https://reviews.llvm.org/D126211
-
NAKAMURA Takumi authored
Fixup for https://reviews.llvm.org/D73044 String literal has an implicit terminator '\0'. This commit adjusts char array to long literal. This causes difference of artifacts between -long-string-literals=true and false. Differential Revision: https://reviews.llvm.org/D126136
-
Jeffrey Tan authored
Previous patch (https://reviews.llvm.org/D126013) added a new "optimized" attribute to DAP stack frame this caused some tests, like lldb-vscode/coreFile/TestVSCode_coreFile.py to fail because the tests explicitly check for all attributes. To fix the test failure I decided to remove this attribute. Differential Revision: https://reviews.llvm.org/D126225
-
NAKAMURA Takumi authored
Differential Revision: https://reviews.llvm.org/D126135
-
Mitch Phillips authored
Currently, llvm-symbolizer doesn't like to parse .debug_info in order to show the line info for global variables. addr2line does this. In the future, I'm looking to migrate AddressSanitizer off of internal metadata over to using debuginfo, and this is predicated on being able to get the line info for global variables. This patch adds the requisite support for getting the line info from the .debug_info section for symbolizing global variables. This only happens when you ask for a global variable to be symbolized as data. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D123538
-
Sotiris Apostolakis authored
This patch implements the actual transformation of selects to branches. It includes only the base transformation without any sinking. Depends on D120230 Reviewed By: davidxl Differential Revision: https://reviews.llvm.org/D122259
-
Qunyan Mangus authored
RAGreedy has two fields of RegisterClassInfo, one called RCI and another RegClassInfo from its base class. RCI is initialized without freezeReservedRegs first, while RegClassInfo does. Therefore, if reserved registers information is changed between last time freezeReservedRegs is called and RAGreedy, it's not picked up by RCI. Instead of having both fields in RAGreedy, remove RCI and use RegClassInfo instead. Also removed is the TRI field which is present in its base class. Reviewed By: MatzeB Differential Revision: https://reviews.llvm.org/D125926
-
Paul Robinson authored
The new test is a copy of the corresponding PS4 test, with the triple etc updated, because there's currently no good way to make one lit test "iterate" with multiple targets.
-