Fangrui Song [Wed, 18 Dec 2019 00:45:04 +0000 (16:45 -0800)]
[ELF][PPC64] Improve "call lacks nop" diagnostic and make it compatible with GCC<5.5 and GCC<6.4
GCC before r245813 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79439)
did not emit nop after b/bl. This can happen with recursive calls.
r245813 was back ported to GCC 5.5 and GCC 6.4.
This is common, for example, libstdc++.a(locale.o) shipped with GCC 4.9
and many objects in netlib lapack can cause lld to error. gold allows
such calls to the same section. Our __plt_foo symbol's `section` field
is used for ThunkSection, so we can't implement a similar loosen rule
easily. But we can make use of its `file` field which is currently NULL.
Differential Revision: https://reviews.llvm.org/D71639
Fangrui Song [Tue, 17 Dec 2019 19:23:37 +0000 (11:23 -0800)]
[ELF][PPC32] Implement IPLT code sequence for non-preemptible IFUNC
Similar to D71509 (EM_PPC64), on EM_PPC, the IPLT code sequence should
be similar to a PLT call stub. Unlike EM_PPC64, EM_PPC -msecure-plt has
small/large PIC model differences.
* -fpic/-fpie: R_PPC_PLTREL24 r_addend=0. The call stub loads an address relative to `_GLOBAL_OFFSET_TABLE_`.
* -fPIC/-fPIE: R_PPC_PLTREL24 r_addend=0x8000. (A partial linked object
file may have an addend larger than 0x8000.) The call stub loads an address relative to .got2+0x8000.
Just assume large PIC model for now. This patch makes:
// clang -fuse-ld=lld -msecure-plt -fno-pie -no-pie a.c
// clang -fuse-ld=lld -msecure-plt -fPIE -pie a.c
#include <stdio.h>
static void impl(void) { puts("meow"); }
void thefunc(void) __attribute__((ifunc("resolver")));
void *resolver(void) { return &impl; }
int main(void) {
thefunc();
void (*theptr)(void) = &thefunc;
theptr();
}
work on Linux glibc. -fpie will crash because the compiler and the
linker do not agree on the value which r30 stores (_GLOBAL_OFFSET_TABLE_
vs .got2+0x8000).
Differential Revision: https://reviews.llvm.org/D71621
Fangrui Song [Sat, 14 Dec 2019 02:30:21 +0000 (18:30 -0800)]
[ELF][PPC64] Implement IPLT code sequence for non-preemptible IFUNC
Non-preemptible IFUNC are placed in in.iplt (.glink on EM_PPC64). If
there is a non-GOT non-PLT relocation, for pointer equality, we change
the type of the symbol from STT_IFUNC and STT_FUNC and bind it to the
.glink entry.
On EM_386, EM_X86_64, EM_ARM, and EM_AARCH64, the PLT code sequence
loads the address from its associated .got.plt slot. An IPLT also has an
associated .got.plt slot and can use the same code sequence.
On EM_PPC64, the PLT code sequence is actually a bl instruction in
.glink . It jumps to `__glink_PLTresolve` (the PLT header). and
`__glink_PLTresolve` computes the .plt slot (relocated by
R_PPC64_JUMP_SLOT).
An IPLT does not have an associated R_PPC64_JUMP_SLOT, so we cannot use
`bl` in .iplt . Instead, create a call stub which has a similar code
sequence as PPC64PltCallStub. We don't save the TOC pointer, so such
scenarios will not work: a function pointer to a non-preemptible ifunc,
which resolves to a function defined in another DSO. This is the
restriction described by https://sourceware.org/glibc/wiki/GNU_IFUNC
(though on many architectures it works in practice):
Requirement (a): Resolver must be defined in the same translation unit as the implementations.
If an ifunc is taken address but not called, technically we don't need
an entry for it, but we currently do that.
This patch makes
// clang -fuse-ld=lld -fno-pie -no-pie a.c
// clang -fuse-ld=lld -fPIE -pie a.c
#include <stdio.h>
static void impl(void) { puts("meow"); }
void thefunc(void) __attribute__((ifunc("resolver")));
void *resolver(void) { return &impl; }
int main(void) {
thefunc();
void (*theptr)(void) = &thefunc;
theptr();
}
work on Linux glibc and FreeBSD. Calling a function pointer pointing to
a Non-preemptible IFUNC never worked before.
Differential Revision: https://reviews.llvm.org/D71509
Fangrui Song [Mon, 30 Dec 2019 04:17:31 +0000 (20:17 -0800)]
[SelectionDAT] Simplify SelectionDAGBuilder::visitInlineAsm
Indirect C_Immediate or C_Other constraints have been excluded.
Also simplify an unneeded change to indirect 'X' by D60942.
Vladimir Vereschaka [Tue, 17 Dec 2019 20:44:26 +0000 (12:44 -0800)]
[CMake] Added remote test execution support into CrossWinToARMLinux CMake cache file.
Added two confguration argument to provide a host name and SSH user name
to run the tests on the remote target host.
* REMOTE_TEST_HOST - remote host name or address.
* REMOTE_TEST_USER - passwordless SSH account name.
Differential Revision: https://reviews.llvm.org/D71625
QingShan Zhang [Mon, 30 Dec 2019 03:18:31 +0000 (03:18 +0000)]
[PowerPC] Exploit the rlwinm instructions for "and" with constant
For now, PowerPC will using several instructions to get the constant and "and" it with the following case:
define i32 @test1(i32 %a) {
%and = and i32 %a, -2
ret i32 %and
}
However, we could exploit it with the rotate mask instructions.
MB ME
+----------------------+
|xxxxxxxxxxx00011111000|
+----------------------+
0 32 64
Notice that, we can only do it if the MB is larger than 32 and MB <= ME as
RLWINM will replace the content of [0 - 32) with [32 - 64) even we didn't rotate it.
Differential Revision: https://reviews.llvm.org/D71829
Craig Topper [Mon, 30 Dec 2019 00:41:28 +0000 (16:41 -0800)]
[X86] Use APInt::isOneValue and ConstantSDNode::isOne. NFC
These are implemented slightly more efficiently than comparing
to 1 in the case that the value is more than 64 bits.
Craig Topper [Mon, 30 Dec 2019 00:22:10 +0000 (16:22 -0800)]
[X86] Use isOneConstant to simplify some code. NFC
Craig Topper [Mon, 30 Dec 2019 00:19:32 +0000 (16:19 -0800)]
[X86] Remove dyn_casts to ConstantSDNode for operand 1 of X86ISD::VSRLI/VSRAI/VSRLI. Use getConstantOperandVal and APInt operations.
These nodes should only ever be formed with an i8 TargetConstant
so we don't need to check for it to be a constant. It's also
always 8-bits so we don't need to use APInt compare functions.
Fangrui Song [Sun, 29 Dec 2019 23:53:46 +0000 (15:53 -0800)]
[SelectionDAG] Disallow indirect "i" constraint
This allows us to delete InlineAsm::Constraint_i workarounds in
SelectionDAGISel::SelectInlineAsmMemoryOperand overrides and
TargetLowering::getInlineAsmMemConstraint overrides.
They were introduced to X86 in r237517 to prevent crashes for
constraints like "=*imr". They were later copied to other targets.
Raphael Isemann [Sun, 29 Dec 2019 22:01:53 +0000 (23:01 +0100)]
[lldb][NFC] Simplify ClangASTContext::GetTypeForDecl
Also removes the GetASTContext call from this code.
Raphael Isemann [Sun, 29 Dec 2019 20:28:31 +0000 (21:28 +0100)]
[lldb][NFC] Make integer types functions in ClangASTContext not static
These functions need a ClangASTContext instance that we would otherwise
recalculate by calling GetASTContext (which is no longer necessary with
this patch).
Stephen Kelly [Sun, 29 Dec 2019 19:41:07 +0000 (19:41 +0000)]
Fix formatting in previous commits
Raphael Isemann [Sun, 29 Dec 2019 19:10:29 +0000 (20:10 +0100)]
[lldb][NFC] Delete static versions of ClangASTContext::CreateFunctionType
We can always call the member function version of this function.
Craig Topper [Sun, 29 Dec 2019 19:11:26 +0000 (11:11 -0800)]
[X86] Make the AVX1 check lines in vec-strict-inttofp-256.ll test 'avx' instead of 'avx2'. Add AVX2 checks. NFC
Kern Handa [Sun, 29 Dec 2019 17:04:09 +0000 (18:04 +0100)]
[mlir] Update mlir/CMakeLists.txt to install *.td files
Currently when you build the `install` target, TableGen files don't get
installed.
TableGen files are needed when authoring new MLIR dialects, but right
now they're missing when using the pre-built binaries.
Differential Revision: https://reviews.llvm.org/D71958
Raphael Isemann [Sat, 28 Dec 2019 22:37:53 +0000 (23:37 +0100)]
[lldb][NFC] Remove most GetASTContext calls in AST metadata code
Stephen Kelly [Sun, 29 Dec 2019 14:51:22 +0000 (14:51 +0000)]
Fix use of named values surrounded by newlines in clang-query
Stephen Kelly [Sun, 29 Dec 2019 14:48:47 +0000 (14:48 +0000)]
Fix newline handling in clang-query parser
Don't prematurely remove characters from the end of the string
Stephen Kelly [Sun, 29 Dec 2019 14:38:33 +0000 (14:38 +0000)]
Fix handling of newlines in clang-query
Replace assert with diagnostic for missing newline.
Hideto Ueno [Sun, 29 Dec 2019 08:34:08 +0000 (17:34 +0900)]
[Attributor] AAUndefinedBehavior: Check for branches on undef value.
A branch is considered UB if it depends on an undefined / uninitialized value.
At this point this handles simple UB branches in the form: `br i1 undef, ...`
We query `AAValueSimplify` to get a value for the branch condition, so the branch
can be more complicated than just: `br i1 undef, ...`.
Patch By: Stefanos Baziotis (@baziotis)
Reviewers: jdoerfert, sstefan1, uenoku
Reviewed By: uenoku
Differential Revision: https://reviews.llvm.org/D71799
Craig Topper [Sun, 29 Dec 2019 07:09:48 +0000 (23:09 -0800)]
[X86] Stop accidentally custom type legalizing v4i32->v4f32 on SSE1 only targets.
We had a Custom operation action for v4i32 on SSE1. But since
v4i32 isn't legal until SSE2 this was not what was intended. The
code that get executed was intended for op legalization and
creates a bunch of v4i32 nodes that all end up scalarized.
Gil Rapaport [Sat, 28 Dec 2019 17:59:31 +0000 (19:59 +0200)]
[LV] Use getMask() when printing recipe [NFCI]
Use dedicated API for getting the mask instead of duplicating it.
Differential Revision: https://reviews.llvm.org/D71964
Craig Topper [Sun, 29 Dec 2019 05:49:16 +0000 (21:49 -0800)]
[X86] Remove a redundant (scalar_to_vector (extract_vector_elt X))) in LowerUINT_TO_FP_i32. NFCI
Fangrui Song [Sun, 29 Dec 2019 01:25:12 +0000 (17:25 -0800)]
[X86] Fix -enable-machine-outliner for x86-32 after D48683
D48683 accidentally disabled -enable-machine-outliner for x86-32.
Tung Le Duc [Tue, 24 Dec 2019 07:02:10 +0000 (16:02 +0900)]
[mlir] Fix the wrong computation of dynamic strides for lowering AllocOp to LLVM
Leftover change from before the MLIR merge, reviewed at accepted at
https://github.com/tensorflow/mlir/pull/338.
Martin Storsjö [Sat, 28 Dec 2019 21:38:41 +0000 (23:38 +0200)]
Revert "[COFF] Make the autogenerated .weak.<name>.default symbols static"
This reverts commit
7ca86ee6494d4307333b300bae80e42df4a5140f.
Apparently this change causes MS link.exe to error out with
"LNK1235: corrupt or invalid COFF symbol table".
Raphael Isemann [Sat, 28 Dec 2019 21:00:27 +0000 (22:00 +0100)]
[lldb][NFC] Remove GetASTContext call in ClangPersistentVariables
We try to build a CompilerType from the persistent decls so we need
a ClangASTContext. With this patch the ClangPersistentVariables store
the associated ClangASTContext of the persistent decls (which is
always the scratch ClangASTContext) and no longer call GetASTContext
to map back from clang::ASTContext to ClangASTContext.
Zachary Henkel [Sat, 28 Dec 2019 21:06:13 +0000 (13:06 -0800)]
Allow redeclaration of __declspec(uuid)
msvc allows a subsequent declaration of a uuid attribute on a
struct/class. Mirror this behavior in clang-cl.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D71439
Martin Storsjö [Thu, 19 Dec 2019 08:01:40 +0000 (10:01 +0200)]
[COFF] Make the autogenerated .weak.<name>.default symbols static
If we have references to the same extern_weak in multiple objects,
all of them would generate external symbols with the same name. Make
them static to avoid duplicate definitions; nothing should need to
refer to this symbol outside of the current object.
GCC/binutils seems to handle the same by not using a fixed string
for the ".default" suffix, but instead using the name of some other
defined external symbol from the same object (which is supposed to
be unique among objects unless there's other duplicate definitions).
Differential Revision: https://reviews.llvm.org/D71711
Fangrui Song [Sat, 28 Dec 2019 00:01:03 +0000 (16:01 -0800)]
[CMake] Fix lld detection after D69685
D69685 actually broke lld detection for my build (probably due to CMake
processing order).
Before:
```
build projects/compiler-rt/lib/sanitizer_common/tests/Sanitizer-x86_64-Test-Nolibc: ... bin/clang || ...
```
After:
```
build projects/compiler-rt/lib/sanitizer_common/tests/Sanitizer-x86_64-Test-Nolibc: ... bin/clang bin/lld || ...
```
Differential Revision: https://reviews.llvm.org/D71950
Craig Topper [Sat, 28 Dec 2019 19:17:49 +0000 (11:17 -0800)]
[X86] Add test cases for v4i64->v4f32 and v8i64->v8f32 strict_sint_to_fp/strict_uint_to_fp to vec-strict-inttofp-256.ll and vec-strict-inttofp-512.ll. NFC
Nemanja Ivanovic [Sat, 28 Dec 2019 19:07:18 +0000 (13:07 -0600)]
Fix bots after
a9ad65a2b34f
In the last commit, I neglected to initialize the new subtarget feature
I added which caused failures on a few bots. This should fix that.
Nemanja Ivanovic [Sat, 28 Dec 2019 17:20:36 +0000 (11:20 -0600)]
[PowerPC] Change default for unaligned FP access for older subtargets
This is a fix for https://bugs.llvm.org/show_bug.cgi?id=40554
Some CPU's trap to the kernel on unaligned floating point access and there are
kernels that do not handle the interrupt. The program then fails with a SIGBUS
according to the PR. This just switches the default for unaligned access to only
allow it on recent server CPUs that are known to allow this.
Differential revision: https://reviews.llvm.org/D71954
Simon Pilgrim [Sat, 28 Dec 2019 16:41:47 +0000 (16:41 +0000)]
SimplifyDemandedBits - Remove duplicate getOperand() call. NFC.
Pulled out from D56387 - cleanup variable names, move shift amount legalization inside if() of its only user and remove duplicate getOperand() call.
Alexey Bader [Sat, 28 Dec 2019 13:13:33 +0000 (16:13 +0300)]
Fix crash in getFullyQualifiedName for inline namespace
Summary: The ICE happens when the most outer namespace is an inline namespace.
Reviewers: bkramer, ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: ebevhan, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71962
Raphael Isemann [Sat, 28 Dec 2019 13:35:07 +0000 (14:35 +0100)]
[lldb][NFC] Remove GetASTContext call in ClangDeclVendor
Instead of returning NamedDecls and then calling GetASTContext
to find back the ClangASTContext we used can just implement the
FindDecl variant that returns CompilerDecls (and implement the
other function by throwing away the ClangASTContext part of the
compiler decl).
Kang Zhang [Sat, 28 Dec 2019 09:04:54 +0000 (09:04 +0000)]
[PowerPC] Modify the hasSideEffects of some VSX instructions from 1 to 0
Summary:
If we didn't set the value for hasSideEffects bit in our td file, `llvm-tblgen`
will set it as true for those instructions which has no match pattern.
Below 6 instructions don't set the hasSideEffects flag and don't have match
pattern, so their hasSideEffects flag will be set true by llvm-tblgen.
But in fact below instructions don't modify any special register and don't have
other SideEffects, they shouldn't have SideEffects.
This patch is to modify the hasSideEffects of below instructions from 1 to 0.
```
VEXTUHLX
VEXTUHRX
VEXTUWLX
VEXTUWRX
VSPLTBs
VSPLTHs
```
Reviewed By: jsji
Differential Revision: https://reviews.llvm.org/D71391
Craig Topper [Sat, 28 Dec 2019 02:33:16 +0000 (18:33 -0800)]
[TargetLowering] Update comment to reference the correct compiler-rt function the code is based on. NFC
River Riddle [Sat, 28 Dec 2019 04:33:53 +0000 (20:33 -0800)]
[mlir] Merge the successor operand count into BlockOperand.
Summary: The successor operand counts are directly tied to block operands anyways, and this simplifies the trailing objects of Operation(i.e. one less computation to perform).
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D71949
Brian Gesiak [Sat, 28 Dec 2019 02:21:05 +0000 (21:21 -0500)]
[ADT] Fix FoldingSet documentation typos
* "If found then M with be non-NULL" should be "will be non-NULL".
* The documentation examples (1) and (2) declare and use a variable
`MyNode *M`, but examples (3) and (4) switch midway to using a
variable named `N`. Unify the examples to all use `M`.
* The examples demonstrate the use of member functions of
`FoldingSet`, but (3) and (4) invoke these as if they were free
functions. Modify them to call member functions on the `MyFoldingSet`
object constructed in the code above example (1).
Fangrui Song [Sat, 28 Dec 2019 02:07:03 +0000 (18:07 -0800)]
Delete setjmp_undefined_for_msvc workaround after llvm.setjmp was removed
Fangrui Song [Sat, 28 Dec 2019 01:53:16 +0000 (17:53 -0800)]
[Intrinsic] Delete tablegen rules of llvm.{sig,}{setjmp,longjmp}
David Blaikie [Sat, 28 Dec 2019 01:27:20 +0000 (17:27 -0800)]
lld: Remove explicit copy ops from AssociatedIterator, relying on implicit operators
David Blaikie [Sat, 28 Dec 2019 01:18:50 +0000 (17:18 -0800)]
DebugInfo: Fix rangesBaseAddress DICompileUnit bitcode serialization/deserialization
Follow-up to r346788 review feedback from Adrian Prantl.
Matt Arsenault [Sat, 28 Dec 2019 00:35:00 +0000 (19:35 -0500)]
AMDGPU: Adjust test so it will work with GlobalISel
This is mostly a workaround for not handling the mubuf store path yet.
Fangrui Song [Fri, 27 Dec 2019 21:24:41 +0000 (13:24 -0800)]
[ELF] Improve the condition to create .interp
This restores commit
1417558e4a61794347c6bfbafaff7cd96985b2c3 and its follow-up, reverted by commit
c3dbd782f1e0578c7ebc342f2e92f54d9644cff7.
After this commit:
clang -fuse-ld=bfd -no-pie -nostdlib a.c => .interp not created
clang -fuse-ld=bfd -pie -fPIE -nostdlib a.c => .interp created
clang -fuse-ld=gold -no-pie -nostdlib a.c => .interp not created
clang -fuse-ld=gold -pie -fPIE -nostdlib a.c => .interp created
clang -fuse-ld=lld -no-pie -nostdlib a.c => .interp created
clang -fuse-ld=lld -pie -fPIE -nostdlib a.c => .interp created
Fangrui Song [Fri, 27 Dec 2019 23:08:10 +0000 (15:08 -0800)]
[sanitizer] Link Sanitizer-x86_64-Test-Nolibc with -static
Pass -static so that clang will not pass -Wl,--dynamic-linker,... to the
linker. The test is not expected to run under a ld.so. (Technically it
works under a ld.so but glibc expects to see a PT_DYNAMIC. lld
intentionally does not follow GNU ld's complex rules regarding
PT_DYNAMIC.)
This allows commit
1417558e4a61794347c6bfbafaff7cd96985b2c3 to be
relanded.
Matt Arsenault [Fri, 27 Dec 2019 22:41:16 +0000 (17:41 -0500)]
AMDGPU/GlobalISel: Use SReg_32 for readfirstlane constraining
This matches the DAG behavior where we don't use SReg_32_XM0
everywhere anymore, and fixes not coalescing the copies into m0.
Matt Arsenault [Sat, 17 Aug 2019 21:35:47 +0000 (17:35 -0400)]
Hexagon: Fix missing tablegen mode comment
Matt Arsenault [Fri, 27 Dec 2019 20:46:10 +0000 (15:46 -0500)]
TII: Fix using Register for a subregister index argument
Matt Arsenault [Fri, 27 Dec 2019 20:21:44 +0000 (15:21 -0500)]
AMDGPU: Use Register
Lei Zhang [Fri, 27 Dec 2019 21:24:33 +0000 (16:24 -0500)]
[mlir][spirv] Add basic definitions for supporting availability
SPIR-V has a few mechanisms to control op availability: version,
extension, and capabilities. These mechanisms are considered as
different availability classes.
This commit introduces basic definitions for modelling SPIR-V
availability classes. Specifically, an `Availability` class is
added to SPIRVBase.td, along with two subclasses: MinVersion
and MaxVersion for versioning. SPV_Op is extended to take a
list of `Availability`. Each `Availability` instance carries
information for generating op interfaces for the corresponding
availability class and also the concrete availability
requirements.
With the availability spec on ops, we can now auto-generate the
op interfaces of all SPIR-V availability classes and also
synthesize the op's implementations of these interfaces. The
interface generation is done via new TableGen backends
-gen-avail-interface-{decls|defs}. The op's implementation is
done via -gen-spirv-avail-impls.
Differential Revision: https://reviews.llvm.org/D71930
Reid Kleckner [Fri, 27 Dec 2019 21:02:23 +0000 (13:02 -0800)]
Revert "[ELF] Improve the condition to create .interp"
This reverts commit
1417558e4a61794347c6bfbafaff7cd96985b2c3.
Also reverts commit
019a92bb2832447092bb5c1faf9d03bb03b8c9c8.
This causes check-sanitizer to fail. The "-Nolib" variant of the test
crashes on startup in the loader.
Sterling Augustine [Fri, 27 Dec 2019 19:52:12 +0000 (11:52 -0800)]
Support powerpc and sparc when building without init_array.
Summary: Support powerpc and sparc when building without init_array.
Reviewers: rdhindsa, gribozavr
Subscribers: jyknight, nemanjai, fedor.sergeev, jsji, shchenz, steven.zhang, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D71944
Jinsong Ji [Fri, 27 Dec 2019 19:29:13 +0000 (19:29 +0000)]
[PowerPC][LoopVectorize]Add floating point reg usage test
Copied two tests from x86 to test floating point reg usage.
Lei Zhang [Fri, 27 Dec 2019 20:28:45 +0000 (15:28 -0500)]
[mlir][spirv] Update docs regarding how to define new ops and types
This commit expands on the steps of defining a new SPIR-V op and
also provides pointers on how to define a new SPIR-V specific type.
Differential Revision: https://reviews.llvm.org/D71928
David Blaikie [Fri, 27 Dec 2019 20:17:01 +0000 (12:17 -0800)]
Revert "CWG2352: Allow qualification conversions during reference binding."
This reverts commit
de21704ba96fa80d3e9402f12c6505917a3885f4.
Regressed/causes this to error due to ambiguity:
void f(const int * const &);
void f(int *);
int main() {
int * x;
f(x);
}
(in case it's important - the original case where this turned up was a
member function overload in a class template with, essentially:
f(const T1&)
f(T2*)
(where T1 == X const *, T2 == X))
It's not super clear to me if this ^ is expected behavior, in which case
I'm sorry about the revert & happy to look into ways to fix the original
code.
MaheshRavishankar [Thu, 26 Dec 2019 00:29:17 +0000 (16:29 -0800)]
[mlir] Convert std.and/std.or ops to spv.LogicalAnd/spv.LogicalOr
The conversion from std.and/std.or to spv.LogicalAnd/spv.LogicalOr is
only valid for boolean (i1) types. Modify BinaryOpPattern in
StandardToSPIRV.td to allow limiting the type of the operands for
which the pattern is applied.
Differential Revision: https://reviews.llvm.org/D71881
Reid Kleckner [Fri, 27 Dec 2019 19:29:00 +0000 (11:29 -0800)]
Reland "[msan] Intercept qsort, qsort_r."
This reverts commit
8fcce5ac73d49981656d9126e6c88391c1f6bf01.
I spoke too soon, the revert does not actually cause the startup crash
to go away.
Reid Kleckner [Fri, 27 Dec 2019 19:24:07 +0000 (11:24 -0800)]
Revert "[msan] Intercept qsort, qsort_r."
This reverts commit
7a9ebe95125ea87a494d0c18f44f10bd70e12188, and
dependent commit
54c522420347e58aa7bae1892cf5c5672b57c875, which
disables qsort interception for some iOS platforms.
After this change, the -Nolibc sanitizer common test binary crashes on
startup on my regular Linux workstation, as well as on our bots:
https://ci.chromium.org/p/chromium/builders/try/linux_upload_clang/740
********************
Failing Tests (1):
SanitizerCommon-Unit ::
./Sanitizer-x86_64-Test/SanitizerCommon.NolibcMain
Loading it up in gdb shows that it crashes during relocation processing,
which suggests that some glibc loader versions do not support the
THREADLOCAL data added in this interceptor.
Matt Arsenault [Fri, 27 Dec 2019 16:26:24 +0000 (11:26 -0500)]
TailDuplication: Clear NoPHIs property
The early tail duplicator pass introduces new ones, so a MIR test that
infers no phis since there were none on the input would fail the
verifier after running.
Reid Kleckner [Fri, 27 Dec 2019 18:37:07 +0000 (10:37 -0800)]
[VFS] Don't run symlink test on Windows, it may pass or fail
This test was XFAILed because of symlinks, but some versions of ln -s
seem to work on Windows, so the test was unexpectedly passing on our
bot:
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/13233
Unexpected Passing Tests (1):
Clang :: VFS/subframework-symlink.m
I don't know how or why, but it seems dependent on system configuration,
and is not something worth debugging. Avoid the problem by marking the
test UNSUPPORTED: system-windows instead of XFAIL: system-windows.
Kamil Rytarowski [Fri, 27 Dec 2019 00:12:44 +0000 (01:12 +0100)]
[compiler-rt] [netbsd] Add support for versioned statvfs interceptors
Summary:
Add support for NetBSD 9.0 and newer versions of interceptors
operating on struct statvfs: fstatvfs, fstatvfs1, getmntinfo,
getvfsstat, statvfs, statvfs1.
The default promoted interceptors are for NetBSD 9.99.26. Older
ones (currently 9.0) are kept in a new NetBSD specific file:
/sanitizer_common_interceptors_netbsd_compat.inc. This file
defines compat interceptors and mangles `INIT_*` macros,
concatenating the current interceptors and the compat ones.
This redefinition is not elegant, but it avoids preprocessor madness.
Define struct_statvfs90_sz for the compat purposes.
Reviewers: mgorny, kcc, vitalybuka, joerg
Reviewed By: mgorny
Subscribers: dberris, llvm-commits, #sanitizers
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D71700
Florian Hahn [Fri, 27 Dec 2019 17:38:18 +0000 (17:38 +0000)]
[ConstantRange] Respect destination bitwidth for cast results.
We returning a full set, we should use ResultBitWidth. Otherwise we might
it assertions when the resulting constant ranges are used later on.
Reviewers: nikic, spatel, reames
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D71937
Anastasia Stulova [Fri, 27 Dec 2019 17:07:48 +0000 (17:07 +0000)]
[OpenCL] Fixed printing of __private in AMDGPU test
Tags: #clang
Yaxun (Sam) Liu [Thu, 19 Dec 2019 20:27:02 +0000 (15:27 -0500)]
[OpenCL] Fix inconsistency between opencl and c11 atomic fetch max/min
There is some inconsistency between opencl and c11 atomic fetch max/min after
https://reviews.llvm.org/D46386
https://reviews.llvm.org/D55562
It is not reasonable to have such inconsistencies. This patch fixes that.
Differential Revision: https://reviews.llvm.org/D71725
Florian Hahn [Fri, 27 Dec 2019 15:44:00 +0000 (15:44 +0000)]
[Matrix] Propagate and use shape info for binary operators.
This patch extends the current shape propagation and shape aware
lowering to also support binary operators. Those operators are uniform
with respect to their shape (shape of the input operands is the same as
the shape of their result).
Reviewers: anemet, Gerolf, reames, hfinkel, andrew.w.kaylor
Reviewed By: anemet
Differential Revision: https://reviews.llvm.org/D70898
Stephen Kelly [Wed, 18 Dec 2019 22:35:46 +0000 (22:35 +0000)]
Allow newlines in AST Matchers in clang-query files
Reviewers: aaron.ballman
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71842
Danilo Carvalho Grael [Fri, 27 Dec 2019 15:05:28 +0000 (10:05 -0500)]
[NFC][DA] Remove duplicate code in checkSrcSubscript and checkDstSubscript
Summary:
[DA] Move common code in checkSrcSubscript and checkDstSubscript to a
new function checkSubscript. This avoids duplicate code and possible
out of sync in the future.
Reviewers: sebpop, jmolloy, reames
Reviewed By: sebpop
Subscribers: bmahjour, hiraditya, llvm-commits, amehsan
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71087
Patch by zhongduo.
protze@itc.rwth-aachen.de [Fri, 27 Dec 2019 13:39:50 +0000 (14:39 +0100)]
[OpenMP] Implementation of OMPT reduction callbacks
Including two tests
These callbacks were added late to the 5.0 specification, an implementation is missing.
Reviewed By: jdoerfert
Differential Review: https://reviews.llvm.org/D70395
Lei Zhang [Fri, 27 Dec 2019 13:34:26 +0000 (08:34 -0500)]
[MLIR][spirv] Fix links in docs after repo migration
Summary:
This commit updates links to SPIR-V dialect code to LLVM monorepo
on GitHub. It also points to the operation doc on mlir.llvm.org.
Reviewers: mravishankar, denis13, ftynse
Reviewed By: ftynse
Subscribers: merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71926
Matt Arsenault [Wed, 25 Dec 2019 12:48:37 +0000 (07:48 -0500)]
AMDGPU/GlobalISel: Fix extra result register in fdiv64 lowering
There ended up being two result registers, which would fail on
select. It was really defing a new temp register in the correct def
position, instead of the correct result register.
Matt Arsenault [Wed, 25 Dec 2019 14:43:02 +0000 (09:43 -0500)]
AMDGPU/GlobalISel: Select some 128-bit load/stores
Matt Arsenault [Fri, 27 Dec 2019 13:28:30 +0000 (08:28 -0500)]
AMDGPU: Use correct DebugLoc
Anastasia Stulova [Fri, 27 Dec 2019 13:38:48 +0000 (13:38 +0000)]
[OpenCL] Pretty print __private addr space
Add printing of __private address space to TypePrinter to allow
it appears in diagnostics and AST dumps as all other language
addr spaces.
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71272
Muhammad Omair Javaid [Fri, 27 Dec 2019 12:01:52 +0000 (17:01 +0500)]
[lldb] Silent random xpass on aarch64-linux buildbot
This patch adds skipif decorator to TestWatchLocationWithWatchSet.py.
Decorator will trigger for aarch64-linux as this test passes randomly
causing buildbot failure.
wyzhao [Mon, 23 Dec 2019 08:11:29 +0000 (16:11 +0800)]
[mlir] fix typo in a comment
Trivial patch, reviewed and accepted on
https://github.com/tensorflow/mlir/pull/336 before MLIR merge.
Uday Bondhugula [Fri, 27 Dec 2019 11:04:09 +0000 (12:04 +0100)]
[MLIR] [NFC] fix unused var warning
Summary:
Fix this warning:
`
[69/106] Building CXX object tools/mlir/lib/Dialect/StandardOps/CMakeFiles/MLIRStandardOps.dir/Ops.cpp.o
/home/uday/llvm-project/mlir/lib/Dialect/StandardOps/Ops.cpp: In member function ‘virtual mlir::PatternMatchResult {anonymous}::ViewOpShapeFolder::matchAndRewrite(mlir::ViewOp, mlir::PatternRewriter&) const’:
/home/uday/llvm-project/mlir/lib/Dialect/StandardOps/Ops.cpp:2575:14: warning: variable ‘dynamicOffsetOperandCount’ set but not used [-Wunused-but-set-variable]
2575 | unsigned dynamicOffsetOperandCount = 0;
`
Reviewers: rriddle, mehdi_amini, ftynse
Reviewed By: ftynse
Subscribers: jpienaar, burmako, shauheen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71922
Alex Zinenko [Fri, 27 Dec 2019 09:54:01 +0000 (10:54 +0100)]
[mlir] Floating constants for import-llvm
Summary:
`mlir-translate -import-llvm test.ll` was going into segmentation fault if `test.ll` had `float` or `double` constants.
For example,
```
%3 = fadd double 3.030000e+01, %0
```
Now, it is handled in `Importer::getConstantAsAttr` (similar behaviour as normal integers)
Added tests for FP arithmetic
Reviewers: ftynse, mehdi_amini
Reviewed By: ftynse, mehdi_amini
Subscribers: shauheen, mehdi_amini, rriddle, jpienaar, burmako, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71912
Ilya Biryukov [Fri, 27 Dec 2019 08:26:39 +0000 (09:26 +0100)]
[clangd] Reformat `HoverTests.cpp` NFC
I accidentally broke formatting in the previous revision.
Craig Topper [Fri, 27 Dec 2019 08:15:45 +0000 (00:15 -0800)]
[X86] Allow v2i32->v2f32 strict and non-strict uint_to_fp to be widened to v4i32->v4f32 under avx512.
With avx512vl we get v4i32->v4f32 uint_to_fp instructions. With
avx512f we get v16i32->v16f32 instructions which we can use to
emulate v4i32->v4f32.
Craig Topper [Fri, 27 Dec 2019 08:13:30 +0000 (00:13 -0800)]
[X86] Add v2i32->v2f32 non-strict sint_to_fp/uint_to_fp tests. NFC
Craig Topper [Fri, 27 Dec 2019 07:57:33 +0000 (23:57 -0800)]
[X86] Custom widen v2i32->v2f32 strict_sint_to_fp to avoid scalarization.
Georgii Rymar [Thu, 26 Dec 2019 11:01:05 +0000 (14:01 +0300)]
[llvm-readobj][llvm-objdump][test] - Improve dynamic section testing.
This adds --strict-whitespace --match-full-lines flags to
improve the testing and reveal formatting issues we have.
Differential revision: https://reviews.llvm.org/D71895
Ilya Biryukov [Fri, 27 Dec 2019 08:11:03 +0000 (09:11 +0100)]
[clangd] Fix crash in hover
Fangrui Song [Fri, 27 Dec 2019 07:32:53 +0000 (23:32 -0800)]
Delete llvm.{sig,}{setjmp,longjmp} remnant after r136821
Intrinsic has incorrect argument type!
i32 (i32*)* @llvm.setjmp
*wipes tear*
Craig Topper [Fri, 27 Dec 2019 05:46:29 +0000 (21:46 -0800)]
[X86] Custom widen 128/256-bit vXi32 fp_to_uint on avx512f targets without avx512vl. Similar for vXi64 on avx512dq without avx512vl.
Summary:
Previously we did this with isel patterns that used garbage in
the widened part of the source. But that's not valid for strictfp.
So now we custom widen and use zeroes for the widened elemens for
strictfp.
This replaces D71864.
Reviewers: RKSimon, spatel, andrew.w.kaylor, pengfei, LiuChen3
Reviewed By: pengfei
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71879
Craig Topper [Fri, 27 Dec 2019 05:25:22 +0000 (21:25 -0800)]
[X86] Custom widen strict v2f32->v2i32 by padding with zeroes.
For non-strict, generic type legalization will take care of this,
but that doesn't happen currently for strict nodes.
Fangrui Song [Fri, 27 Dec 2019 05:40:48 +0000 (21:40 -0800)]
[X86] Fix -Wmisleading-indentation after D71892
Craig Topper [Fri, 27 Dec 2019 04:21:23 +0000 (20:21 -0800)]
[X86][FPEnv] Promote some float strictfp operations to double on i686-pc-windows-msvc to match what we do for non-strict.
The float libcalls are inlined in MSVC's math header where they
just cast to double and use the double libcall. Do the same when
we emit libcalls.
Craig Topper [Fri, 27 Dec 2019 04:09:32 +0000 (20:09 -0800)]
[X86] Add tests for constrained float intrinsics on i686-pc-windows-msvc. NFC
We need to promote these to double due to missing libcalls on
Windows.
Craig Topper [Fri, 27 Dec 2019 01:27:44 +0000 (17:27 -0800)]
[X86] Add custom legalization for strict_uint_to_fp v2i32->v2f32.
I believe the algorithm we use for non-strict is exception safe
for strict. The fsub won't generate any exceptions. After it we
will have an exact version of the i32 integer in a double. Then
we just round it to f32. That rounding will generate a precision
exception if it can't be represented exactly.
Craig Topper [Fri, 27 Dec 2019 00:41:42 +0000 (16:41 -0800)]
[X86] Add test cases for v2i32->v2f32 strict_sint_to_fp/strict_uint_to_fp. NFC
Eric Christopher [Fri, 27 Dec 2019 02:48:59 +0000 (18:48 -0800)]
Add an __attribute__((unused)) to populateWithGenerated since it might
not be used where defined and is autogenerated.
Eric Christopher [Fri, 27 Dec 2019 02:40:20 +0000 (18:40 -0800)]
Temporarily Revert "[compiler-rt] [netbsd] Add support for versioned statvfs interceptors"
as it's failing the netbsd specific linter parts of the sanitizer linter:
llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_netbsd_compat.inc:23: Lines should be <= 80 characters long [whitespace/line_length]
llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp:2450: Do not use variable-length arrays. Use an appropriately named ('k' followed by CamelCase) compile-time constant for the size.
This reverts commit
78f714f824fac8aa3fdd85908c41538bccefb959.
Eric Christopher [Fri, 27 Dec 2019 02:34:41 +0000 (18:34 -0800)]
Fix a -Wcovered-switch-default warning by moving the unreachable out of the
covered switch.
Eric Christopher [Fri, 27 Dec 2019 02:34:14 +0000 (18:34 -0800)]
Remove an unused static function.
Eric Christopher [Fri, 27 Dec 2019 02:29:54 +0000 (18:29 -0800)]
Fix a -Wcovered-switch-default warning by moving the unreachable out of the
covered switch.
Eric Christopher [Fri, 27 Dec 2019 02:19:48 +0000 (18:19 -0800)]
Remove unused static function.