- Mar 21, 2021
-
-
Chris Lattner authored
This updates the codebase to pass the context when creating an instance of OwningRewritePatternList, and starts removing extraneous MLIRContext parameters. There are many many more to be removed. Differential Revision: https://reviews.llvm.org/D99028
-
Nikita Popov authored
There seems to be an impedance mismatch between what the type system considers an aggregate (structs and arrays) and what constants consider an aggregate (structs, arrays and vectors). Adjust the type check to consider vectors as well. The previous version of the patch dropped the type check entirely, but it turns out that getAggregateElement() does require the constant to be an aggregate in some edge cases: For Poison/Undef the getNumElements() API is called, without checking in advance that we're dealing with an aggregate. Possibly the implementation should avoid doing that, but for now I'm adding an assert so the next person doesn't fall into this trap.
-
Nikita Popov authored
To make sure this doesn't crash the following commit.
-
Nikita Popov authored
-
Nikita Popov authored
This tests for binops with identity elements.
-
Nikita Popov authored
Replace Op with RepOp up-front, and then always work with the new operands, rather than checking for replacement in various places.
-
Matt Arsenault authored
We can just directly pass through the APInt to create a new constant.
-
Matt Arsenault authored
-
Simon Pilgrim authored
As commented by @craig.topper on rG1ba5c550d418, we can't guarantee that we'll be extending zero bits, just sign bit. So, revert to the old code for zero_extend_vector_inreg cases.
-
Jez Ng authored
Summary: A good chunk of it was mis-indented. Fixed by using the formatting settings from llvm/utils/vim.
-
Simon Pilgrim authored
The target shuffle code handles vector sources, but X86ISD::VBROADCAST can also accept a scalar source for splatting. Added as an extension to PR49658
-
Simon Pilgrim authored
-
David Green authored
This adds an extra pattern for inserting an f16 into a odd vector lane via an VINS. If the dual-insert-lane pattern does not happen to apply, this can help with some simple cases. Differential Revision: https://reviews.llvm.org/D95471
-
luxufan authored
The reason for generating mv a0, a0 instruction is when the stack object offset is large then int<12>. To deal this situation, in the elimintateFrameIndex function, it will create a virtual register, which needs the register scavenger to scavenge it. If the machine instruction that contains the stack object and the opcode is ADDI(the addi was generated by frameindexNode), and then this instruction's destination register was the same as the register that was generated by the register scavenger, then the mv a0, a0 was generated. So to eliminnate this instruction, in the eliminateFrameIndex function, if the instrution opcode is ADDI, then the virtual register can't be created. Differential Revision: https://reviews.llvm.org/D92479
-
Simon Pilgrim authored
The target shuffle code handles vector sources, but X86ISD::VBROADCAST can also accept a scalar source for splatting. Suggested by @craig.topper on PR49658
-
Simon Pilgrim authored
-
Simon Pilgrim authored
Reuse the existing KnownBits multiplication code to handle what is effectively a ISD::UMUL_LOHI varient
-
Fangrui Song authored
With this change, for `#include <ar.h>`, `clang --target=aarch64-linux-gnu` will read `/usr/lib/gcc/aarch64-linux-gnu/10/../../../../aarch64-linux-gnu/include/ar.h` (on Debian gcc->gcc-cross) instead of `/usr/include/ar.h`. Some glibc headers (e.g. gnu/stubs.h) are different across architectures.
-
Fangrui Song authored
-
Fangrui Song authored
Seem unnecessary to diverge from GCC here. Beside, lib/../$OSLibDir can be considered closer to the GCC installation then the system root. The comment should not apply.
-
Fangrui Song authored
Removing the hack actually improves our compatibility with gcc -mx32.
-
Fangrui Song authored
If clang is installed in the system, the other -L suffice; otherwise $ccc_install_dir/../lib below suffices.
-
Fangrui Song authored
After path resolution, it duplicates a subsequent -L entry. The entry below (lib/gcc/$triple/$version/../../../../$OSLibDir) usually does not exist (e.g. Arch Linux; Debian cross gcc). When it exists, it typically just has ld.so (e.g. Debian native gcc) which cannot cause collision. Removing the -L (similar to reordering it) is therefore justified.
-
Craig Topper authored
[RISCV] Add test case to show a case where (mul (and X, 0xffffffff), (and Y, 0xffffffff)) optimization does not improve code. If the mul add two users, one of which was a sext.w, the mul would also be selected to a MULW before our pattern runs. This causes the ANDs to now be used by the already selected MULW and the mul we still need to select. They are unneeded on the MULW since MULW only reads the lower bits. So they get selected to SLLI+SRLI for the MULW use. The use for the (mul (and X, 0xffffffff), (and Y, 0xffffffff)) manages to reuse the SLLI. The end result is increased register pressure and no improvement to how soon we can start the MULW.
-
Chris Lattner authored
This reapplies b5d9a3c9 / https://reviews.llvm.org/D98609 with a one line fix in processExistingConstants to skip() when erasing a constant we've already seen. Original commit message: 1) Change the canonicalizer to walk the function in top-down order instead of bottom-up order. This composes well with the "top down" nature of constant folding and simplification, reducing iterations and re-evaluation of ops in simple cases. 2) Explicitly enter existing constants into the OperationFolder table before canonicalizing. Previously we would "constant fold" them and rematerialize them, wastefully recreating a bunch fo constants, which lead to pointless memory traffic. Both changes together provide a 33% speedup for canonicalize on some mid-size CIRCT examples. One artifact of this change is that the constants generated in normal pattern application get inserted at the top of the function as the patterns are applied. Because of this, we get "inverted" constants more often, which is an aethetic change to the IR but does permute some testcases. Differential Revision: https://reviews.llvm.org/D99006
-
Andrew Litteken authored
Causing build errors on the Windows Buildbots. This reverts commit 5155dff2.
-
- Mar 20, 2021
-
-
Jessica Clarke authored
Missed in 07ed62b7.
-
Craig Topper authored
This optimization is trying to save SRLI instructions needed to implement the ANDs. If we have zext.w we won't save anything. Because we don't check that the multiply is the only user of the AND we might even increase instruction count.
-
Craig Topper authored
Some of the patterns end up with 32 to 64 bit zero extends on RV64 which can be handled by zext.w.
-
Fangrui Song authored
-
Craig Topper authored
This patterns computes the full 64 bit product of a 32x32 unsigned multiply. This requires a two pairs of SLLI+SRLI to zero the upper 32 bits of the inputs. We can do better than this by using two SLLI to move the lower bits to the upper bits then use MULHU to compute the product. This is the high half of a full 64x64 product. Since we put 32 0s in the lower bits of the inputs we know the 128-bit product will have zeros in the lower 64 bits. So the upper 64 bits, which MULHU computes, will contain the original 64 bit product we were after. The same trick would work for (mul (sext_inreg X, i32), (sext_inreg Y, i32)) using MULHS, but sext_inreg is sext.w which is already one instruction so we wouldn't save anything. Differential Revision: https://reviews.llvm.org/D99026
-
Andrew Litteken authored
This is a similarity visualization tool that accepts a Module and passes it to the IRSimilarityIdentifier. The resulting SimilarityGroups are output in a JSON file. Tests are found in test/tools/llvm-sim and check for the file not found, a bad module, and that the JSON is created correctly. Reviewers: paquette, jroelofs, MaskRay Recommit of: 15645d04 to fix linking errors. Differential Revision: https://reviews.llvm.org/D86974
-
Jinsong Ji authored
BUILD_SHARED_LIBS build llvm component as shared library, which can reduce the size a lot. Normally, the binary use ORIGIN../lib to load component libraries, unfortunatly, ORIGIN is not supported by AIX ld. We hardcoded the build lib and install lib path in rpath for now to enable BUILD_SHARED_LIBS build. Understand that this is not perfect solution, we can update this when we find better solution. Reviewed By: hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D98901
-
Fangrui Song authored
-
Sanjay Patel authored
This makes the settings available for use in other passes by housing them within the Support lib, but NFC otherwise. See D98898 for the proposed usage in SimplifyCFG (where this change was originally included). Differential Revision: https://reviews.llvm.org/D98945
-
Jez Ng authored
-
Stephen Kelly authored
Differential Revision: https://reviews.llvm.org/D98827
-
Fangrui Song authored
-
Fangrui Song authored
There were not properly checked before `[TableGen] Improve handling of template arguments`.
-
Fangrui Song authored
This reverts commit 243333ef.
-