António Afonso [Sun, 21 Feb 2021 18:38:25 +0000 (10:38 -0800)]
Revert "Make sure the interpreter module was loaded before making checks against it"
This reverts commit
a83a825e9902b54b315870e9ed85723525208f09.
madhur13490 [Sun, 21 Feb 2021 18:02:44 +0000 (18:02 +0000)]
[NFC] Remove redundant word in comment
Differential Revision: https://reviews.llvm.org/D97157
António Afonso [Fri, 19 Feb 2021 17:43:38 +0000 (09:43 -0800)]
[lldb-vscode] Emit the breakpoint changed event on location resolved
VSCode was not being informed whenever a location had been resolved (after being initated as non-resolved), so even though it was actually resolved, the IDE would show a hollow dot (instead of a red dot) because it didn't know about the change.
Differential Revision: https://reviews.llvm.org/D96680
Nikita Popov [Sun, 21 Feb 2021 16:49:49 +0000 (17:49 +0100)]
[Loads] Add optimized FindAvailableLoadedValue() overload (NFCI)
FindAvailableLoadedValue() accepts an iterator by reference. If no
available value is found, then the iterator will either be left
at a clobbering instruction or the beginning of the basic block.
This allows using FindAvailableLoadedValue() across multiple blocks.
If this functionality is not needed, as is the case in InstCombine,
then we can use a much more efficient implementation: First try
to find an available value, and only perform clobber checks if
we actually found one. As this function only looks at a very small
number of instructions (6 by default) and usually doesn't find an
available value, this saves many expensive alias analysis queries.
Sanjay Patel [Sun, 21 Feb 2021 17:33:53 +0000 (12:33 -0500)]
[IR] restrict vector reduction intrinsic types
The arguments in all cases should be vectors of exactly one of integer or FP.
All of the tests currently pass the verifier because we check for any vector
type regardless of the type of reduction.
This obviously can't work if we mix up integer and FP, and based on current
LangRef text it was not intended to work for pointers either.
The pointer case from https://llvm.org/PR49215 is what led me here. That
example was avoided with
5b250a27ec.
Differential Revision: https://reviews.llvm.org/D96904
António Afonso [Fri, 19 Feb 2021 04:31:55 +0000 (20:31 -0800)]
Make sure the interpreter module was loaded before making checks against it
This issue was introduced in https://reviews.llvm.org/D92187.
The guard I'm changing were is supposed to act when linux is loading the linker for the second time (due to differences in paths like symlinks).
This is done by checking `module_sp != m_interpreter_module.lock()` however this will be true when `m_interpreter_module` wasn't initialized, making linux unload the linker module (the most visible result here is that lldb will stop getting notified about new modules loaded by the process, because it can't set the rendezvous breakpoint again after the stepping over it once).
The `m_interpreter_module` is not getting initialize when it goes through this path: https://github.com/llvm/llvm-project/blob/
dbfdb139f75470a9abc78e7c9faf743fdd963c2d/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp#L332, which happens when lldb was able to read the address from the dynamic section of the executable.
What I'm not sure about though, is if when we go through this path if we still load the linker twice on linux. If that's the case then it means we need to somehow set the m_interpreter_module instead of the fix I provide here. I've only tested this on Android.
Differential Revision: https://reviews.llvm.org/D96637
Nikita Popov [Sun, 21 Feb 2021 17:22:34 +0000 (18:22 +0100)]
[Loads] Extract helper frunction for available load/store (NFC)
This contains the logic for extracting an available load/store
from a given instruction, to be reused in a following patch.
Kristina Bessonova [Tue, 2 Feb 2021 10:13:43 +0000 (12:13 +0200)]
[ThinLTO] Fix import of multiply defined global variables
Currently, if there is a module that contains a strong definition of
a global variable and a module that has both a weak definition for
the same global and a reference to it, it may result in an undefined symbol error
while linking with ThinLTO.
It happens because:
* the strong definition become internal because it is read-only and can be imported;
* the weak definition gets replaced by a declaration because it's non-prevailing;
* the strong definition failed to be imported because the destination module
already contains another definition of the global yet this def is non-prevailing.
The patch adds a check to computeImportForReferencedGlobals() that allows
considering a global variable for being imported even if the module contains
a definition of it in the case this def has an interposable linkage type.
Note that currently the check is based only on the linkage type
(and this seems to be enough at the moment), but it might be worth to account
the information whether the def is prevailing or not.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D95943
Simon Pilgrim [Sun, 21 Feb 2021 15:26:54 +0000 (15:26 +0000)]
[DAG] Match USUBSAT patterns through zext/trunc
This patch handles usubsat patterns hidden through zext/trunc and uses the getTruncatedUSUBSAT helper to determine if the USUBSAT can be correctly performed in the truncated form:
zext(x) >= y ? x - trunc(y) : 0 --> usubsat(x,trunc(umin(y,SatLimit)))
zext(x) > y ? x - trunc(y) : 0 --> usubsat(x,trunc(umin(y,SatLimit)))
Based on original examples:
void foo(unsigned short *p, int max, int n) {
int i;
unsigned m;
for (i = 0; i < n; i++) {
m = *--p;
*p = (unsigned short)(m >= max ? m-max : 0);
}
}
Differential Revision: https://reviews.llvm.org/D25987
Simon Pilgrim [Sun, 21 Feb 2021 14:50:43 +0000 (14:50 +0000)]
[X86][AVX] Fold concat(extract_subvector(v0,c0), extract_subvector(v1,c1)) -> vperm2x128
Fixes regression exposed by removing bitcasts across logic-ops in D96206.
Differential Revision: https://reviews.llvm.org/D96206
Simon Pilgrim [Sun, 21 Feb 2021 14:40:54 +0000 (14:40 +0000)]
[X86] Fold bitcast(logic(bitcast(X), Y)) --> logic'(X, bitcast(Y)) for int-int bitcasts
Extend the existing combine that handles bitcasting for fp-logic ops to also help remove logic ops across bitcasts to/from the same integer types.
This helps improve AVX512 predicate handling for D/Q logic ops and also allows DAGCombine's scalarizeExtractedBinop to remove some annoying gpr->simd->gpr transfers.
The concat_vectors regression in pr40891.ll will be addressed in a followup commit on this patch.
Differential Revision: https://reviews.llvm.org/D96206
Craig Topper [Sun, 21 Feb 2021 08:06:51 +0000 (00:06 -0800)]
[RISCV] Add test cases for add/sub/mul overflow intrinsics. NFC
Largely copied from AArch64/arm64-xaluo.ll
Petr Hosek [Tue, 16 Feb 2021 07:41:16 +0000 (23:41 -0800)]
[lld][ELF] __start_/__stop_ refs don't retain C-ident named group sections
The special root semantics for identifier-named sections is meant
specifically for the metadata sections. In the context of group
semantics, where group members are always retained or discarded as a
unit, it's natural not to have this semantics apply to a section in a
group, otherwise we would never discard the group defeating the purpose
of using the group in the first place.
This change modifies the GC behavior so that __start_/__stop_ references
don't retain C identifier named sections in section groups which allows
for these groups to be collected. This matches the behavior of BFD ld.
The only kind of existing case that might break is interdependent
metadata sections that are all in a group together, but that group
doesn't contain any other sections referenced by anything except
implicit inclusion in a `__start_` and/or `__stop_`-referenced
identifier-named section, but such cases should be unlikely.
Differential Revision: https://reviews.llvm.org/D96753
Kazu Hirata [Sun, 21 Feb 2021 05:46:02 +0000 (21:46 -0800)]
[CodeGen] Use range-based for loops (NFC)
Kazu Hirata [Sun, 21 Feb 2021 05:46:00 +0000 (21:46 -0800)]
[TableGen] Use ListSeparator (NFC)
Jianzhou Zhao [Sun, 21 Feb 2021 03:29:56 +0000 (03:29 +0000)]
[dfsan] Comment out unused methods by D97087 temporarily
Brad Smith [Sun, 21 Feb 2021 01:43:16 +0000 (20:43 -0500)]
[clang][Driver][OpenBSD] libcxx also requires pthread
Dave Lee [Fri, 19 Feb 2021 19:26:28 +0000 (11:26 -0800)]
[lldb] Refine ThreadPlan::ShouldAutoContinue
Adjust `ShouldAutoContinue` to be available to any thread plan previous to the plan that
explains a stop, not limited to the parent to the plan that explains the stop.
Before this change, `Thread::ShouldStop` did the following:
1. find the plan that explains the stop
2. if it's not a master plan, continue processing previous (aka parent) plans
3. first, call `ShouldAutoContinue` on the immediate parent of the explaining plan
4. then loop over previous plans, calling `ShouldStop` and `MischiefManaged`
Of note, the iteration in step 4 does not call `ShouldAutoContinue`, so again only the
plan just prior to the explaining plan is given the opportunity to override whether to
continue or stop.
This commit changes the loop call `ShouldAutoContinue`, giving each plan the opportunity
to override `ShouldStop` of previous plans.
Why? This allows a plan to do the following:
1. mark itself done and be popped off the stack
2. allow parent plans to finish their work, and to also be popped off the stack
3. and finally, have the thread continue, not stop
This is useful for stepping into async functions. A plan will would step far enough
enough to set a breakpoint on the async target, and then use `ShouldAutoContinue` to
unwind the necessary stepping, and then have the calling thread continue.
Differential Revision: https://reviews.llvm.org/D97076
Jacques Pienaar [Sat, 20 Feb 2021 23:54:52 +0000 (15:54 -0800)]
Update test error string post pass registration change
Jacques Pienaar [Sat, 20 Feb 2021 23:42:02 +0000 (15:42 -0800)]
[mlir] Register the print-op-graph pass using ODS
Move over to ODS & use pass options.
Nathan James [Sat, 20 Feb 2021 23:35:58 +0000 (23:35 +0000)]
[NFC] Refactor PreferMemberInitializerCheck
Martin Storsjö [Fri, 19 Feb 2021 22:10:56 +0000 (00:10 +0200)]
[libcxx] [test] Call create_directory_symlink when linking directories
This makes the symlinks work properly on windows.
A similar round of cleanup was done in
c41bda7f5fc26e4602a029646991d6a5c59cb365, but these tests were
added after that.
Differential Revision: https://reviews.llvm.org/D97089
Martin Storsjö [Fri, 6 Nov 2020 09:57:47 +0000 (11:57 +0200)]
[libcxx] Make path::format a non-class enum
The spec doesn't declare it as an enum class, and being declared
as an enum class breaks referring to the values as e.g.
path::auto_format.
Differential Revision: https://reviews.llvm.org/D97084
Petr Hosek [Sat, 20 Feb 2021 05:41:45 +0000 (21:41 -0800)]
[InstrProfiling] Use nobits as __llvm_prf_cnts section type in ELF
This can reduce the binary size because counters will no longer occupy
space in the binary, instead they will be allocated by dynamic linker.
Differential Revision: https://reviews.llvm.org/D97110
Stephen Kelly [Mon, 28 Dec 2020 01:54:04 +0000 (01:54 +0000)]
[clang-tidy] Simplify throw keyword missing check
Extend test to verify that it does not match in template instantiations.
Differential Revision: https://reviews.llvm.org/D96132
Stephen Kelly [Sat, 26 Dec 2020 21:40:51 +0000 (21:40 +0000)]
[clang-tidy] Simplify function complexity check
Update test to note use of lambda instead of the invisible operator().
Differential Revision: https://reviews.llvm.org/D96131
Craig Topper [Sat, 20 Feb 2021 21:48:18 +0000 (13:48 -0800)]
[RISCV] Add another test case showing failure to use remw when the RHS has been zero extended from less than i32. NFC
Stephen Kelly [Tue, 29 Dec 2020 13:18:57 +0000 (13:18 +0000)]
[clang-itdy] Simplify virtual near-miss check
Diagnose the problem in templates in the context of the template
declaration instead of in the context of all of the (possibly very many)
template instantiations.
Differential Revision: https://reviews.llvm.org/D96224
Nikita Popov [Fri, 1 Jan 2021 20:57:34 +0000 (21:57 +0100)]
[ConstantRange] Handle wrapping ranges in min/max (PR48643)
When one of the inputs is a wrapping range, intersect with the
union of the two inputs. The union of the two inputs corresponds
to the result we would get if we treated the min/max as a simple
select.
This fixes PR48643.
Sanjay Patel [Sat, 20 Feb 2021 14:02:39 +0000 (09:02 -0500)]
[InstCombine] fold fdiv with exp/exp2 divisor (PR49147)
Follow-up to:
D96648 /
b40fde062
...for the special-case base calls.
From the earlier commit:
This is unusual in the general (non-reciprocal) case because we need
an extra instruction, but that should be better for general FP
reassociation and codegen. We conservatively check for "arcp" FMF
here as we do with existing fdiv folds, but it is not strictly
necessary to have that.
Sanjay Patel [Fri, 19 Feb 2021 21:36:02 +0000 (16:36 -0500)]
[InstCombine] add tests for fdiv of exp/exp2; NFC
Nikita Popov [Sat, 20 Feb 2021 20:42:26 +0000 (21:42 +0100)]
[ConstantRange] Handle wrapping range in binaryNot()
We don't need any special handling for wrapping ranges (or empty
ranges for that matter). The sub() call will already compute a
correct and precise range.
We only need to adjust the test expectation: We're now computing
an optimal result, rather than an unsigned envelope.
AndreyChurbanov [Sat, 20 Feb 2021 20:26:35 +0000 (23:26 +0300)]
[OpenMP] libomp: cleanup some resource leaks
Close mutexattr and condattr local objects to eliminate resource leaks.
Differential Revision: https://reviews.llvm.org/D96892
Craig Topper [Sat, 20 Feb 2021 19:51:41 +0000 (11:51 -0800)]
[RISCV] Add an additional remw test to rv64m-exhaustive-w-insts.ll. NFC
This adds the IR for this C code
int32_t foo(uint16_t x, int16_t y) {
x %= y;
return x;
}
Note the dividend is unsigned and the divisor is signed. C type
promotion rules will extend them and use a 32-bit srem and the
function returns a 32-bit result.
We fail to use remw for this case. The zero extended input has
enough sign bits, but we won't consider (i64 AssertZext X, i16) in
the sexti32 isel pattern.
We also end up with a extra shifts to zero upper bits on the result.
computeKnownBits knew the result was positive before type legalization
and allowed the SIGN_EXTEND to become ZERO_EXTEND. But after promoting
to i64 we no longer know that bit 31 (and all bits above it) should
be 0.
Shilei Tian [Sat, 20 Feb 2021 20:13:22 +0000 (15:13 -0500)]
[Clang][OpenMP] Update driver test case for OpenMP offload to use sm_35
`sm_35` is the minimum requirement for OpenMP offloading on NVPTX device.
Current driver test case is using `sm_20`. D97003 is going to switch the minimum
CUDA version to 9.2, which only supports `sm_30+`. This patch makes step for the
change.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D97120
Stephen Kelly [Tue, 29 Dec 2020 13:42:20 +0000 (13:42 +0000)]
[clang-tidy] Simplify braced init check
The normalization of matchers means that this now works in all language
modes.
Differential Revision: https://reviews.llvm.org/D96135
Daan De Meyer [Sat, 30 Jan 2021 19:28:11 +0000 (19:28 +0000)]
clang: Exclude efi_main from -Wmissing-prototypes
When compiling UEFI applications, the main function is named
efi_main() instead of main(). Let's exclude efi_main() from
-Wmissing-prototypes as well to avoid warnings when working
on UEFI applications.
Differential Revision: https://reviews.llvm.org/D95746
Nikita Popov [Sat, 20 Feb 2021 18:53:38 +0000 (19:53 +0100)]
[ConstantRangeTest] Print detailed information on failure (NFC)
When the optimality check fails, print the inputs, the computed
range and the better range that was found. This makes it much
simpler to identify the cause of the failure.
Make sure that full ranges (which, unlikely all the other cases,
have multiple ways to construct them that all result in the same
range) only print one message by handling them separately.
Nico Weber [Thu, 18 Feb 2021 13:48:07 +0000 (08:48 -0500)]
[lld/mac] reject -undefined warning and -undefined suppress with -twolevel_namespace
See discussion on https://reviews.llvm.org/D93263
-flat_namespace isn't implemented yet, and neither is -undefined dynamic,
so this makes -undefined pretty pointless in lld/MachO for now. But once
we implement -flat_namespace (which we need to do anyways to get check-llvm
to pass with lld as host linker), the code's already there.
Follow-up to https://reviews.llvm.org/D93263#2491865
Differential Revision: https://reviews.llvm.org/D96963
Stephen Kelly [Fri, 19 Feb 2021 22:59:35 +0000 (22:59 +0000)]
[ASTMatchers] Fix hasUnaryOperand matcher for postfix operators
Differential Revision: https://reviews.llvm.org/D97095
Teresa Johnson [Fri, 19 Feb 2021 01:23:02 +0000 (17:23 -0800)]
[LTO] Fix cloning of llvm*.used when splitting module
Refines the fix in
3c4c205060c9398da705eb71b63ddd8a04999de9 to only
put globals whose defs were cloned into the split regular LTO module
on the cloned llvm*.used globals. This avoids an issue where one of the
attached values was a local that was promoted in the original module
after the module was cloned. We only need to have the values defined in
the new module on those globals.
Fixes PR49251.
Differential Revision: https://reviews.llvm.org/D97013
Shilei Tian [Sat, 20 Feb 2021 17:46:04 +0000 (12:46 -0500)]
[OpenMP][NFC] clang-format the whole openmp project
Same script as D95318. Test files are excluded.
Reviewed By: AndreyChurbanov
Differential Revision: https://reviews.llvm.org/D97088
Stephen Kelly [Sun, 14 Feb 2021 15:16:35 +0000 (15:16 +0000)]
Revert "Implement nullPointerConstant() using a better API."
This reverts commit
9148302a (2019-08-22) which broke the pre-existing
unit test for the matcher. Also revert commit
518b2266 (Fix the
nullPointerConstant() test to get bots back to green., 2019-08-22) which
incorrectly changed the test to expect the broken behavior.
Differential Revision: https://reviews.llvm.org/D96665
Fraser Cormack [Thu, 18 Feb 2021 12:48:14 +0000 (12:48 +0000)]
[RISCV] Support extraction of misaligned subvectors
This patch extends the support for RVV EXTRACT_SUBVECTOR to cover those
which don't align to a vector register boundary. It accomplishes this by
extracting the nearest register-sized subvector (a subregister
operation), then sliding the vector down with VSLIDEDOWN and extracting
the subvector from the first position (a COPY operation).
Since this procedure involves the use of VSCALE and multiplication, the
handling of such operations is done during lowering to simplify the
implementation and make use of DAG combining. This necessitated moving
some helper functions from RISCVISelDAGToDAG to RISCVTargetLowering.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D96959
Fraser Cormack [Fri, 19 Feb 2021 15:54:40 +0000 (15:54 +0000)]
[RISCV] Improve register allocation around vector masks
With vector mask registers only allocatable to V0 (VMV0Regs) it is
relatively simple to generate code which uses multiple masks and naively
requires spilling.
This patch aims to improve codegen in such cases by telling LLVM it can
use VRRegs to hold masks. This will prevent spilling in many cases by
having LLVM copy to an available VR register.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D97055
David Zarzycki [Sat, 20 Feb 2021 14:43:36 +0000 (09:43 -0500)]
[lit testing] "END." not "END:"
Simon Pilgrim [Sat, 20 Feb 2021 12:25:58 +0000 (12:25 +0000)]
[InstCombine] matchBSwapOrBitReverse - remove pattern matching early-out. NFCI.
recognizeBSwapOrBitReverseIdiom + collectBitParts have pattern matching to bail out early if a bswap/bitreverse pattern isn't possible - we should be able to rely on this instead without any notable change in compile time.
This is part of a cleanup towards letting matchBSwapOrBitReverse /recognizeBSwapOrBitReverseIdiom use 'root' instructions that aren't ORs (FSHL/FSHRs in particular which can be prematurely created).
Differential Revision: https://reviews.llvm.org/D97056
Mark de Wever [Sat, 20 Feb 2021 12:52:40 +0000 (13:52 +0100)]
[libc++] Fix the build for AppleClang.
Forgot to add some parts of D93593, this should disable the tests on
Apple. Seems Louis was right ;-)
Fraser Cormack [Sat, 20 Feb 2021 12:34:27 +0000 (12:34 +0000)]
[RISCV] Pre-commit test case for D97055. NFC.
This adds a test which unnecessarily spills mask registers.
Simon Pilgrim [Sat, 20 Feb 2021 12:17:46 +0000 (12:17 +0000)]
[X86][SSE] Use llvm min/max intrinsics instead of (deprecated) sse intrinsics. NFCI.
These are auto-upgraded to the equivalent llvm variants now.
Simon Pilgrim [Sat, 20 Feb 2021 12:16:54 +0000 (12:16 +0000)]
[X86][SSE] vector-compare-combines.ll - use llvm min/max intrinsics instead of (deprecated) sse intrinsics. NFCI.
These are auto-upgraded to the equivalent llvm variants now.
Simon Pilgrim [Sat, 20 Feb 2021 12:13:06 +0000 (12:13 +0000)]
[X86][AVX] Remove AVX2 min/max intrinsics tests
These are now autoupgraded to the llvm equivalents and the tests already moved avx2-intrinsics-x86-upgrade.ll
Simon Pilgrim [Sat, 20 Feb 2021 12:11:50 +0000 (12:11 +0000)]
[X86][SSE] Remove SSE41 min/max intrinsics tests
These are now autoupgraded to the llvm equivalents and the tests already moved sse41-intrinsics-x86-upgrade.ll
Simon Pilgrim [Sat, 20 Feb 2021 12:10:58 +0000 (12:10 +0000)]
[X86][SSE2] Remove SSE2 min/max intrinsics tests
These are now autoupgraded to the llvm equivalents and the tests already moved sse2-intrinsics-x86-upgrade.ll
Simon Pilgrim [Sat, 20 Feb 2021 12:07:02 +0000 (12:07 +0000)]
[X86] KnownBits - use llvm min/max intrinsics instead of (deprecated) sse intrinsics. NFCI.
These are auto-upgraded to the equivalent llvm variants now.
Simon Pilgrim [Fri, 19 Feb 2021 18:56:20 +0000 (18:56 +0000)]
[DAG] foldSubToUSubSat - fold sub(a,trunc(umin(zext(a),b))) -> usubsat(a,trunc(umin(b,SatLimit)))
This moves the last custom x86 USUBSAT fold to generic DAGCombine.
Completes PR40111
Differential Revision: https://reviews.llvm.org/D96703
Nikita Popov [Wed, 23 Sep 2020 18:43:59 +0000 (20:43 +0200)]
[ConstantRangeTest] Make exhaustive testing more principled (NFC)
The current infrastructure for exhaustive ConstantRange testing is
somewhat confusing in what exactly it tests and currently cannot even
be used for operations that produce smallest-size results, rather than
signed/unsigned envelopes.
This patch makes the testing more principled by collecting the exact
set of results of an operation into a bit set and then comparing it
against the range approximation by:
* Checking conservative correctness: All elements in the set must be
in the range.
* Checking optimality under a given preference function: None of the
(slack-free) ranges that can be constructed from the set are
preferred over the computed range.
Implemented preference functions are:
* PreferSmallest: Smallest range regardless of signed/unsigned wrapping
behavior. Probably what we would call "optimal" without further
qualification.
* PreferSmallestUnsigned/Signed: Smallest range that has no
unsigned/signed wrapping. We use this if our calculation is precise
only up to signed/unsigned envelope.
* PreferSmallestNonFullUnsigned/Signed: Smallest range that has no
unsigned/signed wrapping -- but preferring a smaller wrapping range
over a (non-wrapping) full range. We use this if we have a fully
precise calculation but apply a sign preference to the result
(union/intersection). Even with a sign preference, returning a
wrapping range is still "strictly better" than returning a full one.
This also addresses PR49273 by replacing the fragile manual range
construction logic in testBinarySetOperationExhaustive() with generic
code that isn't specialized to the particular form of ranges that set
operations can produces.
Differential Revision: https://reviews.llvm.org/D88356
Luís Marques [Sat, 20 Feb 2021 10:54:00 +0000 (10:54 +0000)]
[Sanitizers][NFC] Fix typo
David Zarzycki [Tue, 16 Feb 2021 11:16:10 +0000 (06:16 -0500)]
[lit] Add --xfail and --filter-out (inverse of --filter)
In semi-automated environments, XFAILing or filtering out known regressions without actually committing changes or temporarily modifying the test suite can be quite useful.
Reviewed By: yln
Differential Revision: https://reviews.llvm.org/D96662
Juneyoung Lee [Sat, 20 Feb 2021 09:22:38 +0000 (18:22 +0900)]
Update BPFAdjustOpt.cpp to accept select form of or as well
This is a minor pattern-match update to BPFAdjustOpt.cpp to accept
not only 'or i1 a, b' but also 'select i1 a, i1 true, i1 b'.
This resolves regression after SimplifyCFG's creating select form
of and/or instead (https://reviews.llvm.org/D95026).
This is a small change, and currently such select form isn't created
or doesn't reach to the late pipeline (because InstCombine eagerly
folds it into and/or i1), so I chose to commit without a review process.
Amara Emerson [Sat, 20 Feb 2021 08:38:17 +0000 (00:38 -0800)]
[AArch64][GlobalISel] Add selection support for G_VECREDUCE of <2 x i32>
This selects to a pairwise add and a subreg copy.
Martin Storsjö [Fri, 19 Feb 2021 21:10:11 +0000 (23:10 +0200)]
[libcxx] [test] Remove two unnecesary files/variables in a test
These don't seem to have any function in the test.
The non_regular_file one seems to have been added in
0f8c8f59df057a85d6d49913ec9877c6d597785b, without any apparent
purpose there.
Differential Revision: https://reviews.llvm.org/D97083
Martin Storsjö [Fri, 8 Jan 2021 22:20:35 +0000 (00:20 +0200)]
[libcxx] Rename a method in PathParser for clarity. NFC.
Differential Revision: https://reviews.llvm.org/D97081
Mark de Wever [Sat, 20 Feb 2021 08:13:16 +0000 (09:13 +0100)]
[libc++] Fixes _LIBCPP_HAS_NO_CONCEPTS
Before the define was in a GCC specific part. Now it's available for all
compilers. The patch had its CI run in D93593.
Juneyoung Lee [Sat, 20 Feb 2021 07:59:52 +0000 (16:59 +0900)]
[InstCombine] Add more tests to nonnull-select.ll (NFC)
Kazu Hirata [Sat, 20 Feb 2021 06:44:14 +0000 (22:44 -0800)]
[CodeGen] Use range-based for loops (NFC)
Kazu Hirata [Sat, 20 Feb 2021 06:44:12 +0000 (22:44 -0800)]
[TableGen] Use ListSeparator (NFC)
Dávid Bolvanský [Sat, 20 Feb 2021 06:11:42 +0000 (07:11 +0100)]
Fixed failing test
Dávid Bolvanský [Sat, 20 Feb 2021 05:57:47 +0000 (06:57 +0100)]
Reduce the number of attributes attached to each function
This takes advantage of the implicit default behavior to reduce the number of
attributes.
Dávid Bolvanský [Sat, 20 Feb 2021 03:19:03 +0000 (04:19 +0100)]
Reland "[Libcalls, Attrs] Annotate libcalls with noundef"
Fixed Clang tests.
Juneyoung Lee [Thu, 18 Feb 2021 03:38:40 +0000 (12:38 +0900)]
[ValueTracking] Improve impliesPoison
This patch improves ValueTracking's impliesPoison(V1, V2) to do this reasoning:
```
%res = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %a, i64 %b)
%overflow = extractvalue { i64, i1 } %res, 1
%mul = extractvalue { i64, i1 } %res, 0
; If %mul is poison, %overflow is also poison, and vice versa.
```
This improvement leads to supporting this optimization under `-instcombine-unsafe-select-transform=0`:
```
define i1 @test2_logical(i64 %a, i64 %b, i64* %ptr) {
; CHECK-LABEL: @test2_logical(
; CHECK-NEXT: [[MUL:%.*]] = mul i64 [[A:%.*]], [[B:%.*]]
; CHECK-NEXT: [[TMP1:%.*]] = icmp ne i64 [[A]], 0
; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i64 [[B]], 0
; CHECK-NEXT: [[OVERFLOW_1:%.*]] = and i1 [[TMP1]], [[TMP2]]
; CHECK-NEXT: [[NEG:%.*]] = sub i64 0, [[MUL]]
; CHECK-NEXT: store i64 [[NEG]], i64* [[PTR:%.*]], align 8
; CHECK-NEXT: ret i1 [[OVERFLOW_1]]
;
%res = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %a, i64 %b)
%overflow = extractvalue { i64, i1 } %res, 1
%mul = extractvalue { i64, i1 } %res, 0
%cmp = icmp ne i64 %mul, 0
%overflow.1 = select i1 %overflow, i1 true, i1 %cmp
%neg = sub i64 0, %mul
store i64 %neg, i64* %ptr, align 8
ret i1 %overflow.1
}
```
Previously, this didn't happen because the flag prevented `select i1 %overflow, i1 true, i1 %cmp` from being `or i1 %overflow, %cmp`.
Note that the select -> or conversion happens only when `impliesPoison(%cmp, %overflow)` returns true.
This improvement allows `impliesPoison` to do the reasoning.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D96929
Aart Bik [Sat, 20 Feb 2021 01:58:08 +0000 (17:58 -0800)]
[mlir][sparse] convert function pass to module pass
Rationale:
Touching function level information can only be done within a module pass.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D97102
Wenlei He [Fri, 19 Feb 2021 04:11:58 +0000 (20:11 -0800)]
[SampleFDO] Skip PreLink ICP for better profile quality of MonoLTO PostLink
For ThinLTO, PreLink ICP is skipped to favor better profile annotation during LTO PostLink. This change applies the same tweak for MonoLTO. Note that PreLink ICP not only makes PostLink profile annotation harder, it is also uncoordinated with PostLink ICP so duplicated ICP could happen.
Differential Revision: https://reviews.llvm.org/D97028
Dávid Bolvanský [Sat, 20 Feb 2021 03:17:44 +0000 (04:17 +0100)]
Revert "[Libcalls, Attrs] Annotate libcalls with noundef"
This reverts commit
33b0c63775ce58014c55e285671e3315104a6076. Bots are failing. Some Clang tests need to be updated too.
Craig Topper [Sat, 20 Feb 2021 02:56:08 +0000 (18:56 -0800)]
[RISCV] Teach our custom vector load/store intrinsic isel code to propagate memory operands if we have them.
We don't currently create memory operands for these intrinsics,
but there was a suggestion of using the indexed load/store
intrinsics to implement isel for scalable vector gather/scatter.
That may propagate the memory operand from the gather/scatter
ISD nodes.
Dávid Bolvanský [Sat, 20 Feb 2021 03:08:50 +0000 (04:08 +0100)]
[Libcalls, Attrs] Annotate libcalls with noundef
I think we can use here same logic as for nonnull.
strlen(X) - X must be noundef => valid pointer.
for libcalls with size arg, we add noundef only if size is known and greater than 0 - so pointers must be noundef (valid ones)
Reviewed By: jdoerfert, aqjune
Differential Revision: https://reviews.llvm.org/D95122
Dávid Bolvanský [Sat, 20 Feb 2021 02:58:53 +0000 (03:58 +0100)]
Revert "[BuildLibcalls] Mark some libcalls with inaccessiblememonly and inaccessiblemem_or_argmemonly"
This reverts commit
05d891a19e45687090edcfccfbad334911659eb0.
Dávid Bolvanský [Wed, 20 Jan 2021 00:27:25 +0000 (01:27 +0100)]
[BuildLibcalls] Mark some libcalls with inaccessiblememonly and inaccessiblemem_or_argmemonly
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D94850
Pan, Tao [Sat, 20 Feb 2021 02:15:06 +0000 (10:15 +0800)]
[CodeGen] Fix two dots between text section name and symbol name
There is a trailing dot in text section name if it has prefix, don't add
repeated dot when connect text section name and symbol name.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D96327
Vitaly Buka [Sat, 20 Feb 2021 00:04:49 +0000 (16:04 -0800)]
Revert "Implement -bundle_loader"
D95913 passes null pointer into memcpy
This reverts commit
1a0afcf518717f61d45a1cdc6ad1a6436ec663b1.
Craig Topper [Sat, 20 Feb 2021 01:19:25 +0000 (17:19 -0800)]
[ValueTypes] Assert if changeVectorElementType is called on a simple type with an extended element type.
Previously we would use the extended implementation, but
the extended implementation requires the vector type to be extended
so that we can access the LLVMContext. In theory we could
detect this case and use the context from the element type instead,
but since I know of no cases hitting this in practice today
I've done the simplest thing.
Also add asserts to several extended EVT functions that assume
LLVMTy is non-null.
Follow from discussion in D97036
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D97070
Jianzhou Zhao [Fri, 19 Feb 2021 21:32:37 +0000 (21:32 +0000)]
[dfsan] Add utils that get/set origins
This is a part of https://reviews.llvm.org/D95835.
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D97087
Jacques Pienaar [Sat, 20 Feb 2021 00:41:00 +0000 (16:41 -0800)]
Different fix for gcc bug
Was still running into
from definition of 'template<class T> struct llvm::DenseMapInfo'
[-fpermissive]
template <typename T> struct DenseMapInfo;
^
Eric Schweitz [Fri, 19 Feb 2021 19:05:41 +0000 (11:05 -0800)]
[flang][fir] Update flang test tool support classes.
This updates the various classes that support the compliation of
Fortran. These classes are shared by the test tools.
Authors: Eric Schweitz, Sameeran Joshi, et.al.
Differential Revision: https://reviews.llvm.org/D97073
Mehdi Amini [Fri, 19 Feb 2021 23:53:13 +0000 (23:53 +0000)]
Revert "Revert "Fix MLIR Toy tutorial JIT example and add a test to cover it""
This reverts commit
f36060417ad3e247900dfcb07a2476a9d92ee2d2 and
reapply commit
ae15b1e7ad71e4bfde1b031dd5e6b0bbb3b88a42.
JIT test must be annotated to not run on Windows.
Yusra Syeda [Fri, 19 Feb 2021 22:44:10 +0000 (17:44 -0500)]
[SystemZ/z/OS] Add XPLINK 64-bit calling convention to tablegen.
This commit adds the initial changes to the SystemZ target
description for the XPLINK 64-bit calling convention on z/OS.
Additions include:
- a new predicate IsTargetXPLINK64
- different register allocation order
- generaton of nopr after a call
Reviewed-by: uweigand
Differential Revision: https://reviews.llvm.org/D96887
Petr Hosek [Thu, 18 Feb 2021 23:01:05 +0000 (15:01 -0800)]
[Coverage] Normalize compilation dir as well
This matches debug info behavior.
Differential Revision: https://reviews.llvm.org/D97001
zoecarver [Fri, 19 Feb 2021 23:12:19 +0000 (15:12 -0800)]
[libc++][nfc] Only test if pair is_assignable after C++03.
In C++03 libc++ uses a different set of constructors which aren't
constrained, so these tests won't work. This should fix the bots.
Refs: 82c4701.
Martin Storsjö [Wed, 4 Nov 2020 22:13:22 +0000 (00:13 +0200)]
[libcxx] Enable filesystem by default for mingw targets
This feature can be built successfully for windows now. However,
the helper functions for __int128_t aren't available in MSVC
configurations, so don't enable it by default there yet. (See
https://reviews.llvm.org/D91139 for discussion on how to proceed
with things in MSVC environments.)
Differential Revision: https://reviews.llvm.org/D97075
Philip Reames [Fri, 19 Feb 2021 22:51:53 +0000 (14:51 -0800)]
[ValueTracking] Add a two argument form of safeCtxI [NFC]
The existing implementation was relying on order of evaluation to achieve a particular result. This got really confusing when wanting to change the handling for arguments in a later patch.
Christopher Tetreault [Fri, 19 Feb 2021 22:46:36 +0000 (14:46 -0800)]
[AArch64] Adding Neon Polynomial vadd Intrinsics
This patch adds the following intrinsics:
vadd_p8
vadd_p16
vadd_p64
vaddq_p8
vaddq_p16
vaddq_p64
vaddq_p128
Reviewed By: t.p.northover, DavidSpickett, ctetreau
Differential Revision: https://reviews.llvm.org/D96825
Amara Emerson [Fri, 19 Feb 2021 22:27:08 +0000 (14:27 -0800)]
[AArch64][GlobalISel] Make G_VECREDUCE_ADD of <2 x s32> legal.
Stella Stamenova [Fri, 19 Feb 2021 21:38:43 +0000 (13:38 -0800)]
Revert "Fix MLIR Toy tutorial JIT example and add a test to cover it"
This reverts commit
ae15b1e7ad71e4bfde1b031dd5e6b0bbb3b88a42.
This commit caused failures on the mlir windows buildbot
Jianzhou Zhao [Fri, 19 Feb 2021 17:50:02 +0000 (17:50 +0000)]
[dfsan] Add origin address calculation
This is a part of https://reviews.llvm.org/D95835.
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D97065
zoecarver [Fri, 19 Feb 2021 21:24:30 +0000 (13:24 -0800)]
[libc++][nfc] SFINAE on pair/tuple assignment operators: LWG 2729.
This patch ensures that SFINAE is used to delete assignment operators in pair and tuple based on issue 2729.
Differential Review: https://reviews.llvm.org/D62454
Craig Topper [Fri, 19 Feb 2021 21:23:08 +0000 (13:23 -0800)]
[RISCV] Remove VPatILoad and VPatIStore multiclasses that are no longer used. NFC
Philip Reames [Fri, 19 Feb 2021 21:09:34 +0000 (13:09 -0800)]
Add datalayout to test added in
7e3183d73
Realized after pushing this would probably fail on bots for other than x86-64.
Dave Lee [Wed, 17 Feb 2021 23:09:50 +0000 (15:09 -0800)]
[lldb] Rename {stop,run}_vote to report_{stop,run}_vote
Rename `stop_vote` and `run_vote` to `report_stop_vote` and `report_run_vote`
respectively. These variables are limited to logic involving (event) reporting only.
This naming is intended to make their context more clear.
Differential Revision: https://reviews.llvm.org/D96917
Philip Reames [Fri, 19 Feb 2021 21:03:31 +0000 (13:03 -0800)]
Add test triggered by review discussion on D97077
Tim Shen [Fri, 19 Feb 2021 20:19:34 +0000 (12:19 -0800)]
Patch by @wecing (Chenguang Wang).
The current getFoldedSizeOf() implementation uses naive recursion, which
could be really slow when the input structure type is too complex.
This issue was first brought up in
http://llvm.org/bugs/show_bug.cgi?id=8281; this change fixes it by
adding memoization.
Differential Revision: https://reviews.llvm.org/D6594