- Oct 19, 2021
-
-
Florian Hahn authored
This simplifies the return value of addRuntimeCheck from a pair of instructions to a single `Value *`. The existing users of addRuntimeChecks were ignoring the first element of the pair, hence there is not reason to track FirstInst and return it. Additionally all users of addRuntimeChecks use the second returned `Instruction *` just as `Value *`, so there is no need to return an `Instruction *`. Therefore there is no need to create a redundant dummy `and X, true` instruction any longer. Effectively this change should not impact the generated code because the redundant AND will be folded by later optimizations. But it is easy to avoid creating it in the first place and it allows more accurately estimating the cost of the runtime checks.
-
Jacques Pienaar authored
Starting with a mostly NFC change to be able to differentiate between mechanical changes from ones that require more detailed review. This will be used to flush out flow before flipping dialects used outside local testing. As this dialect is not intended to be used generally rather than in tests in core, I will not be following 2 week staging approach here.
-
Craig Topper authored
This function was copied from ARM where register pairs/triples/quads can wrap around the 32 encoding space. So register 31 can pair with register 0. This is not true for RISCV vectors. The spec specifically mentions the possibility of a future encoding that has more than 32 registers. This patch removes the modulo from the code and directly checks that destination register is in the source register range and not the beginning of the range. Though I don't expect an identity copy will occur. Reviewed By: frasercrmck Differential Revision: https://reviews.llvm.org/D111467
-
LLVM GN Syncbot authored
-
Yonghong Song authored
Paul Chaignon reported a bpf verifier failure ([1]) due to using non-ABI register R11. For the test case, llvm11 is okay while llvm12 and later generates verifier unfriendly code. The failure is related to variable length array size. The following mimics the variable length array definition in the test case: struct t { char a[20]; }; void foo(void *); int test() { const int a = 8; char tmp[AA + sizeof(struct t) + a]; foo(tmp); ... } Paul helped bisect that the following llvm commit is responsible: 552c6c23 ("PR44406: Follow behavior of array bound constant folding in more recent versions of GCC.") Basically, before the above commit, clang frontend did constant folding for array size "AA + sizeof(struct t) + a" to be 68, so used alloca for stack allocation. After the above commit, clang frontend didn't do constant folding for array size any more, which results in a VLA and llvm.stacksave/llvm.stackrestore is generated. BPF architecture API does not support stack pointer (sp) register. The LLVM internally used R11 to indicate sp register but it should not be in the final code. Otherwise, kernel verifier will reject it. The early patch ([2]) tried to fix the issue in clang frontend. But the upstream discussion considered frontend fix is really a hack and the backend should properly undo llvm.stacksave/llvm.stackrestore. This patch implemented a bpf IR phase to remove these intrinsics unconditionally. If eventually the alloca can be resolved with constant size, r11 will not be generated. If alloca cannot be resolved with constant size, SelectionDag will complain, the same as without this patch. [1] https://lore.kernel.org/bpf/20210809151202.GB1012999@Mem/ [2] https://reviews.llvm.org/D107882 Differential Revision: https://reviews.llvm.org/D111897 -
AndreyChurbanov authored
This patch allows to simplify compiler implementation on "taskwait nowait" construct. The "taskwait nowait" is semantically equivalent to the empty task. Instead of creating an empty routine as a task entry, compiler can just send NULL pointer to the runtime. Then the runtime will make all the work with dependences and return because of the absent task routine. Differential Revision: https://reviews.llvm.org/D112015
-
Kazu Hirata authored
-
Kirill Stoimenov authored
[Sanitizers] Replaced getMaxPointerSizeInBits with getPointerSizeInBits, which was causing failures for 32bit x86. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D111829
-
Arthur Eubanks authored
This clears the memory used for the Clang AST before we run LLVM passes. https://llvm-compile-time-tracker.com/compare.php?from=d0a5f61c4f6fccec87fd5207e3fcd9502dd59854&to=b7437fee79e04464dd968e1a29185495f3590481&stat=max-rss shows significant memory savings with no slowdown (in fact -O0 slightly speeds up). For more background, see https://lists.llvm.org/pipermail/cfe-dev/2021-September/068930.html. Turn this off for the interpreter since it does codegen multiple times. Relanding with fix for -print-stats: D111973 Differential Revision: https://reviews.llvm.org/D111270
-
Mogball authored
-
Simon Pilgrim authored
-
- Oct 18, 2021
-
-
Mircea Trofin authored
It helps readability and maintainability (don't need to chase down writes to a field I see is const, for example)
-
Mathieu Fehr authored
Besides accessing the record, there is currently no way to access all possible constraint informations, such as the base constraint of a variadic constraint for example. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D111719
-
Mathieu Fehr authored
AnyAttrOf, similar to AnyTypeOf, expects the attribute to be one of the given attributes. For instance, `AnyAttrOf<[I32Attr, StrAttr]>` expects either a `I32Attr`, or a `StrAttr`. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D111739
-
Arthur Eubanks authored
We still need access to various things in the ASTContext when printing stats. Differential Revision: https://reviews.llvm.org/D111973
-
gbreynoo authored
This change is derived from a test case we have locally but I could not see an equivalent in LLD's testing. Differential Revision: https://reviews.llvm.org/D111803
-
River Riddle authored
Don't set printOpOnDiagnostic, as this is not safe to call from a threaded context. Differential Revision: https://reviews.llvm.org/D111752
-
Louis Dionne authored
-
River Riddle authored
This removes edge cases where the default flags we want to use during printing (e.g. local scope, eliding attributes, etc.) get missed/dropped. Differential Revision: https://reviews.llvm.org/D111761
-
Gil Rapaport authored
Record widening decisions for memory operations within the planned recipes and use the recorded decisions in code-gen rather than querying the cost model. Differential Revision: https://reviews.llvm.org/D110479
-
Jon Chesterfield authored
Useful for OMP_TARGET_OFFLOAD=MANDATORY when testing Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D111995
-
Ahmed Taei authored
When folding A->B->C => A->C only accept A->C that is valid shape cast Reviewed By: ThomasRaoux, nicolasvasilache Differential Revision: https://reviews.llvm.org/D111473
-
Louis Dionne authored
Differential Revision: https://reviews.llvm.org/D110426
-
Jessica Clarke authored
The MIPS ABI requires the thread pointer be accessed via rdhwr $3, $r29. This is currently represented by (CopyToReg $3, (RDHWR $29)) followed by a (CopyFromReg $3). However, there is no glue between these, meaning scheduling can break those apart. In particular, PR51691 is a report where PseudoSELECT_I was moved to between the CopyToReg and CopyFromReg, and since its expansion uses branches, it split the def and use of the physical register between two basic blocks, resulting in the def being eliminated and the use having no def. It also seems possible that a similar situation could arise splitting up the CopyToReg from the RDHWR, causing the RDHWR to use a destination register other than $3, violating the ABI requirement. Thus, add glue between all three nodes to ensure they aren't split up during instruction selection. No regression test is added since any test would be implictly relying on specific scheduling behaviour, so whilst it might be testing that glue is preventing reordering today, changes to scheduling behaviour could result in the test no longer being able to catch a regression here, as the reordering might no longer happen for other unrelated reasons. Fixes PR51691. Reviewed By: atanasyan, dim Differential Revision: https://reviews.llvm.org/D111967
-
Simon Pilgrim authored
-
rkayaith authored
Add a read-only `loc` property to Operation and OpView Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D111972
-
Raphael Isemann authored
Right now we only set a dependency on libc++ when the host is Darwin, which means that libc++ in the build directory is in some undefined state when running the test suite (it can be fully built, out-of-date or missing). Depending on whether we have a system libc++ (which LLDB also supports running the libc++ tests against), the outcome is that we sometimes skip the libc++ tests or we run the tests against a mix of ToT-libc++/system-libc++ (e.g., we compile against the ToT-libc++ headers and link against the system libc++ library). This can be demonstrated via `export LIT_FILTER=TestDataFormatterLibcxxSet ninja check-lldb-api` (or any other libc++ test) and then gradually building parts of libc++ in the same build (which will slowly change the test behaviour from `UNSUPPORTED` to various failures to passing depending on how much of libcxx is built at test time). Note that this effectively re-enables the (unintentionally) disabled libc++ formatter tests on Linux. Don't revert this if it breaks a libc++ LLDB test, instead please @skipIf decorate the failing test (as it was probably already failing before this commit). Reviewed By: labath Differential Revision: https://reviews.llvm.org/D111981
-
Peter Waller authored
Accidentally committed a prior version of this patch. This is the correct version.
-
Kerry McLaughlin authored
The patterns added in D111441 should use the HasSVEorStreamingSVE predicate. This changes one incorrect use of HasSVE with the new patterns.
-
Andrew Wei authored
Try to widen element type to get a new mask value for a better permutation sequence, so that we can use NEON shuffle instructions, such as zip1/2, UZP1/2, TRN1/2, REV, INS, etc. For example: shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 6, i32 7, i32 2, i32 3> is equivalent to: shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 3, i32 1> Finally, we can get: mov v0.d[0], v1.d[1] Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D111619
-
Pavel Labath authored
It's been broken (not failing, but not testing anything either) for quite some time now, and nobody noticed. It also (by design) tests stepping through libc code, which makes it completely non-hermetic. It's not worth reviving such a test.
-
Sanjay Patel authored
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
-
Balazs Benics authored
Fallback to stringification and string comparison if we cannot compare the `IdentifierInfo`s, which is the case for C++ overloaded operators, constructors, destructors, etc. Examples: { "std", "basic_string", "basic_string", 2} // match the 2 param std::string constructor { "std", "basic_string", "~basic_string" } // match the std::string destructor { "aaa", "bbb", "operator int" } // matches the struct bbb conversion operator to int Reviewed By: martong Differential Revision: https://reviews.llvm.org/D111535 -
Balazs Benics authored
Refactor the code to make it more readable. It will set up further changes, and improvements to this code in subsequent patches. This is a non-functional change. Reviewed By: martong Differential Revision: https://reviews.llvm.org/D111534
-
Balazs Benics authored
This NFC change accomplishes three things: 1) Splits up the single unittest into reasonable segments. 2) Extends the test infra using a template to select the AST-node from which it is supposed to construct a `CallEvent`. 3) Adds a *lot* of different tests, documenting the current capabilities of the `CallDescription`. The corresponding tests are marked with `FIXME`s, where the current behavior should be different. Both `CXXMemberCallExpr` and `CXXOperatorCallExpr` are derived from `CallExpr`, so they are matched by using the default template parameter. On the other hand, `CXXConstructExpr` is not derived from `CallExpr`. In case we want to match for them, we need to pass the type explicitly to the `CallDescriptionAction`. About destructors: They have no AST-node, but they are generated in the CFG machinery in the analyzer. Thus, to be able to match against them, we would need to construct a CFG and walk on that instead of simply walking the AST. I'm also relaxing the `EXPECT`ation in the `CallDescriptionConsumer::performTest()`, to check the `LookupResult` only if we matched for the `CallDescription`. This is necessary to allow tests in which we expect *no* matches at all. Reviewed By: martong Differential Revision: https://reviews.llvm.org/D111794
-
Sylvestre Ledru authored
-
Simon Pilgrim authored
Differential Revision: https://reviews.llvm.org/D111941
-
Simon Pilgrim authored
Differential Revision: https://reviews.llvm.org/D111941
-
Pavel Labath authored
-