- Jan 16, 2021
-
-
Derek Schuff authored
This reverts commit e9f1ed23. Reverting because it depends on 38dfce70
-
Dávid Bolvanský authored
Example: ``` __attribute__((nonnull,noinline)) char * pinc(char *p) { return ++p; } char * foo(bool b, char *a) { return pinc(b ? 0 : a); } ``` optimize to ``` char * foo(bool b, char *a) { return pinc(a); } ``` Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D94180 -
Vladislav Vinogradov authored
Unary minus operator applied to unsigned type, result still unsigned. Use `~0U` instead of `-1U` and `1 + ~VAL` instead of `-VAL`. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D94417
-
Amara Emerson authored
-
Duncan P. N. Exon Smith authored
This reverts commit 33be50da, effectively reapplying: - 260a856c - 3043e5a5 - 49142991 ... with a fix to skip a call to `SmallVector::isReferenceToStorage()` when we know the parameter had been taken by value for small, POD-like `T`. See https://reviews.llvm.org/D93779 for the discussion on the revert. At a high-level, these commits fix reference invalidation in SmallVector's push_back, append, insert (one or N), and resize operations. For more details, please see the original commit messages. This commit fixes a bug that crept into `SmallVectorTemplateCommon::reserveForAndGetAddress()` during the review process after performance analysis was done. That function is now called `reserveForParamAndGetAddress()`, clarifying that it only works for parameter values. It uses that knowledge to bypass `SmallVector::isReferenceToStorage()` when `TakesParamByValue`. This is `constexpr` and avoids adding overhead for "small enough", trivially copyable `T`. Performance could potentially be tuned further by increasing the threshold for `TakesParamByValue`, which is currently defined as: ``` bool TakesParamByValue = sizeof(T) <= 2 * sizeof(void *); ``` in the POD-like version of SmallVectorTemplateBase (else, `false`). Differential Revision: https://reviews.llvm.org/D94800
-
Sanjay Patel authored
To get into this block we had: !A || B || C and we checked C in the first 'if' clause leaving !A || B. But the 2nd 'if' is checking: A && !B --> !(!A || B)
-
Jason Molenda authored
Differential Revision: https://reviews.llvm.org/D94754
-
MaheshRavishankar authored
The operantion is an identity if the values yielded by the operation is the argument of the basic block of that operation. Add this missing check. Differential Revision: https://reviews.llvm.org/D94819
-
Nick Desaulniers authored
Otherwise we'll fail the assertion in SplitBlockPredecessors() related to splitting the edges from CallBr's. Fixes: https://github.com/ClangBuiltLinux/linux/issues/1161 Fixes: https://github.com/ClangBuiltLinux/linux/issues/1252 Reviewed By: void, MaskRay, jyknight Differential Revision: https://reviews.llvm.org/D88438
-
Christopher Di Bella authored
We'd discussed adding the warning to -Wall in D89988. This patch honours that.
-
Reid Kleckner authored
If the host compiler is MSVC or clang-cl, then the compiler used to buidl the runtimes will be clang-cl, and it doesn't support either of those flags. Worse, because -isystem is a space separated flag, it causes all cmake try_compile tests to fail, so none of the -Wno-* flags make it to the compiler in libcxx. I noticed that we weren't passing -Wno-user-defined-literals to clang-cl and were getting warnings in the build, and this fixes that for me. Differential Revision: https://reviews.llvm.org/D94817
-
Mitch Phillips authored
Adds a modified options parser (shamefully pulled from Scudo, which shamefully pulled it from sanitizer-common) to GWP-ASan. This allows customers (Android) to parse options strings in a common way. Depends on D94117. AOSP side of these patches is staged at: - sepolicy (sysprops should only be settable by the shell, in both root and unrooted conditions): https://android-review.googlesource.com/c/platform/system/sepolicy/+/1517238 - zygote updates: https://android-review.googlesource.com/c/platform/frameworks/base/+/1515009 - bionic changes to add `gwp_asan.<process_name>` system property, and GWP_ASAN_OPTIONS environment variable: https://android-review.googlesource.com/c/platform/bionic/+/1514989 Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D92696
-
Roman Lebedev authored
DestBB might or might not already be a successor of SelectBB, and it wasn't we need to ensure that we record the fact in DomTree. The testcase used to crash in lazy domtree updater mode + non-per-function domtree validity checks disabled.
-
Roman Lebedev authored
[SimplifyCFG][BasicBlockUtils] Port SplitBlockPredecessors()/SplitLandingPadPredecessors() to DomTreeUpdater This is not nice, but it's the best transient solution possible, and is better than just duplicating the whole function. The problem is, this function is widely used, and it is not at all obvious that all the users could be painlessly switched to operate on DomTreeUpdater, and somehow i don't feel like porting all those users first. This function is one of last three that not operate on DomTreeUpdater.
-
Roman Lebedev authored
This is not nice, but it's the best transient solution possible, and is better than just duplicating the whole function. The problem is, this function is widely used, and it is not at all obvious that all the users could be painlessly switched to operate on DomTreeUpdater, and somehow i don't feel like porting all those users first. This function is one of last three that not operate on DomTreeUpdater.
-
Roman Lebedev authored
This is not nice, but it's the best transient solution possible, and is better than just duplicating the whole function. The problem is, this function is widely used, and it is not at all obvious that all the users could be painlessly switched to operate on DomTreeUpdater, and somehow i don't feel like porting all those users first. This function is one of last three that not operate on DomTreeUpdater.
-
Roman Lebedev authored
Even though not all it's users operate on DomTreeUpdater, it itself internally operates on DomTreeUpdater, so it must mean everything is fine with that, so just do that globally.
-
Roman Lebedev authored
-
Reid Kleckner authored
This reverts commit a3904cc7. It causes the compiler to crash while building Harfbuzz for ARM in Chromium, reduced reproducer forthcoming: https://crbug.com/1167305
-
Amy Huang authored
being added to class types in -gline-tables-only. Also changed the name of the test file for clarity. (follow up to D94639)
-
Sanjay Patel authored
These were made obsolete by simplifying the code in recent patches.
-
Craig Topper authored
This 'FIXME' popped up in the development of an out-of-tree backend. Quick fix, but first llvm upstream patch, therefore I do not have commit rights, so if approved please commit? - Test is not included as this came up in an out-of-tree backend (if required, please hint on how to test this). Patch by simveg (Simon) Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D93219
-
Reid Kleckner authored
Clang insists that __attribute__ attributes precede __declspec attributes. This is a longstanding known issue: https://llvm.org/pr24559. Re-order the visibility and deprecation macros to fix the build. Differential Revision: https://reviews.llvm.org/D94788
-
Julian Lettner authored
`GetMacosAlignedVersion()` fails for ASan-ified launchd because the sanitizer initialization code runs before `sysctl` has been setup by launchd. In this situation, `sysctl kern.osproductversion` returns a non-empty string that does not match our expectations of a well-formatted version string. Retrieving the kernel version (via `sysctl kern.osrelease`) still works, so we can use it to add a fallback for this corner case. Differential Revision: https://reviews.llvm.org/D94190
-
Craig Topper authored
SimplifyDemandedBits can remove set bits from immediates from instructions like AND/OR/XOR. This can prevent them from being efficiently codegened on RISCV. This adds an initial version that tries to keep or form 12 bit sign extended immediates for AND operations to enable use of ANDI. If that doesn't work we'll try to create a 32 bit sign extended immediate to use LUI+ADDIW. More optimizations are possible for different size immediates or different operations. But this is a good starting point that already has test coverage. Reviewed By: frasercrmck Differential Revision: https://reviews.llvm.org/D94628
-
Alexander Belyaev authored
Differential Revision: https://reviews.llvm.org/D94764
-
Jessica Paquette authored
Add a matcher that checks if the given subpattern has only one non-debug use. Also improve existing m_OneUse testcase. Differential Revision: https://reviews.llvm.org/D94705
-
David Green authored
The TripCount for a predicated vector loop body will be ceil(ElementCount/Width). This alters the conversion of an active.lane.mask to a VCPT intrinsics to match. Differential Revision: https://reviews.llvm.org/D94608
-
David Green authored
-
Amy Huang authored
for function scopes, rather than using the qualified name. In line-tables-only mode, we used to emit qualified names as the display name for functions when using CodeView. This patch changes to emitting the parent scopes instead, with forward declarations for class types. The total object file size ends up being slightly smaller than if we use the full qualified names. Differential Revision: https://reviews.llvm.org/D94639
-
Anastasia Stulova authored
Tags: #clang
-
Utkarsh Saxena authored
A better sampling strategy was used to generate the dataset for this model. New signals introduced in this model: - NumNameInContext: Number of words in the context that matches the name of the candidate. - FractionNameInContext: Fraction of the words in context matching the name of the candidate. We remove the signal `IsForbidden` from the model and down rank forbidden signals aggresively. Differential Revision: https://reviews.llvm.org/D94697
-
Andrzej Warzynski authored
The following driver invocation will generate an output file in the same directory as the input file: ``` flang-new -fc1 -test-io test-input.f90 ``` This is the desired behaviour. However, when testing we need to make sure that we don't pollute the source directory. To this end, copy the input file into a temporary directory before testing. This is similar to https://reviews.llvm.org/D94243.
-
Craig Topper authored
These methods are recursive so a little costly. We only look at the result in one place in this function and it's conditional. We also only need the second call if the first had enough returned enough sign bits.
-
Peter Steinfeld authored
C843 states that "An entity with the INTENT attribute shall be a dummy data object or a dummy procedure pointer." This change enforces that and fixes some tests that erroneously violated this rule. Differential Revision: https://reviews.llvm.org/D94781
-
Simon Pilgrim authored
If this will help us fold shuffles together, then push the shuffle through the merged binops. Ideally this would be performed in DAGCombiner::visitVECTOR_SHUFFLE but getting an efficient+legal merged shuffle can be tricky - on SSE we can be confident that for 32/64-bit elements vectors shuffles should easily fold.
-
- Jan 15, 2021
-
-
Sam Tebbs authored
Not all machine loops will have a predecessor. so the pass needs to check it before continuing. Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D94780
-
Jan Svoboda authored
This patch promotes `ParseLangArgs` and `ParseCodeGenArgs` to members of `CompilerInvocation`. That will be useful in the following patch D94682, where we need to access protected members of `LangOptions` and `CodeGenOptions`. Both of those classes already have `friend CompilerInvocation`. This is cleaner than keeping those functions freestanding and having to specify the exact signature of both in extra `friend` declarations. Reviewed By: Bigcheese Differential Revision: https://reviews.llvm.org/D94681
-
Jan Svoboda authored
This patch ensures we only parse the necessary options before calling `setLangDefaults` (explained in D94678). Because neither `LangOpts.CFProtectionBranch` nor `LangOpts.SYCLIsDevice` are used in `setLangDefaults`, this is a NFC. Reviewed By: Bigcheese Differential Revision: https://reviews.llvm.org/D94680
-
Jan Svoboda authored
This patch effectively reverts a small part of D83979. When we stop parsing `LangOpts` unconditionally in `parseSimpleArgs` (above the diff) and move them back to `ParseLangArgs` (called in `else` branch) in D94682, `LangOpts.PIE` would never get parsed in this `if` branch. This patch ensures this doesn't happen. Right now, this causes `LangOpts.PIE` to be parsed twice, but that will be immediately corrected in D94682. Reviewed By: Bigcheese Differential Revision: https://reviews.llvm.org/D94679
-