|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init |
|
| #
851447cb |
| 06-Jul-2022 |
Chenbing Zheng <[email protected]> |
[InstCombine] remove useless insertelement
extractelement (bitcast (insertelement (Vec, b)), a) -> extractelement (bitcast (Vec), a)
Reviewed By: RKSimon
Differential Revision: https://reviews.llv
[InstCombine] remove useless insertelement
extractelement (bitcast (insertelement (Vec, b)), a) -> extractelement (bitcast (Vec), a)
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D128890
show more ...
|
|
Revision tags: llvmorg-14.0.6 |
|
| #
129b531c |
| 19-Jun-2022 |
Kazu Hirata <[email protected]> |
[llvm] Use value_or instead of getValueOr (NFC)
|
|
Revision tags: llvmorg-14.0.5 |
|
| #
b8c2781f |
| 09-Jun-2022 |
Simon Moll <[email protected]> |
[NFC] format InstructionSimplify & lowerCaseFunctionNames
Clang-format InstructionSimplify and convert all "FunctionName"s to "functionName". This patch does touch a lot of files but gets done with
[NFC] format InstructionSimplify & lowerCaseFunctionNames
Clang-format InstructionSimplify and convert all "FunctionName"s to "functionName". This patch does touch a lot of files but gets done with the cleanup of InstructionSimplify in one commit.
This is the alternative to the less invasive clang-format only patch: D126783
Reviewed By: spatel, rengolin
Differential Revision: https://reviews.llvm.org/D126889
show more ...
|
|
Revision tags: llvmorg-14.0.4 |
|
| #
05527b68 |
| 24-May-2022 |
Sanjay Patel <[email protected]> |
[InstCombine] fold more shuffles with FP<->Int cast operands
shuffle (cast X), (cast Y), Mask --> cast (shuffle X, Y, Mask)
This extends the transform added with 0353c2c996c5.
If the shuffle reduc
[InstCombine] fold more shuffles with FP<->Int cast operands
shuffle (cast X), (cast Y), Mask --> cast (shuffle X, Y, Mask)
This extends the transform added with 0353c2c996c5.
If the shuffle reduces vector length, the transform reduces the width of the cast, so that should be a win for most codegen (if not, it can be inverted).
show more ...
|
| #
dbf3b5f1 |
| 17-May-2022 |
Sanjay Patel <[email protected]> |
[InstCombine] fold more shuffles with FP<->Int cast operands
shuffle (cast X), (cast Y), Mask --> cast (shuffle X, Y, Mask)
This extends the transform added with 0353c2c996c5.
If the casts are to
[InstCombine] fold more shuffles with FP<->Int cast operands
shuffle (cast X), (cast Y), Mask --> cast (shuffle X, Y, Mask)
This extends the transform added with 0353c2c996c5.
If the casts are to a larger element type, the transform reduces shuffle bit width, so that should be a win for most codegen (if not, it can be inverted).
show more ...
|
| #
0353c2c9 |
| 10-May-2022 |
Sanjay Patel <[email protected]> |
[InstCombine] fold shuffles with FP<->Int cast operands
shuffle (cast X), (cast Y), Mask --> cast (shuffle X, Y, Mask)
This is similar to a recent transform with fneg ( b331a7ebc1e0 ), but this is
[InstCombine] fold shuffles with FP<->Int cast operands
shuffle (cast X), (cast Y), Mask --> cast (shuffle X, Y, Mask)
This is similar to a recent transform with fneg ( b331a7ebc1e0 ), but this is intentionally the most conservative first step to try to avoid regressions in codegen. There are several restrictions that could be removed as follow-up enhancements.
Note that a cast with a unary shuffle is currently canonicalized in the other direction (shuffle after cast - D103038 ). We might want to invert that to be consistent with this patch.
show more ...
|
| #
b331a7eb |
| 06-May-2022 |
Sanjay Patel <[email protected]> |
[InstCombine] canonicalize fneg after shuffle
For the unary shuffle pattern, this is opposite to what we try to do with binops, but it seems better to keep it consistent with the motivating binary s
[InstCombine] canonicalize fneg after shuffle
For the unary shuffle pattern, this is opposite to what we try to do with binops, but it seems better to keep it consistent with the motivating binary shuffle pattern. On that, it is clearly better on the usual no-extra uses case.
There is a chance that this will pull an fneg away from some other binop and cause a regression in codegen, but that should be invertible in the backend. The transform is birectional: https://alive2.llvm.org/ce/z/kKaKCU https://alive2.llvm.org/ce/z/3Desfw
Fixes #45631
show more ...
|
|
Revision tags: llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1 |
|
| #
5dbb53b1 |
| 24-Mar-2022 |
Sanjay Patel <[email protected]> |
[InstCombine] merge shuffled vector negate and multiply
Add the "(0 - X) --> (X * -1)" reverse identity to the list of alternate form binops.
We need a little hack to make the existing logic work b
[InstCombine] merge shuffled vector negate and multiply
Add the "(0 - X) --> (X * -1)" reverse identity to the list of alternate form binops.
We need a little hack to make the existing logic work because it does not expect to move constants from op0 to op1, but the code comment hopefully makes that clear. I don't think there are any other identities like that.
Fixes #54364
Differential Revision: https://reviews.llvm.org/D122390
show more ...
|
| #
ccf8c969 |
| 22-Mar-2022 |
Sanjay Patel <[email protected]> |
[InstCombine] reorder code, fix formatting; NFC
The affected code can be updated to solve #54364, so make some cosmetic diffs before real changes.
|
|
Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3 |
|
| #
59630917 |
| 02-Mar-2022 |
serge-sans-paille <[email protected]> |
Cleanup includes: Transform/Scalar
Estimated impact on preprocessor output line: before: 1062981579 after: 1062494547
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cl
Cleanup includes: Transform/Scalar
Estimated impact on preprocessor output line: before: 1062981579 after: 1062494547
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D120817
show more ...
|
|
Revision tags: llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2 |
|
| #
e6f31f4e |
| 28-Dec-2021 |
Nikita Popov <[email protected]> |
[InstCombine] Use GEP type instead of pointee type
The GEP source type is independent of whether it is a scalar or vector GEP, as such we can simply preserve it.
|
| #
3db974fa |
| 13-Dec-2021 |
Sanjay Patel <[email protected]> |
[InstCombine] convert static function to internal class function; NFC
The transform can require an optional shuffle instruction to be sound, so we need to use Builder to create all values and then r
[InstCombine] convert static function to internal class function; NFC
The transform can require an optional shuffle instruction to be sound, so we need to use Builder to create all values and then replace the original instruction with whatever that final value is.
show more ...
|
| #
e6ad9ef4 |
| 14-Dec-2021 |
Philip Reames <[email protected]> |
[instcombine] Canonicalize constant index type to i64 for extractelement/insertelement
The basic idea to this is that a) having a single canonical type makes CSE easier, and b) many of our transform
[instcombine] Canonicalize constant index type to i64 for extractelement/insertelement
The basic idea to this is that a) having a single canonical type makes CSE easier, and b) many of our transforms are inconsistent about which types we end up with based on visit order.
I'm restricting this to constants as for non-constants, we'd have to decide whether the simplicity was worth extra instructions. For constants, there are no extra instructions.
We chose the canonical type as i64 arbitrarily. We might consider changing this to something else in the future if we have cause.
Differential Revision: https://reviews.llvm.org/D115387
show more ...
|
| #
98f5ab6a |
| 09-Dec-2021 |
Philip Reames <[email protected]> |
[instcombine] Do demanded elts last when visiting extractelement
This reorders existing transforms to put demanded elements last. The reasoning here is that when we have an example which can be scal
[instcombine] Do demanded elts last when visiting extractelement
This reorders existing transforms to put demanded elements last. The reasoning here is that when we have an example which can be scalarized or handled via demanded bits, we should prefer scalarization as that doesn't require dropping flags on arithmetic instructions.
This doesn't show major changes in the tests today, but once I add support for fast math flags to dropPoisonGeneratingFlags this becomes glaringly obvious.
Differential Revision: https://reviews.llvm.org/D115394
show more ...
|
| #
56fa3343 |
| 08-Dec-2021 |
Philip Reames <[email protected]> |
[instcombine] A couple style tweaks to visitExtractElementInst [nfc]
|
|
Revision tags: llvmorg-13.0.1-rc1 |
|
| #
03961709 |
| 22-Oct-2021 |
Piotr Sobczak <[email protected]> |
[InstCombine] Extend pattern to replace shuffle's insertelement operand
In D71220 a pattern was added to replace shuffle's insertelement operand if inserted scalar is not demanded. The pattern was a
[InstCombine] Extend pattern to replace shuffle's insertelement operand
In D71220 a pattern was added to replace shuffle's insertelement operand if inserted scalar is not demanded. The pattern was added only for the case where the shuffle's mask size is equal to element's vector size. However, that condition is not required because the pattern does not change the shuffle vector size.
This patch extends the pattern to also include cases where shuffle's mask size is not equal to element's vector size.
Differential Revision: https://reviews.llvm.org/D112318
show more ...
|
| #
2a3cc4d4 |
| 18-Oct-2021 |
Sanjay Patel <[email protected]> |
[Analysis] add utility function for unary shuffle mask creation
This is NFC-intended for the callers. Posting in case there are other potential users that I missed. I would also use this from Vector
[Analysis] add utility function for unary shuffle mask creation
This is NFC-intended for the callers. Posting in case there are other potential users that I missed. I would also use this from VectorCombine in a patch for: https://llvm.org/PR52178 ( D111901 )
Differential Revision: https://reviews.llvm.org/D111891
show more ...
|
| #
d95ebef4 |
| 07-Oct-2021 |
Sanjay Patel <[email protected]> |
[InstCombine] ease use check for fold of bitcasted extractelt to trunc
This helps with examples like: https://llvm.org/PR52057 ...but we need at least one more fold to fix that case.
|
| #
db231ebd |
| 06-Oct-2021 |
Sanjay Patel <[email protected]> |
[InstCombine] fold fake vector extract to shift+trunc
We already handle more complicated cases like: extelt (bitcast (inselt poison, X, 0)) --> trunc (lshr X)
But we missed this simpler pattern: ht
[InstCombine] fold fake vector extract to shift+trunc
We already handle more complicated cases like: extelt (bitcast (inselt poison, X, 0)) --> trunc (lshr X)
But we missed this simpler pattern: https://alive2.llvm.org/ce/z/D55h64 / https://alive2.llvm.org/ce/z/GKzzRq
This is part of solving: https://llvm.org/PR52057
I made the transform depend on legal/desirable int type to avoid creating a shift of an illegal type (for example i128). I'm not sure if that restriction is actually necessary, but we can change that as a follow-up if the backend can deal with integer ops on too-wide illegal types.
The pile of AVX512 test changes are all neutral AFAICT - the x86 backend seems to know how to turn that into the expected "kmov" instructions.
Differential Revision: https://reviews.llvm.org/D111082
show more ...
|
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4 |
|
| #
10a56325 |
| 23-Sep-2021 |
hyeongyu kim <[email protected]> |
[NFC][InstCombine] Fix inconsistent comments
|
| #
98e96663 |
| 22-Sep-2021 |
hyeongyu kim <[email protected]> |
[InstCombine] Update InstCombine to use poison instead of undef for shufflevector's placeholder (3/3)
This patch is for fixing potential shufflevector-related bugs like D93818. As D93818, this patch
[InstCombine] Update InstCombine to use poison instead of undef for shufflevector's placeholder (3/3)
This patch is for fixing potential shufflevector-related bugs like D93818. As D93818, this patch change shufflevector's default placeholder to poison. To reduce risk, it was divided into several patches, and this patch is for InstCombineVectorOps.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D110230
show more ...
|
| #
e08a5dc8 |
| 22-Sep-2021 |
Florian Hahn <[email protected]> |
[InstCombine] Move InstCombineWorklist to Utils to allow reuse (NFC).
InstCombine's worklist can be re-used by other passes like VectorCombine. Move it to llvm/Transform/Utils and rename it to Instr
[InstCombine] Move InstCombineWorklist to Utils to allow reuse (NFC).
InstCombine's worklist can be re-used by other passes like VectorCombine. Move it to llvm/Transform/Utils and rename it to InstructionWorklist.
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D110181
show more ...
|
| #
fc8f1e44 |
| 21-Sep-2021 |
Simon Pilgrim <[email protected]> |
[InstCombine] foldConstantInsEltIntoShuffle - bail if we fail to find constant element (PR51824)
If getAggregateElement() returns null for any element, early out as otherwise we will assert when cre
[InstCombine] foldConstantInsEltIntoShuffle - bail if we fail to find constant element (PR51824)
If getAggregateElement() returns null for any element, early out as otherwise we will assert when creating a new constant vector
Fixes PR51824 + ; OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38057
show more ...
|
| #
e5a32d72 |
| 15-Sep-2021 |
Sanjay Patel <[email protected]> |
[InstCombine] move extend after insertelement if both operands are extended
I was wondering how instcombine does on the examples in D109236, and we're missing a basic transform:
inselt (ext X), (ex
[InstCombine] move extend after insertelement if both operands are extended
I was wondering how instcombine does on the examples in D109236, and we're missing a basic transform:
inselt (ext X), (ext Y), Index --> ext (inselt X, Y, Index)
https://alive2.llvm.org/ce/z/z2aBu9
Note that there are several possible extensions of this fold (see TODO comments).
Differential Revision: https://reviews.llvm.org/D109537
show more ...
|
|
Revision tags: llvmorg-13.0.0-rc3 |
|
| #
735f4671 |
| 09-Sep-2021 |
Chris Lattner <[email protected]> |
[APInt] Normalize naming on keep constructors / predicate methods.
This renames the primary methods for creating a zero value to `getZero` instead of `getNullValue` and renames predicates like `isAl
[APInt] Normalize naming on keep constructors / predicate methods.
This renames the primary methods for creating a zero value to `getZero` instead of `getNullValue` and renames predicates like `isAllOnesValue` to simply `isAllOnes`. This achieves two things:
1) This starts standardizing predicates across the LLVM codebase, following (in this case) ConstantInt. The word "Value" doesn't convey anything of merit, and is missing in some of the other things.
2) Calling an integer "null" doesn't make any sense. The original sin here is mine and I've regretted it for years. This moves us to calling it "zero" instead, which is correct!
APInt is widely used and I don't think anyone is keen to take massive source breakage on anything so core, at least not all in one go. As such, this doesn't actually delete any entrypoints, it "soft deprecates" them with a comment.
Included in this patch are changes to a bunch of the codebase, but there are more. We should normalize SelectionDAG and other APIs as well, which would make the API change more mechanical.
Differential Revision: https://reviews.llvm.org/D109483
show more ...
|