- Jul 28, 2021
-
-
Adam Nemet authored
As an instruction is replaced in optimizeTransposes RAUW will replace it in the ShapeMap (ShapeMap is ValueMap so that uses are updated). In finalizeLowering however we skip updating uses if they are in the ShapeMap since they will be lowered separately at which point we pick up the lowered operands. In the testcase what happened was that since we replaced the doubled-transpose with the shuffle, it ended up in the ShapeMap. As we lowered the columnwise-load the use in the shuffle was not updated. Then as we removed the original columnwise-load we changed that to an undef. I.e. we ended up with: ``` %shuf = shufflevector <8 x double> undef, <8 x double> poison, <6 x i32> ^^^^^ <i32 0, i32 1, i32 2, i32 4, i32 5, i32 6> ``` Besides the fix itself, I have fortified this last bit. As we change uses to undef when removing instruction we track the undefed instruction to make sure we eventually remove those too. This would have caught the issue at compile time. Differential Revision: https://reviews.llvm.org/D106714 -
Alexey Zhikhartsev authored
The current JumpThreading pass does not jump thread loops since it can result in irreducible control flow that harms other optimizations. This prevents switch statements inside a loop from being optimized to use unconditional branches. This code pattern occurs in the core_state_transition function of Coremark. The state machine can be implemented manually with goto statements resulting in a large runtime improvement, and this transform makes the switch implementation match the goto version in performance. This patch specifically targets switch statements inside a loop that have the opportunity to be threaded. Once it identifies an opportunity, it creates new paths that branch directly to the correct code block. For example, the left CFG could be transformed to the right CFG: ``` sw.bb sw.bb / | \ / | \ case1 case2 case3 case1 case2 case3 \ | / / | \ latch.bb latch.2 latch.3 latch.1 br sw.bb / | \ sw.bb.2 sw.bb.3 sw.bb.1 br case2 br case3 br case1 ``` Co-author: Justin Kreiner @jkreiner Co-author: Ehsan Amiri @amehsan Reviewed By: SjoerdMeijer Differential Revision: https://reviews.llvm.org/D99205 -
Nico Weber authored
Matches ld64 (cf Options::findIndirectDylib()), and fixes PR51218. Differential Revision: https://reviews.llvm.org/D106842
-
Louis Dionne authored
Building the libraries with -fPIC ensures that we can link an executable against the static libraries with -fPIE. Furthermore, there is apparently basically no downside to building the libraries with position independent code, since modern toolchains are sufficiently clever. This commit enforces that we always build the runtime libraries with -fPIC. This is another take on D104327, which instead makes the decision of whether to build with -fPIC or not to the build script that drives the runtimes' build. Fixes http://llvm.org/PR43604. Differential Revision: https://reviews.llvm.org/D104328
-
Louis Dionne authored
Differential Revision: https://reviews.llvm.org/D106104
-
Craig Topper authored
A vector add may be faster than a vector shift. Reviewed By: frasercrmck Differential Revision: https://reviews.llvm.org/D106689
-
Melanie Blower authored
Change the ffp-model=precise to enables -ffp-contract=on (previously -ffp-model=precise enabled -ffp-contract=fast). This is a follow-up to Andy Kaylor's comments in the llvm-dev discussion "Floating Point semantic modes". From the same email thread, I put Andy's distillation of floating point options and floating point modes into UsersManual.rst Also fixes bugs.llvm.org/show_bug.cgi?id=50222 I had to revert this a few times because of failures on the x86-64 buildbot but I think we finally have that fixed by LNT/79f2b03c51. Reviewed By: rjmccall, andrew.kaylor Differential Revision: https://reviews.llvm.org/D74436
-
David Green authored
This expands the cost model test for min/max to many more types, including floating point minnum/maxnum and minimum/maximum, and FP16 with and without fullfp16. The old llc run lines are removed, as those are better tested by CodeGen tests.
-
Andy Kaylor authored
Patch by Mohammad Fawaz This patch allows lifetime calls to be ignored (and later erased) if we know that the copy-constant-to-alloca optimization is going to happen. The case that is missed is when the global variable is in a different address space than the alloca (as shown in the example added to the lit test.) This used to work before https://github.com/llvm/llvm-project/commit/6da31fa4a61d68af21dfa1e144e726ed6d77903e Differential Revision: https://reviews.llvm.org/D106573
-
David Sherwood authored
Consider the following loop: void foo(float *dst, float *src, int N) { for (int i = 0; i < N; i++) { dst[i] = 0.0; for (int j = 0; j < N; j++) { dst[i] += src[(i * N) + j]; } } } When we are not building with -Ofast we may attempt to vectorise the inner loop using ordered reductions instead. In addition we also try to select an appropriate interleave count for the inner loop. However, when choosing a VF=1 the inner loop will be scalar and there is existing code in selectInterleaveCount that limits the interleave count to 2 for reductions due to concerns about increasing the critical path. For ordered reductions this problem is even worse due to the additional data dependency, and so I've added code to simply disable interleaving for scalar ordered reductions for now. Test added here: Transforms/LoopVectorize/AArch64/strict-fadd-vf1.ll Differential Revision: https://reviews.llvm.org/D106646 -
Anna Thomas authored
Based on post commit review comments at 68ffed12.
-
Eugene Zhulenev authored
Reviewed By: bkramer Differential Revision: https://reviews.llvm.org/D106822
-
Matt Arsenault authored
I forgot to squash the test updates for b32d3d9e
-
- Jul 27, 2021
-
-
Stella Laurenzo authored
* Implements all of the discussed features: - Links against common CAPI libraries that are self contained. - Stops using the 'python/' directory at the root for everything, opening the namespace up for multiple projects to embed the MLIR python API. - Separates declaration of sources (py and C++) needed to build the extension from building, allowing external projects to build custom assemblies from core parts of the API. - Makes the core python API relocatable (i.e. it could be embedded as something like 'npcomp.ir', 'npcomp.dialects', etc). Still a bit more to do to make it truly isolated but the main structural reset is done. - When building statically, installed python packages are completely self contained, suitable for direct setup and upload to PyPi, et al. - Lets external projects assemble their own CAPI common runtime library that all extensions use. No more possibilities for TypeID issues. - Begins modularizing the API so that external projects that just include a piece pay only for what they use. * I also rolled in a re-organization of the native libraries that matches how I was packaging these out of tree and is a better layering (i.e. all libraries go into a nested _mlir_libs package). There is some further cleanup that I resisted since it would have required source changes that I'd rather do in a followup once everything stabilizes. * Note that I made a somewhat odd choice in choosing to recompile all extensions for each project they are included into (as opposed to compiling once and just linking). While not leveraged yet, this will let us set definitions controlling the namespacing of the extensions so that they can be made to not conflict across projects (with preprocessor definitions). * This will be a relatively substantial breaking change for downstreams. I will handle the npcomp migration and will coordinate with the circt folks before landing. We should stage this and make sure it isn't causing problems before landing. * Fixed a couple of absolute imports that were causing issues. Differential Revision: https://reviews.llvm.org/D106520
-
Aart Bik authored
The order of testing in two sparse tensor ops was incorrect, which could cause an invalid cast (crashing the compiler instead of reporting the error). This revision fixes that bug. Reviewed By: gussmith23 Differential Revision: https://reviews.llvm.org/D106841
-
Matt Arsenault authored
This is partially a workaround. SILowerI1Copies does not understand unstructured loops. This would result in inserting instructions to merge a mask register in the same block where it was defined in an unstructured loop.
-
Thomas Lively authored
Replace the clang builtins and LLVM intrinsics for the SIMD extmul instructions with normal codegen patterns. Differential Revision: https://reviews.llvm.org/D106724
-
Riccardo Mori authored
This is needed for having the functions isl_{set,map}_n_basic_{set,map} exported to the C++ interface. Some tests have been modified to reflect the isl changes. -
Anastasia Stulova authored
Redefines NULL as nullptr instead of ((void*)0) in C++ for OpenCL. Such internal representation of NULL provides compatibility with C++11 and later language standards. Patch by Topotuna (Justas Janickas)! Differential Revision: https://reviews.llvm.org/D105987
-
Hans Wennborg authored
> `#pragma clang include_instead(<header>)` is a pragma that can be used > by system headers (and only system headers) to indicate to a tool that > the file containing said pragma is an implementation-detail header and > should not be directly included by user code. > > The library alternative is very messy code that can be seen in the first > diff of D106124, and we'd rather avoid that with something more > universal. > > This patch takes the first step by warning a user when they include a > detail header in their code, and suggests alternative headers that the > user should include instead. Future work will involve adding a fixit to > automate the process, as well as cleaning up modules diagnostics to not > suggest said detail headers. Other tools, such as clangd can also take > advantage of this pragma to add the correct user headers. > > Differential Revision: https://reviews.llvm.org/D106394 This caused compiler crashes in Chromium builds involving PCH and an include directive with macro expansion, when Token::getLiteralData() returned null. See the code review for details. This reverts commit e8a64e54.
-
Anirudh Prasad authored
- This patch consists of the bare basic code needed in order to generate some assembly for the z/OS target. - Only the .text and the .bss sections are added for now. - The relevant MCSectionGOFF/Symbol interfaces have been added. This enables us to print out the GOFF machine code sections. - This patch enables us to add simple lit tests wherever possible, and contribute to the testing coverage for the z/OS target - Further improvements and additions will be made in future patches. Reviewed By: tmatheson Differential Revision: https://reviews.llvm.org/D106380
-
Anna Thomas authored
When hoisting/moving calls to locations, we strip unknown metadata. Such calls are usually marked `speculatable`, i.e. they are guaranteed to not cause undefined behaviour when run anywhere. So, we should strip attributes that can cause immediate undefined behaviour if those attributes are not valid in the context where the call is moved to. This patch introduces such an API and uses it in relevant passes. See updated tests. Fix for PR50744. Reviewed By: nikic, jdoerfert, lebedev.ri Differential Revision: https://reviews.llvm.org/D104641
-
Marek Kurdej authored
* https://wg21.link/P2166 Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D106801
-
David Spickett authored
This adds memory tag writing to Process and the GDB remote code. Supporting work for the "memory tag write" command. (to follow) Process WriteMemoryTags is similair to ReadMemoryTags. It will pack the tags then call DoWriteMemoryTags. That function will send the QMemTags packet to the gdb-remote. The QMemTags packet follows the GDB specification in: https://sourceware.org/gdb/current/onlinedocs/gdb/General-Query-Packets.html#General-Query-Packets Note that lldb-server will be treating partial writes as complete failures. So lldb doesn't need to handle the partial write case in any special way. Reviewed By: omjavaid Differential Revision: https://reviews.llvm.org/D105181
-
Jeremy Morse authored
Avoid several crashes when DBG_INSTR_REF and DBG_PHI instructions are fed to the instruction scheduler. DBG_INSTR_REFs should be treated like DBG_LABELs, and just ignored for the purpose of scheduling [0]. DBG_PHIs however behave much more like DBG_VALUEs: they refer to register operands, and if some register defs get shuffled around during instruction scheduling, there's a risk that the debug instr will refer to the wrong value. There's already a facility for updating DBG_VALUEs to reflect this; add DBG_PHI to the list of instructions that it will update. [0] Suboptimal, but it's what instr scheduling does right now. Differential Revision: https://reviews.llvm.org/D106663
-
Vassil Vassilev authored
We have the basic infrastructure in place. We can recover from simple errors (recovering from errors in template instantiations is not yet supported). It looks like we are in a reasonably functional state for llvm13. Differential revision: https://reviews.llvm.org/D106813
-
Louis Dionne authored
-
Tres Popp authored
-
Anna Thomas authored
The Exit instruction passed in for checking if it's an ordered reduction need not be an FPAdd operation. We need to bail out at that point instead of assuming it is an FPAdd (and hence has two operands). See added testcase. It crashes without the patch because the Exit instruction is a phi with exactly one operand. This latent bug was exposed by 95346ba8 which added support for multi-exit loops for vectorization. Reviewed-By: kmclaughlin Differential Revision: https://reviews.llvm.org/D106843
-
Chris Jackson authored
This reapplies commit 76f3ffb2 that was reverted due to buildbot failures. - Update lit tests with REQUIRES condition. - Abandon salvage attempt if SCEVUnknown::getValue() returns nullptr. Differential Revision: https://reviews.llvm.org/D105207
-
Kadir Cetinkaya authored
This reverts commit 04e21fbc.
-
Kadir Cetinkaya authored
Set driver mode before parsing arglist. Depends on D106789. Differential Revision: https://reviews.llvm.org/D106794
-
Kadir Cetinkaya authored
Also use it in other places that performed it on their own. Differential Revision: https://reviews.llvm.org/D106789
-
Jeremy Morse authored
When working out which instruction defines a value, the instruction-referencing variable location code has a few special cases for physical registers: * Arguments are never defined by instructions, * Constant physical registers always read the same value, are never def'd This patch adds a third case for the llvm.frameaddress intrinsics: you can read the framepointer in any block if you so choose, and use it as a variable location, as shown in the added test. This rather violates one of the assumptions behind instruction referencing, that LLVM-ir shouldn't be able to read from an arbitrary register at some arbitrary point in the program. The solution for now is to just emit a DBG_PHI that reads the register value: this works, but if we wanted to do something clever with DBG_PHIs in the future then this would probably get in the way. As it stands, this patch avoids a crash. Differential Revision: https://reviews.llvm.org/D106659
-
Chris Jackson authored
This reverts commit 76f3ffb2 because of a failure on sanitixer-X86-64-linux-autoconf.
-
Sam McCall authored
Useful in logs to understand issues around some platforms we don't have much experience with (e.g. m1, mingw) Differential Revision: https://reviews.llvm.org/D105681
-
Andrzej Warzynski authored
`-Mfixed` is not supported by the new driver and hence `flang`, the bash wrapper script, forwards it to the host compiler. The forwarded options are used by the host compiler when compiling the unparsed files. As the unparsed source files are always in the free form, forwarding `-Mfixed` is problematic. With this patch, `-Mfixed` (and `-Mfree` for consistency) will be ignored altogether. The user will only see a warning. This is not a particularly sound approach, but `flang` is only a temporary solution for us and this workaround is a fair compromise. Differential Revision: https://reviews.llvm.org/D106428
-