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
Eugene Zhulenev [Fri, 19 Feb 2021 00:24:56 +0000 (16:24 -0800)]
[mlir] Add math polynomial approximation pass
This gives ~30x speedup compared to expanding Tanh into exp operations:
```
name old cpu/op new cpu/op delta
BM_mlir_Tanh_f32/10 253ns ± 3% 55ns ± 7% -78.35% (p=0.000 n=44+41)
BM_mlir_Tanh_f32/100 2.21µs ± 4% 0.14µs ± 8% -93.85% (p=0.000 n=48+49)
BM_mlir_Tanh_f32/1k 22.6µs ± 4% 0.7µs ± 5% -96.68% (p=0.000 n=32+42)
BM_mlir_Tanh_f32/10k 225µs ± 5% 7µs ± 6% -96.88% (p=0.000 n=49+55)
name old time/op new time/op delta
BM_mlir_Tanh_f32/10 259ns ± 1% 56ns ± 2% -78.31% (p=0.000 n=41+39)
BM_mlir_Tanh_f32/100 2.27µs ± 1% 0.14µs ± 5% -93.89% (p=0.000 n=46+49)
BM_mlir_Tanh_f32/1k 22.9µs ± 1% 0.8µs ± 4% -96.67% (p=0.000 n=30+42)
BM_mlir_Tanh_f32/10k 230µs ± 0% 7µs ± 3% -96.88% (p=0.000 n=37+55)
```
This approximations is based on Eigen::generic_fast_tanh function
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D96739
Teresa Johnson [Wed, 17 Feb 2021 03:44:58 +0000 (19:44 -0800)]
[clang] Emit type metadata on available_externally vtables for WPD
When WPD is enabled, via WholeProgramVTables, emit type metadata for
available_externally vtables. Additionally, add the vtables to the
llvm.compiler.used global so that they are not prematurely eliminated
(before *LTO analysis).
This is needed to avoid devirtualizing calls to a function overriding a
class defined in a header file but with a strong definition in a shared
library. Without type metadata on the available_externally vtables from
the header, the WPD analysis never sees what a derived class is
overriding. Even if the available_externally base class functions are
pure virtual, because shared library definitions are already treated
conservatively (committed patches D91583, D96721, and D96722) we will
not devirtualize, which would be unsafe since the library might contain
overrides that aren't visible to the LTO unit.
An example is std::error_category, which is overridden in LLVM
and causing failures after a self build with WPD enabled, because
libstdc++ contains hidden overrides of the virtual base class methods.
Differential Revision: https://reviews.llvm.org/D96919
Jianzhou Zhao [Fri, 19 Feb 2021 04:37:49 +0000 (04:37 +0000)]
[msan] Set cmpxchg shadow precisely
In terms of https://llvm.org/docs/LangRef.html#cmpxchg-instruction,
the return type of chmpxchg is a pair {ty, i1}, while I think we
only wanted to set the shadow for the address 0th op, and it has type
ty.
Reviewed-by: eugenis
Differential Revision: https://reviews.llvm.org/D97029
Philip Reames [Fri, 19 Feb 2021 20:19:31 +0000 (12:19 -0800)]
precommit test cleanup for D97077
Eric Schweitz [Fri, 19 Feb 2021 20:05:26 +0000 (12:05 -0800)]
[flang][fir][NFC] run clang-format
cleanup post-merge
Sanjay Patel [Fri, 19 Feb 2021 19:56:20 +0000 (14:56 -0500)]
[Verifier] remove dead code for saturating intrinsics; NFC
Test coverage shows that we assert with the string from the
tablegen defs file for these intrinsics, so these cases
should never be live.
Sanjay Patel [Fri, 19 Feb 2021 19:48:12 +0000 (14:48 -0500)]
[Verifier] add tests for saturating intrinsics; NFC
As noted in D96904, we don't have direct tests for these malformed ops.
Martin Storsjö [Mon, 9 Nov 2020 09:45:13 +0000 (11:45 +0200)]
[libcxx] Make generic_*string return paths with forward slashes on windows
This matches what MS STL returns; in std::filesystem, forward slashes
are considered generic dir separators that are valid on all platforms.
Differential Revision: https://reviews.llvm.org/D91181
Haowei Wu [Thu, 18 Feb 2021 04:10:44 +0000 (20:10 -0800)]
[elfabi] Fix a bug when .dynsym contains no non-local symbol
This patch fixed a bug when elbabi was supplied with a tbe file
contains no non-local symbol. Before this patch, it wrote 0 to
sh_info of the .dynsym section, making the ELF stub file invalid.
This patch fixed this issue.
Differential Revision: https://reviews.llvm.org/D96930
zoecarver [Fri, 19 Feb 2021 19:10:36 +0000 (11:10 -0800)]
[libcxx] Fix LWG 2875: shared_ptr::shared_ptr(Y*, D, […]) constructors should be constrained.
Fixes LWG issue 2875.
Differential Revision: https://reviews.llvm.org/D81414
Martin Storsjö [Thu, 5 Nov 2020 21:09:15 +0000 (23:09 +0200)]
[libcxx] Have lexically_normal return the path with preferred separators
Differential Revision: https://reviews.llvm.org/D91179
Sanjay Patel [Fri, 19 Feb 2021 14:06:05 +0000 (09:06 -0500)]
[Analysis][LoopVectorize] do not form reductions of pointers
This is a fix for https://llvm.org/PR49215 either before/after
we make a verifier enhancement for vector reductions with D96904.
I'm not sure what the current thinking is for pointer math/logic
in IR. We allow icmp on pointer values. Therefore, we match min/max
patterns, so without this patch, the vectorizer could form a vector
reduction from that sequence.
But the LangRef definitions for min/max and vector reduction
intrinsics do not allow pointer types:
https://llvm.org/docs/LangRef.html#llvm-smax-intrinsic
https://llvm.org/docs/LangRef.html#llvm-vector-reduce-umax-intrinsic
So we would crash/assert at some point - either in IR verification,
in the cost model, or in codegen. If we do want to allow this kind
of transform, we will need to update the LangRef and all of those
parts of the compiler.
Differential Revision: https://reviews.llvm.org/D97047
Michael Kruse [Fri, 19 Feb 2021 18:47:52 +0000 (12:47 -0600)]
[Polly] Fix test after D96534.
Craig Topper [Fri, 19 Feb 2021 18:36:26 +0000 (10:36 -0800)]
[RISCV] Use inheritance to reduce some repeated code in tablegen. NFC
The VLX and VSX searchable tables, share the same format so we
can have a common base class for them.
Simon Pilgrim [Fri, 19 Feb 2021 18:34:57 +0000 (18:34 +0000)]
[X86] Regenerate 2007-06-28-X86-64-isel.ll
Simon Pilgrim [Fri, 19 Feb 2021 18:25:11 +0000 (18:25 +0000)]
[X86] Remove unused intrinsic declaration
Simon Pilgrim [Fri, 19 Feb 2021 18:23:21 +0000 (18:23 +0000)]
[X86] Regenerate 2011-12-06-AVXVectorExtractCombine.ll
Craig Topper [Fri, 19 Feb 2021 18:28:45 +0000 (10:28 -0800)]
[RISCV] Remove unneeded indexed segment load/store vector pseudo instruction.
We had more combinations of data and index lmuls than we needed.
Also add some asserts to verify that the IndexVT and data VT have
the same element count when we isel these pseudo instructions.
Craig Topper [Fri, 19 Feb 2021 18:08:43 +0000 (10:08 -0800)]
[RISCV] Use custom isel for vector indexed load/store intrinsics.
There are many legal combinations of index and data VTs supported
for these intrinsics. This results in a lot of isel patterns in
RISCVGenDAGISel.inc.
By adding a separate table similar to what we use for segment
load/stores, we can more efficiently manually select these
intrinsics. We should also be able to reuse this table scalable
vector gather/scatter.
This reduces the llc binary size by ~56K.
Reviewed By: khchen
Differential Revision: https://reviews.llvm.org/D97033
Craig Topper [Fri, 19 Feb 2021 18:00:13 +0000 (10:00 -0800)]
[RISCV] Prevent selecting a 0 VL to X0 for the segment load/store intrinsics.
Just like we do for isel patterns, we need to call selectVLOp
to prevent 0 from being selected to X0 by the default isel.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D97021
Craig Topper [Fri, 19 Feb 2021 17:55:45 +0000 (09:55 -0800)]
[RISCV] Move SHFLI matching to DAG combine. Add 32-bit support for RV64
We previously used isel patterns for this, but that used quite
a bit of space in the isel table due to OR being associative
and commutative. It also wouldn't handle shifts/ands being in
reversed order.
This generalizes the shift/and matching from GREVI to
take the expected mask table as input so we can reuse it for
SHFLI.
There is no SHFLIW instruction, but we can promote a 32-bit
SHFLI to i64 on RV64. As long as bit 4 of the control bit isn't
set, a 64-bit SHFLI will preserve 33 sign bits if the input had
at least 33 sign bits. ComputeNumSignBits has been updated to
account for that to avoid sext.w in the tests.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D96661
Wei Mi [Fri, 19 Feb 2021 17:57:18 +0000 (09:57 -0800)]
[SampleFDO] Add PromotedInsns to prevent repeated ICP.
In https://reviews.llvm.org/rG5fb65c02ca5e91e7e1a00e0efdb8edc899f3e4b9,
We use 0 count value profile to memorize which target has been promoted
and prevent repeated ICP for the same target, so we delete PromotedInsns.
However, I found the implementation in the patch has some shortcomings
to be fixed otherwise there will still be repeated ICP. So I add
PromotedInsns back temorarily. Will remove it after I get a thorough fix.
Artem Belevich [Fri, 19 Feb 2021 17:32:10 +0000 (09:32 -0800)]
[CUDA] fix builtin constraints for PTX 7.2
This fixes build issues w/ CUDA-11 introduced by https://reviews.llvm.org/D95974
Reviewed By: yaxunl
Differential Revision: https://reviews.llvm.org/D97009
Luís Marques [Fri, 19 Feb 2021 17:46:02 +0000 (17:46 +0000)]
[Sanitizer][NFC] Fix typo
Jessica Paquette [Wed, 17 Feb 2021 23:16:51 +0000 (15:16 -0800)]
[AArch64][GlobalISel] Run redundant_sext_inreg in the post-legalizer combiner
This is to ensure that we can eliminate G_ASSERT_SEXT.
In a follow-up patch, I'm going to make CallLowering emit G_ASSERT_SEXT for
signext parameters.
Differential Revision: https://reviews.llvm.org/D96913
Nicolas Vasilache [Fri, 19 Feb 2021 17:04:12 +0000 (17:04 +0000)]
[mlir] Add folding of tensor.cast -> subtensor_insert
Differential Revision: https://reviews.llvm.org/D97059