- Oct 02, 2021
-
-
Philip Reames authored
This fixes a violation of the wrap flag rules introduced in c4048d8f. This was also noted in the (very old) PR23527. The issue being fixed is that we assume the inbound flag on any GEP assumes that all users of *any* gep (or add) which happens to map to that SCEV would also be UB if the (other) gep overflowed. That's simply not true. In terms of the test diffs, I don't see anything seriously problematic. The lost flags are expected (given the semantic restriction on when its legal to tag the SCEV), and there are several cases where the previously inferred flags are unsound per the new semantics. The only common trend I noticed when looking at the deltas is that by not considering branch on poison as immediate UB in ValueTracking, we do miss a few cases we could reclaim. We may be able to claw some of these back with the follow ideas mentioned in PR51817. It's worth noting that most of the changes are analysis result only changes. The two transform changes are pretty minimal. In one case, we miss the opportunity to infer a nuw (correctly). In the other, we fail to fold an exit and produce a loop invariant form instead. This one is probably over-reduced as the program appears to be undefined in practice, and neither before or after exploits that. Differential Revision: https://reviews.llvm.org/D109789
-
Philip Reames authored
This code is attempting to prove that I must execute if we enter the defining scope of the SCEV which will be created from I. In the case where it found a defining addrec scope, it had a rather odd restriction that all of the other operands must be loop invariant in that addrec's loop. As near as I can tell here, we really only need a upper bound on the defining scope. If we can prove the stronger property, then we must also have proven the property on the exact defining scope as well. In practice, the actual effect of this change is narrow. The compile time restriction at the top of the routine basically limits us to I being an arithmetic in some loop L with both an addrec operand in L, and a unknown operands in L. Possible to demonstrate, but the main value of the change is removing unneeded code. Differential Revision: https://reviews.llvm.org/D110892
-
Philip Reames authored
-
Jessica Paquette authored
This is a common pattern: ``` %icmp:_(s32) = G_ICMP intpred(eq), ... %ext:_(s64) = G_ANYEXT %icmp(s32) %and:_(s64) = G_AND %ext, 1 ``` Here's an example: https://godbolt.org/z/T13f6o8zE This pattern appears because of the following combine in the LegalizationArtifactCombiner: ``` // zext(trunc x) - > and (aext/copy/trunc x), mask ``` Which kicks in when we widen the result of G_ICMP from 1 bit to 32 bits. We know that, on AArch64, a scalar G_ICMP will produce 0 or 1. So the result of `%ext` will always be 0 or 1 as well. We have some KnownBits combines which eliminate redundant G_ANDs with masks. These combines don't kick in with G_ANYEXT. So, if we replace the G_ANYEXT with G_ZEXT in this situation, the KnownBits based combines can remove the redundant G_AND. I wasn't sure if it woud be more appropriate to * Take this route * Put this in the LegalizationArtifactCombiner. * Allow 64 bit G_ICMP destinations I decided on this route because 1) It's simple 2) I'm not sure if philosophically-speaking, we should be handling non-artifact instructions + target-specific details like TargetBooleanContents in the LegalizationArtifactCombiner 3) There is a lot of existing code which assumes we only have 32 bit G_ICMP destinations. So, adding support for 64-bit destinations seems rather invasive right now. I think that adding support for 64-bit destinations, or modelling G_ICMP as ADDS/SUBS/etc is probably cleaner long term though. This gives minor code size savings on all CTMark benchmarks. Differential Revision: https://reviews.llvm.org/D110959 -
Stefan Pintilie authored
Added a test case for situations where a struct of size 1-7 bytes is passed by value.
-
Daniil Suchkov authored
This reverts commit 86046516. This assertion fails on https://lab.llvm.org/buildbot/#/builders/98/builds/6690 Reverting it for now.
-
Zequan Wu authored
[Profile] Add a warning when lock file failed in __llvm_profile_set_file_object with continuous mode
-
Daniil Suchkov authored
This assertion should help us catch cases when DT is used in a way that doesn't make much sense and usually indicates usage errors. In D110752 you can see a test on which this assertion catches a miscompile. The assertion is added to getNode since all queries seem to be routed through that function for all non-trivial cases. Reviewed By: aeubanks, MaskRay Differential Revision: https://reviews.llvm.org/D110751
-
Daniil Suchkov authored
Added an additional check for constants after simplification of "select _, true, false" pattern. We need to prevent attempts to unswitch constant conditions for two reasons: a) Doing that doesn't make any sense, in the best case it will just burn some compile time. b) SimpleLoopUnswitch isn't designed to unswitch constant conditions (due to (a)), so attempting that can cause miscompiles. The attached testcase is an example of such miscompile. Also added an assertion that'll make sure we aren't trying to replace constants, so it will help us prevent such bugs in future. The assertion from D110751 is another layer of protection against such cases. Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D110752
-
Daniil Suchkov authored
The miscompile was introduced by 6b4b1dc6.
-
wren romano authored
This is preliminary work towards D110790. Depends On D110883. Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D110884
-
wren romano authored
This is preliminary work towards D110790. Depends On D110882. Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D110883
-
wren romano authored
This is preliminary work towards D110790 Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D110882
-
Nikita Popov authored
When taking into account the fact that GEP indices are truncated to 32-bits in this test, the "path dependence" goes away, so inferring MustAlias for all pointers would be correct. As this goes against the spirit of the test, change it to extend from i16 instead.
-
Nikita Popov authored
These show that the known bits and non-zero heuristics are incorrect when truncation is involved.
-
Daniel Resnick authored
Exposes mlir::TypeID to the C API as MlirTypeID along with various accessors and helper functions. Differential Revision: https://reviews.llvm.org/D110897
-
LLVM GN Syncbot authored
-
Tomasz Miąsko authored
Rust allows use of non-ASCII identifiers, which in Rust mangling scheme are encoded using Punycode. The encoding deviates from the standard by using an underscore as the separator between ASCII part and a base-36 encoding of non-ASCII characters (avoiding hypen-minus in the symbol name). Other than that, the encoding follows the standard, and the decoder implemented here in turn follows the one given in RFC 3492. To avoid an extra intermediate memory allocation while decoding Punycode, the interface of OutputStream is extended with an insert method. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D104366
-
Simon Pilgrim authored
One of the cases identified in PR45116 - we don't need to limit extracted loads to ABI alignment, we can use allowsMemoryAccess - which tests using getABITypeAlign, but also checks if a target permits (fast) misaligned memory loads by checking allowsMisalignedMemoryAccesses as a fallback. I've also cleaned up the alignment calculation code - if we have a constant extraction index then the alignment can be based on an offset from the original vector load alignment, but for non-constant indices we should assume the worst (single element alignment only). Differential Revision: https://reviews.llvm.org/D110486
-
Jay Foad authored
In collectTiedOperands, when handling an undef use that is tied to a def, constrain the dst reg with the actual register class of the src reg, instead of with the register class from the instructions's MCInstrDesc. This makes a difference in some AMDGPU test cases like this, before: %16:sgpr_96 = INSERT_SUBREG undef %15:sgpr_96_with_sub0_sub1(tied-def 0), killed %11:sreg_64_xexec, %subreg.sub0_sub1 After, without this patch: undef %16.sub0_sub1:sgpr_96 = COPY killed %11:sreg_64_xexec This fails machine verification if you force it to run after TwoAddressInstruction (currently it is disabled) with: *** Bad machine code: Invalid register class for subregister index *** - function: s_load_constant_v3i32_align4 - basic block: %bb.0 (0xa011a88) - instruction: undef %16.sub0_sub1:sgpr_96 = COPY killed %11:sreg_64_xexec - operand 0: undef %16.sub0_sub1:sgpr_96 Register class SGPR_96 does not fully support subreg index 4 After, with this patch: undef %16.sub0_sub1:sgpr_96_with_sub0_sub1 = COPY killed %11:sreg_64_xexec See also svn r159120 which introduced the code to handle tied undef uses. Differential Revision: https://reviews.llvm.org/D110944
-
Jay Foad authored
-
Roman Lebedev authored
-
Roman Lebedev authored
-
Jinsong Ji authored
LTO don't need binder option , don't pass it in LTO mode. Reviewed By: Whitney Differential Revision: https://reviews.llvm.org/D110955
-
Nikita Popov authored
This is a variant with a variable index, in which case the pointer size adjustment is not performed.
-
Valentin Clement authored
All big enough parser, printer and verifier are moved to the cpp file. This is one of the last one to be moved. This patch is part of the upstreaming effort from fir-dev branch. Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D110929
-
ZijunZhao authored
-
Lang Hames authored
-
Michał Górny authored
-
Sanjay Patel authored
This is no-externally-visible-functional-difference-intended. That is, the test diffs show identical instructions other than name changes (those are included specifically to verify the logic). The existing transforms created extra instructions and relied on subsequent folds to get to the final result, but that could conflict with other transforms like the proposed D110170 (and caused that patch to be reverted twice so far because of infinite combine loops).
-
LLVM GN Syncbot authored
-
Lang Hames authored
With the removal of OrcRPCExecutorProcessControl and OrcRPCTPCServer in 6aeed7b1 the ORC RPC library no longer has any in-tree users. Clients needing serialization for ORC should move to Simple Packed Serialization (usually by adopting SimpleRemoteEPC for remote JITing).
-
Lei Zhang authored
Tiling can create dim ops and those dim ops can take `InitTensorOp` as input. Including it in the tiling canonicalization patterns allows us to fold those dim ops away. Also sorted the existing ops along the way. Reviewed By: mravishankar Differential Revision: https://reviews.llvm.org/D110876
-
Arthur Eubanks authored
We expose the fact that we rely on unsigned wrapping to iterate through all indexes. This can be confusing. Rather, keeping it as an implementation detail through an iterator is less confusing and is less code. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D110885
-
Jay Foad authored
Enabling this does not show any problems in check-llvm in an LLVM_ENABLE_EXPENSIVE_CHECKS build. Differential Revision: https://reviews.llvm.org/D110703
-
Jay Foad authored
LiveVariables does not examine the contents of bundles, so MachineVerifier should not expect it to know about kill flags on operands of instructions inside a bundle. With this fix we can enable machine verification after running the LiveVariables analysis. Doing this does not show any problems in check-llvm in an LLVM_ENABLE_EXPENSIVE_CHECKS build. Differential Revision: https://reviews.llvm.org/D110700
-
Jay Foad authored
Enabling this does not show any problems in check-llvm in an LLVM_ENABLE_EXPENSIVE_CHECKS build. Differential Revision: https://reviews.llvm.org/D110697
-