Chandler Carruth [Fri, 11 Mar 2016 08:50:55 +0000 (08:50 +0000)]
[PM] Port GVN to the new pass manager, wire it up, and teach a couple of
tests to run GVN in both modes.
This is mostly the boring refactoring just like SROA and other complex
transformation passes. There is some trickiness in that GVN's
ValueNumber class requires hand holding to get to compile cleanly. I'm
open to suggestions about a better pattern there, but I tried several
before settling on this. I was trying to balance my desire to sink as
much implementation detail into the source file as possible without
introducing overly many layers of abstraction.
Much like with SROA, the design of this system is made somewhat more
cumbersome by the need to support both pass managers without duplicating
the significant state and logic of the pass. The same compromise is
struck here.
I've also left a FIXME in a doxygen comment as the GVN pass seems to
have pretty woeful documentation within it. I'd like to submit this with
the FIXME and let those more deeply familiar backfill the information
here now that we have a nice place in an interface to put that kind of
documentaiton.
Differential Revision: http://reviews.llvm.org/D18019
llvm-svn: 263208
Pavel Labath [Fri, 11 Mar 2016 08:44:44 +0000 (08:44 +0000)]
Fix a couple of cornercases in FileSpec + tests
Summary:
This fixes a couple of corner cases in FileSpec, related to AppendPathComponent and
handling of root directory (/) file spec. I add a bunch of unit tests for the new behavior.
Summary of changes:
FileSpec("/bar").GetCString(): before "//bar", after "/bar".
FileSpec("/").CopyByAppendingPathComponent("bar").GetCString(): before "//bar", after "/bar".
FileSpec("C:", ePathSyntaxWindows).CopyByAppendingPathComponent("bar").GetCString(): before "C:/bar", after "C:\bar".
Reviewers: clayborg, zturner
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D18044
llvm-svn: 263207
Matt Arsenault [Fri, 11 Mar 2016 08:20:50 +0000 (08:20 +0000)]
AMDGPU: Don't use InstVisitor for AMDGPUPromoteAlloca
Frontend authors are strongly encouraged to keep allocas
in the entry block, so don't bother visiting every instruction
in the other blocks of the function.
llvm-svn: 263206
Todd Fiala [Fri, 11 Mar 2016 08:12:36 +0000 (08:12 +0000)]
skip newly segfaulting test on OS X public CI
llvm-svn: 263205
Matt Arsenault [Fri, 11 Mar 2016 08:00:27 +0000 (08:00 +0000)]
AMDGPU: R600 code splitting cleanup
Move a few functions only used by R600 to R600 specific code,
fix header macros to stop using R600, mark classes as final.
llvm-svn: 263204
Hrvoje Varga [Fri, 11 Mar 2016 08:00:11 +0000 (08:00 +0000)]
[mips] Invalid tests for MTC0, MTC2, MFC0, MFC2, DMTC0, DMFC0 MIPS instructions
Differential Revision: http://reviews.llvm.org/D18037
llvm-svn: 263203
Dmitry Polukhin [Fri, 11 Mar 2016 07:58:34 +0000 (07:58 +0000)]
[OpenMP] NFC fix compilation warning about unused variable
lib/Sema/SemaOpenMP.cpp:9243:13: warning: variable ‘IsRightMostExpression’ set but not used
llvm-svn: 263202
Matt Arsenault [Fri, 11 Mar 2016 07:42:49 +0000 (07:42 +0000)]
AMDGPU: Materialize sign bits with bfrev
If a constant is the same as the reverse of an inline immediate,
this is 4 bytes smaller than having to embed a 32-bit literal.
llvm-svn: 263201
Junmo Park [Fri, 11 Mar 2016 07:05:32 +0000 (07:05 +0000)]
Minor code cleanups. NFC.
llvm-svn: 263200
Mohit K. Bhakkad [Fri, 11 Mar 2016 05:57:20 +0000 (05:57 +0000)]
[Compiler-rt] Fix ioctl codes for MIPS in sanitizer_ioctl_test
Reviewers: samsonov
Subscribers: jaydeep, sagar, llvm-commits
Differential Revision: http://reviews.llvm.org/D17985
llvm-svn: 263199
Sean Silva [Fri, 11 Mar 2016 05:48:04 +0000 (05:48 +0000)]
Fix indentation.
Somehow this slipped by in r263197. Thanks to Rui for noticing.
llvm-svn: 263198
Sean Silva [Fri, 11 Mar 2016 05:42:34 +0000 (05:42 +0000)]
[lto] The previous testcase was not useful enough.
-shared was hiding the fact that the intrinsic wasn't being found.
llvm-svn: 263197
Junmo Park [Fri, 11 Mar 2016 05:07:07 +0000 (05:07 +0000)]
Minor code cleanup. NFC.
llvm-svn: 263196
Alexey Samsonov [Fri, 11 Mar 2016 05:04:49 +0000 (05:04 +0000)]
Fix ASan test cases after r263177
llvm-svn: 263195
John McCall [Fri, 11 Mar 2016 05:03:01 +0000 (05:03 +0000)]
Removing the friend declaration was not a good idea.
llvm-svn: 263194
John McCall [Fri, 11 Mar 2016 04:55:21 +0000 (04:55 +0000)]
Speculatively attempt to fix the MSVC build by making some
methods non-private.
llvm-svn: 263193
John McCall [Fri, 11 Mar 2016 04:30:43 +0000 (04:30 +0000)]
Add a coerce-and-expand ABIArgInfo as a generalization of some
of the things we do with Expand / Direct.
NFC for now, but this will be used by swiftcall expansion.
llvm-svn: 263192
John McCall [Fri, 11 Mar 2016 04:30:31 +0000 (04:30 +0000)]
Preserve ExtParameterInfos into CGFunctionInfo.
As part of this, make the function-arrangement interfaces
a little simpler and more semantic.
NFC.
llvm-svn: 263191
Rui Ueyama [Fri, 11 Mar 2016 04:23:12 +0000 (04:23 +0000)]
ELF: Add --thread option and partially parallelize writeTo().
This patch adds --thread option and use parallel_for_each to write
sections in regular OutputSections.
This is the first patch to use more than one threads.
Note that --thread is off by default because it is experimental.
At this moment I still want to focus on single thread performance
because multi-threading is not a magic wand to fix performance
problems after all. It is generally very hard to make a slow program
faster by threads. Therefore, I want to make the linker as efficient
as possible first and then look for opportunity to make it even faster
using more than one core.
Here are some numbers to link programs with and without --threads
and using GNU gold. Numbers are in seconds.
Clang
w/o --threads 0.697
w --threads 0.528
gold 1.643
Scylla
w/o --threads 5.032
w --threads 4.935
gold 6.791
GNU gold
w/o --threads 0.550
w --threads 0.551
gold 0.737
I limited the number of cores these processes can use to 4 using
perf command, so although my machine has 20 physical cores, the
performance gain I observed should be reproducible with a machine
which is not as beefy as mine.
llvm-svn: 263190
Pete Cooper [Fri, 11 Mar 2016 02:14:16 +0000 (02:14 +0000)]
Remove llvm::getDISubprogram in favor of Function::getSubprogram
llvm::getDISubprogram walks the instructions in a function, looking for one in the scope of the current function, so that it can find the !dbg entry for the subprogram itself.
Now that !dbg is attached to functions, this should not be necessary. This patch changes all uses to just query the subprogram directly on the function.
Ideally this should be NFC, but in reality its possible that a function:
has no !dbg (in which case there's likely a bug somewhere in an opt pass), or
that none of the instructions had a scope referencing the function, so we used to not find the !dbg on the function but now we will
Reviewed by Duncan Exon Smith.
Differential Revision: http://reviews.llvm.org/D18074
llvm-svn: 263184
Jim Ingham [Fri, 11 Mar 2016 01:57:45 +0000 (01:57 +0000)]
Fix SBDebugger.GetOutputFileHandle() on OS X.
The swig typemaps had some magic for output File *'s on OS X that made:
SBDebugger.GetOutputFileHandle()
actually work. That was protected by a "#ifdef __MACOSX__", but the corresponding define
got lost going from the Darwin shell scripts to the python scripts for running
swig, so the code was elided. I need to pass the define to SWIG, but only when
targetting Darwin.
So I added a target-platform argument to prepare_bindings, and if that
is Darwin, I pass -D__APPLE__ to swig, and that activates this code again, and
GetOutputFileHandle works again. Note, I only pass that argument for the Xcode
build. I'm sure it is possible to do that for cmake, but my cmake-foo is weak.
I should have been able to write a test for this by creating a debugger, setting the
output file handle to something file, writing to it, getting the output file handle
and reading it. But SetOutputFileHandle doesn't seem to work from Python, so I'd
have to write a pexpect test to test this, which I'd rather not do.
llvm-svn: 263183
Sean Silva [Fri, 11 Mar 2016 01:10:37 +0000 (01:10 +0000)]
[lto] Add a useful test case.
This is reduced from an issue found in practice.
The original version of D18012 needed another patch to handle this, but
it now works since we are using a more correct GV->hasAppendingLinkage()
check that Rafael suggested.
This is what remains of that other patch.
llvm-svn: 263181
Evgeniy Stepanov [Fri, 11 Mar 2016 00:51:57 +0000 (00:51 +0000)]
[gold] Fix common symbols handling.
LLVM Gold plugin decides which instance of a common symbol it wants
based on the symbol size in claim_file_hook. If the file that
contains the chosen instance is later dropped from the link, we end
up with an undefined reference.
This change delays this decision until the set of the included files
is known.
llvm-svn: 263180
Sean Silva [Fri, 11 Mar 2016 00:50:05 +0000 (00:50 +0000)]
[lto] Make sure that ctors are added to the combined module.
Summary:
More generally, appending linkage is a special case that we don't want
to create a SymbolBody for.
Reviewers: rafael, ruiu
Subscribers: Bigcheese, llvm-commits, joker.eph
Differential Revision: http://reviews.llvm.org/D18012
llvm-svn: 263179
Sean Silva [Fri, 11 Mar 2016 00:48:36 +0000 (00:48 +0000)]
Tighten up this test a bit.
Thanks to Rafael to spotting this in the post-commit review of r263070.
llvm-svn: 263178
Alexey Samsonov [Fri, 11 Mar 2016 00:45:49 +0000 (00:45 +0000)]
[sanitizer] Add strlen to the common interceptors
Summary:
Adds strlen to the common interceptors, under a new common flag
intercept_strlen. This provides better sharing of interception code among
sanitizers and cleans up the inconsistent type declarations of the
previously duplicated interceptors.
Removes the now-duplicate strlen interceptor from asan, msan, and tsan.
The entry check semantics are normalized now for msan and asan, whose
private strlen interceptors contained multiple layers of checks that
included impossible-to-reach code. The new semantics are identical to the
old: bypass interception if in the middle of init or if both on Mac and not
initialized; else, call the init routine and proceed.
Patch by Derek Bruening!
Reviewers: samsonov, vitalybuka
Subscribers: llvm-commits, kcc, zhaoqin
Differential Revision: http://reviews.llvm.org/D18020
llvm-svn: 263177
Alexey Samsonov [Fri, 11 Mar 2016 00:37:02 +0000 (00:37 +0000)]
[UBSan] Improve bufferization of UBSan error reports.
Summary:
Use InternalScopedString more extensively. This reduces the number of
write() syscalls, and reduces the chance that UBSan output will be
mixed with program output.
Reviewers: vitalybuka
Subscribers: kcc, llvm-commits
Differential Revision: http://reviews.llvm.org/D18068
llvm-svn: 263176
Ekaterina Romanova [Fri, 11 Mar 2016 00:05:54 +0000 (00:05 +0000)]
Add doxygen comments to avxintrin.h's intrinsics.
Only around 25% of the intrinsics in this file are documented here. The patches for the other half will be sent out later.
The doxygen comments are automatically generated based on Sony's intrinsics document.
I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream.
llvm-svn: 263175
Eugene Zelenko [Thu, 10 Mar 2016 23:57:12 +0000 (23:57 +0000)]
Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other minor fixes.
llvm-svn: 263174
Adam Nemet [Thu, 10 Mar 2016 23:54:39 +0000 (23:54 +0000)]
[LLE] Add missed LoopSimplify dependence
The code assumed that we always had a preheader without making the pass
dependent on LoopSimplify.
Thanks to Mattias Eriksson V for reporting this.
llvm-svn: 263173
Manman Ren [Thu, 10 Mar 2016 23:54:12 +0000 (23:54 +0000)]
Print strict in Availability attribute when it is on.
llvm-svn: 263172
Manman Ren [Thu, 10 Mar 2016 23:51:03 +0000 (23:51 +0000)]
Add has_feature objc_class_property.
rdar://
23891898
llvm-svn: 263171
Jonathan Coe [Thu, 10 Mar 2016 23:29:45 +0000 (23:29 +0000)]
libclang python bindings: Fix for bug 26394
Summary:
https://llvm.org/bugs/show_bug.cgi?id=26394 reports that clang's python bindings tests are failing.
I can confirm that the bug exists and that the proposed fix is good.
Differential Revision: http://reviews.llvm.org/D17226
llvm-svn: 263170
Tim Northover [Thu, 10 Mar 2016 23:02:21 +0000 (23:02 +0000)]
AArch64: only try to use scaled fcvt ops on legal vector types.
Before we ended up calling getSimpleVectorType on a <3 x float>, which
asserted.
llvm-svn: 263169
Nico Weber [Thu, 10 Mar 2016 22:40:02 +0000 (22:40 +0000)]
Reenable asm-errors.c
r134811 made the test pass and reenabled it, but r134831
accidentally disabled it again due to a bad merge.
llvm-svn: 263168
Sanjay Patel [Thu, 10 Mar 2016 22:35:33 +0000 (22:35 +0000)]
[x86] don't use a shuffle when a vselect will do; NFCI
Looking at the IR definition of a masked load made me realize
there was no reason to use a shuffle here, so we don't need
to convert the format of the mask at all.
llvm-svn: 263167
Marianne Mailhot-Sarrasin [Thu, 10 Mar 2016 22:10:59 +0000 (22:10 +0000)]
Fixed ValueObject::GetExpressionPath() for paths including anonymous struct/union
When the parent of an expression is anonymous, skip adding '.' or '->' before the expression name.
Differential Revision: http://reviews.llvm.org/D18005
llvm-svn: 263166
Marianne Mailhot-Sarrasin [Thu, 10 Mar 2016 21:54:25 +0000 (21:54 +0000)]
Test commit access
llvm-svn: 263165
Simon Pilgrim [Thu, 10 Mar 2016 20:58:11 +0000 (20:58 +0000)]
Strip trailing whitespace.
llvm-svn: 263162
Greg Clayton [Thu, 10 Mar 2016 20:49:32 +0000 (20:49 +0000)]
Fixed the python interpreter so that it correctly inherits the top IOHandler's files instead of always using stdin/out/err.
Removed lldb_private::File::Duplicate() and the copy constructor and the assignment operator that used to duplicate the file handles and made them private so no one uses them. Previously the lldb_private::File::Duplicate() function duplicated files that used file descriptors, (int) but not file streams (FILE *), so the lldb_private::File::Duplicate() function only worked some of the time. No one else excep thee ScriptInterpreterPython was using these functions, so that aren't needed nor desired. Previously every time you would drop into the python interpreter we would duplicate files, and now we avoid this file churn.
<rdar://problem/
24877720>
llvm-svn: 263161
Reid Kleckner [Thu, 10 Mar 2016 20:47:26 +0000 (20:47 +0000)]
[Windows] Fix UnmapOrDie and MmapAlignedOrDie
Now ASan can return virtual memory to the underlying OS. Portable
sanitizer runtime code needs to be aware that UnmapOrDie cannot unmap
part of previous mapping.
In particular, this required changing how we implement MmapAlignedOrDie
on Windows, which is what Allocator32 uses.
The new code first attempts to allocate memory of the given size, and if
it is appropriately aligned, returns early. If not, it frees the memory
and attempts to reserve size + alignment bytes. In this region there
must be an aligned address. We then free the oversized mapping and
request a new mapping at the aligned address immediately after. However,
a thread could allocate that virtual address in between our free and
allocation, so we have to retry if that allocation fails. The existing
thread creation stress test managed to trigger this condition, so the
code isn't totally untested.
Reviewers: samsonov
Differential Revision: http://reviews.llvm.org/D17431
llvm-svn: 263160
Simon Pilgrim [Thu, 10 Mar 2016 20:40:26 +0000 (20:40 +0000)]
[X86][SSE] Reapplied: Improve vector ZERO_EXTEND by combining to ZERO_EXTEND_VECTOR_INREG
Generalise the existing SIGN_EXTEND to SIGN_EXTEND_VECTOR_INREG combine to support zero extension as well and get rid of a lot of unnecessary ANY_EXTEND + mask patterns.
Reapplied with a fix for PR26870 (avoid premature use of TargetConstant in ZERO_EXTEND_VECTOR_INREG expansion).
Differential Revision: http://reviews.llvm.org/D17691
llvm-svn: 263159
Artur Pilipenko [Thu, 10 Mar 2016 20:39:22 +0000 (20:39 +0000)]
Support arbitrary addrspace pointers in masked load/store intrinsics
This patch fixes the problem which occurs when loop-vectorize tries to use @llvm.masked.load/store intrinsic for a non-default addrspace pointer. It fails with "Calling a function with a bad signature!" assertion in CallInst constructor because it tries to pass a non-default addrspace pointer to the pointer argument which has default addrspace.
The fix is to add pointer type as another overloaded type to @llvm.masked.load/store intrinsics.
Reviewed By: reames
Differential Revision: http://reviews.llvm.org/D17270
llvm-svn: 263158
Dimitry Andric [Thu, 10 Mar 2016 20:22:02 +0000 (20:22 +0000)]
Retrieve command line arguments and environment correctly on FreeBSD
Summary:
Recently I saw the test `TestCases/Posix/print_cmdline.cc` failing on
FreeBSD, with "expected string not found in input". This is because
asan could not retrieve the command line arguments properly.
In `lib/sanitizer_common/sanitizer_linux.cc`, this is taken care of by
the `GetArgsAndEnv()` function, but it uses `__libc_stack_end` to get at
the required data. This variable does not exist on BSDs; the regular
way to retrieve the arguments and environment information is via the
`kern.ps_strings` sysctl.
I added this functionality in sanitizer_linux.cc, as a separate #ifdef
block in `GetArgsAndEnv()`. Also, `ReadNullSepFileToArray()` becomes
unused due to this change. (It won't work on FreeBSD anyway, since
`/proc` is not mounted by default.)
Reviewers: kcc, emaste, joerg, davide
Subscribers: llvm-commits, emaste
Differential Revision: http://reviews.llvm.org/D17832
llvm-svn: 263157
Peter Collingbourne [Thu, 10 Mar 2016 19:30:18 +0000 (19:30 +0000)]
ARM: Support relative references using the PREL31 symbol variant.
Differential Revision: http://reviews.llvm.org/D17937
llvm-svn: 263156
Richard Smith [Thu, 10 Mar 2016 19:22:21 +0000 (19:22 +0000)]
Add test for r263138.
llvm-svn: 263155
Balaram Makam [Thu, 10 Mar 2016 19:07:50 +0000 (19:07 +0000)]
Fix testicase to turn buildbot green. NFC.
llvm-svn: 263154
Rafael Espindola [Thu, 10 Mar 2016 19:00:22 +0000 (19:00 +0000)]
Move getLocalRelTarget to the file where it is used.
llvm-svn: 263152
Rui Ueyama [Thu, 10 Mar 2016 18:58:53 +0000 (18:58 +0000)]
Rename MaxAlignment -> Alignment.
We can argue about a maximum alignment of a group of symbols,
but for each symbol, there is only one alignment.
So it is a bit weird that each symbol has a "maximum alignment".
llvm-svn: 263151
George Rimar [Thu, 10 Mar 2016 18:57:17 +0000 (18:57 +0000)]
[ELF] - Fixed handling R_X86_64_DTPOFF64 relocation relaxation
R_X86_64_DTPOFF64 was not handled properly.
Next sample app was impossible to link before this patch:
~/pg/release/bin/clang -target x86_64-pc-linux testthread.cpp -c -g
~/pg/d+a/bin/ld.lld testthread.o
"Unknown TLS optimization" (value was 17)
__thread int x = 0;
void _start() {
}
It works fine now.
Differential revision: http://reviews.llvm.org/D18039
llvm-svn: 263150
Manman Ren [Thu, 10 Mar 2016 18:53:19 +0000 (18:53 +0000)]
Add TreatUnavailableAsInvalid for the verification-only mode in InitListChecker.
Given the following test case:
typedef struct {
const char *name;
id field;
} Test9;
extern void doSomething(Test9 arg);
void test9() {
Test9 foo2 = {0, 0};
doSomething(foo2);
}
With a release compiler, we don't emit any message and silently ignore the
variable "foo2". With an assert compiler, we get an assertion failure.
The root cause —————————————
Back in r140457 we gave InitListChecker a verification-only mode, and will use
CanUseDecl instead of DiagnoseUseOfDecl for verification-only mode.
These two functions handle unavailable issues differently:
In Sema::CanUseDecl, we say the decl is invalid when the Decl is unavailable and
the current context is available.
In Sema::DiagnoseUseOfDecl, we say the decl is usable by ignoring the return
code of DiagnoseAvailabilityOfDecl
So with an assert build, we will hit an assertion in diagnoseListInit
assert(DiagnoseInitList.HadError() &&
"Inconsistent init list check result.");
The fix -------------------
If we follow what is implemented in CanUseDecl and treat Decls with
unavailable issues as invalid, the variable decl of “foo2” will be marked as
invalid. Since unavailable checking is processed in delayed diagnostics
(r197627), we will silently ignore the diagnostics when we find out that
the variable decl is invalid.
We add a flag "TreatUnavailableAsInvalid" for the verification-only mode.
For overload resolution, we want to say decls with unavailable issues are
invalid; but for everything else, we should say they are valid and
emit diagnostics. Depending on the value of the flag, CanUseDecl
can return different values for unavailable issues.
rdar://
23557300
Differential Revision: http://reviews.llvm.org/D15314
llvm-svn: 263149
Nicolai Haehnle [Thu, 10 Mar 2016 18:51:58 +0000 (18:51 +0000)]
[TableGen] more helpful error message in MapTableEmitter
Differential Revision: http://reviews.llvm.org/D17275
llvm-svn: 263148
George Rimar [Thu, 10 Mar 2016 18:49:24 +0000 (18:49 +0000)]
[ELF] - Refactor of SymbolBody::compare()
That makes it a bit shorter.
Differential revision: http://reviews.llvm.org/D18004
llvm-svn: 263144
Teresa Johnson [Thu, 10 Mar 2016 18:47:03 +0000 (18:47 +0000)]
Materialize metadata in IRLinker before value mapping
Summary:
Unless we plan to do later postpass metadata linking (ThinLTO special mode),
always invoke metadata materialization at the start of IRLinker::run().
This avoids the need for clients who use lazy metadata loading to
explicitly invoke materializeMetadata before the IRMover, which in
turn invokes IRLinker::run and needs materialized metadata for mapping.
Came up in the context of an LLD issue (D17982).
Reviewers: rafael
Subscribers: silvas, llvm-commits
Differential Revision: http://reviews.llvm.org/D17992
llvm-svn: 263143
Filipe Cabecinhas [Thu, 10 Mar 2016 18:46:23 +0000 (18:46 +0000)]
[sanitizer_common tests] Make Darwin a Posix system and bring the stable-runtime definition from ASan tests.
Summary: This is an initial setup in order to move some additional tests from Linux onto Posix.
I also moved decorate_proc_maps onto the Linux directory
Finally added msan's definition for "stable-runtime".
Only a test requires it, and its commit message (r248014) seems to imply
that AArch64 is problematic with MSan.
Reviewers: samsonov, rengolin, t.p.northover, eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17928
llvm-svn: 263142
Tim Northover [Thu, 10 Mar 2016 18:46:12 +0000 (18:46 +0000)]
AArch64: remove pseudo-instructions used only for their patterns.
There's no real reason for these pseudos to exist, we should be writing real
patterns even if it is slightly less convenient. NFC.
llvm-svn: 263141
Nicolai Haehnle [Thu, 10 Mar 2016 18:43:50 +0000 (18:43 +0000)]
AMDGPU/SI: add llvm.amdgcn.buffer.load/store.format intrinsics
Summary:
They correspond to BUFFER_LOAD/STORE_FORMAT_XYZW and will be used by Mesa
to implement the GL_ARB_shader_image_load_store extension.
The intention is that for llvm.amdgcn.buffer.load.format, LLVM will decide
whether one of the _X/_XY/_XYZ opcodes can be used (similar to image sampling
and loads). However, this is not currently implemented.
For llvm.amdgcn.buffer.store, LLVM cannot decide to use one of the "smaller"
opcodes and therefore the intrinsic is overloaded. Currently, only the v4f32
is actually implemented since GLSL also only has a vec4 variant of the store
instructions, although it's conceivable that Mesa will want to be smarter
about this in the future.
BUFFER_LOAD_FORMAT_XYZW is already exposed via llvm.SI.vs.load.input, which
has a legacy name, pretends not to access memory, and does not capture the
full flexibility of the instruction.
Reviewers: arsenm, tstellarAMD, mareko
Subscribers: arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D17277
llvm-svn: 263140
Michael Kuperstein [Thu, 10 Mar 2016 18:43:21 +0000 (18:43 +0000)]
[X86] Correctly select registers to pop into for x86_64
When trying to replace an add to esp with pops, we need to choose dead
registers to pop into. Registers clobbered by the call and not imp-def'd
by it should be safe. Except that it's not enough to check the register
itself isn't defined, we also need to make sure no overlapping registers
are defined either.
This fixes PR26711.
Differential Revision: http://reviews.llvm.org/D18029
llvm-svn: 263139
Nico Weber [Thu, 10 Mar 2016 18:42:37 +0000 (18:42 +0000)]
Make remaining ImplicitFallthrough warning DefaultIgnore.
Follow-up to r262881, which caused this to fire more often.
llvm-svn: 263138
Kuba Brecka [Thu, 10 Mar 2016 18:09:57 +0000 (18:09 +0000)]
Follow-up fix for r263126. Apparently `printf("%p", NULL)` can output 0x0, (nil) or (null) on different platforms.
llvm-svn: 263137
Balaram Makam [Thu, 10 Mar 2016 17:54:55 +0000 (17:54 +0000)]
[AArch64] Optimize compare and branch sequence when the compare's constant operand is power of 2
Summary:
Peephole optimization that generates a single TBZ/TBNZ instruction
for test and branch sequences like in the example below. This handles
the cases that miss folding of AND into TBZ/TBNZ during ISelLowering of BR_CC
Examples:
and w8, w8, #0x400
cbnz w8, L1
to
tbnz w8, #10, L1
Reviewers: MatzeB, jmolloy, mcrosier, t.p.northover
Subscribers: aemerson, rengolin, mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D17942
llvm-svn: 263136
Sanjay Patel [Thu, 10 Mar 2016 17:52:19 +0000 (17:52 +0000)]
give regression test a meaningful name
llvm-svn: 263135
Aidan Dodds [Thu, 10 Mar 2016 17:50:01 +0000 (17:50 +0000)]
[Renderscript] Add stack argument reading code for Mipsel 3
Fix a problem raised with the previous patches being applied in the wrong order.
Committed on behalf of: Dean De Leo <dean@codeplay.com>
llvm-svn: 263134
George Rimar [Thu, 10 Mar 2016 17:38:49 +0000 (17:38 +0000)]
[ELF] - Do not call doInitSymbols for all ELFTs
It looks a bit wierd that we have to initialize symbols for all ELFT
types when we use only one ELFT for link. We can only init those
that we need. Patch fixes it.
Differential revision: http://reviews.llvm.org/D18047
llvm-svn: 263133
Alexandros Lamprineas [Thu, 10 Mar 2016 17:38:41 +0000 (17:38 +0000)]
[ARM] Cortex-R8 support
This patch adds Cortex-R8 to Target Parser and TableGen.
It also adds CodeGen tests for the build attributes.
Patch by Pablo Barrio.
Differential Revision: http://reviews.llvm.org/D17925
llvm-svn: 263132
Aidan Dodds [Thu, 10 Mar 2016 17:37:02 +0000 (17:37 +0000)]
[Renderscript] Add stack argument reading code for Mipsel 2
This commit implements the reading of stack spilled function arguments for little endian MIPS targets.
Committed on behalf of: Dean De Leo <dean@codeplay.com>
llvm-svn: 263131
Aidan Dodds [Thu, 10 Mar 2016 17:27:41 +0000 (17:27 +0000)]
[Renderscript] Add stack argument reading code for Mipsel
This commit implements the reading of stack spilled function arguments for little endian MIPS targets.
Committed on behalf of: Dean De Leo <dean@codeplay.com>
llvm-svn: 263130
Aidan Dodds [Thu, 10 Mar 2016 17:23:33 +0000 (17:23 +0000)]
[Renderscript] Explicitly set the language to evaluate allocations
Currently it is not specified, and since allocations are usually
requested once we hit a renderscript breakpoint, the language will be
inferred being as renderscript by the ExpressionParser.
Actually allocations attempt to invoke functions part of the RS runtime,
written in C/C++, so evaluating the calls in RenderScript could be
misleading.
In particular, in MIPS, the ABI between C/C++ (mips o32) and
renderscript (arm) might introduce subtle bugs when evaluating such
expressions.
This change explicitly sets the language used to evaluate the allocations
as C++.
Committed on behalf of: Dean De Leo <dean@codeplay.com>
llvm-svn: 263129
George Rimar [Thu, 10 Mar 2016 17:13:20 +0000 (17:13 +0000)]
Attemp to fix linux build bot fail after r263125
(http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/8662).
Test fails on linux only.
Original commit message:
[ELF] - Consistent spelling for error/warning messages
Previously error and warnings were not consistent in lld.
Some of them started from lowercase letter, others from
uppercase. Also there was one or two which had a dot at the end.
This patch changes all messages to start from uppercase letter if
they were not before.
Differential revision: http://reviews.llvm.org/D18045
llvm-svn: 263128
Mehdi Amini [Thu, 10 Mar 2016 17:06:52 +0000 (17:06 +0000)]
Rename -discard-value-names into -lto-discard-value-names in libLLVMLTO
This is avoiding a naming conflict with opt and llc.
While opt and llc don't link to LTO usually, users that are building a
monolithic libLLVM.dylib and linking the tools to it would have a
runtime error because of the duplicate cl::opt registration.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263127
Kuba Brecka [Thu, 10 Mar 2016 17:00:29 +0000 (17:00 +0000)]
[tsan] Add TSan debugger APIs
Currently, TSan only reports everything in a formatted textual form. The idea behind this patch is to provide a consistent API that can be used to query information contained in a TSan-produced report. User can use these APIs either in a debugger (via a script or directly), or they can use it directly from the process (e.g. in the __tsan_on_report callback). ASan already has a similar API, see http://reviews.llvm.org/D4466.
Differential Revision: http://reviews.llvm.org/D16191
llvm-svn: 263126
George Rimar [Thu, 10 Mar 2016 16:58:34 +0000 (16:58 +0000)]
[ELF] - Consistent spelling for error/warning messages
Previously error and warnings were not consistent in lld.
Some of them started from lowercase letter, others from
uppercase. Also there was one or two which had a dot at the end.
This patch changes all messages to start from uppercase letter if
they were not before.
Differential revision: http://reviews.llvm.org/D18045
llvm-svn: 263125
Changpeng Fang [Thu, 10 Mar 2016 16:47:15 +0000 (16:47 +0000)]
AMDGPU/SI: Define S_GETREG Intrinsic
Summary:
Define s_getreg intrinsic to generate s_getreg instruction to read
hardware registers.
Reviewers: tstellarAMD, arsenm
Subscribers: llvm-commits, arsenm
Differential Revision: http://reviews.llvm.org/D17892
llvm-svn: 263124
Saleem Abdulrasool [Thu, 10 Mar 2016 16:26:37 +0000 (16:26 +0000)]
ARM: follow up improvements for SVN r263118
The initial change was insufficiently complete for always getting the semantics
of __builtin_longjmp correct. The builtin is translated into a
`tInt_eh_sjlj_longjmp` DAG node. This node set R7 as clobbered. However, the
code would then follow up with a clobber of R11. I had failed to notice the
imp-def,kill on R7 in the isel. Unfortunately, it seems that it is not possible
to conditionalise the Defs list via an !if. Instead, construct a new parallel
WIN node and prefer that when targeting windows. This ensures that we now both
correctly model the __builtin_longjmp as well as construct the frame in a more
ABI conformant manner.
llvm-svn: 263123
Adrian McCarthy [Thu, 10 Mar 2016 15:41:11 +0000 (15:41 +0000)]
Eliminate the TestStarted-XXX and TestFinished-XXX files from check-lldb runs.
Nobody seems to know what purpose these files serve, yet they were accumulating by the thousands in the test traces directory. I'm proposing we delete them.
Creating these files accounted for about 2.5% of the time to run ninja check-lldb on my machine, which isn't a lot, but it's something.
llvm-svn: 263122
Chandler Carruth [Thu, 10 Mar 2016 15:31:17 +0000 (15:31 +0000)]
[SROA] Fix PR25873, which Andrea Di Biagio analyzed the daylights out
of, and I misdiagnosed for months and months.
Andrea has had a patch for this forever, but I just couldn't see how
it was fixing the root cause of the problem. It didn't make sense to me,
even though the patch was perfectly good and the analysis of the actual
failure event was *fantastic*.
Well, I came back to it today because the patch has sat for *far* too
long and needs attention and decided I wouldn't let it go until I really
understood what was going on. After quite some time in the debugger,
I finally realized that in fact I had just missed an important case with
my previous attempt to fix PR22093 in r225149. Not only do we need to
handle loads that won't be split, but stores-of-loads that we won't
split. We *do* actually have enough logic in the presplitting to form
new slices for split stores.... *unless* we decided not to split them!
I'm so sorry that it took me this long to come to the realization that
this is the issue. It seems so obvious in hind sight (of course).
Anyways, the fix becomes *much* smaller and more focused. The fact that
we're left doing integer smashing is related to the FIXME in my original
commit: fundamentally, we're not aggressive about pre-splitting for
loads and stores to the same alloca. If we want to get aggressive about
this, it'll need both what Andrea had put into the proposed fix, but
also a *lot* more logic to essentially iteratively pre-split the alloca
until we can't do any more. As I said in that commit log, its really
unclear that this is the right call. Instead, the integer blending and
letting targets lower this to narrower stores seems slightly better. But
we definitely shouldn't really go down that path just to fix this bug.
Again, tons of thanks are owed to Andrea and others at Sony for working
on this bug. I really should have seen what was going on here and
re-directed them sooner. =////
llvm-svn: 263121
David L Kreitzer [Thu, 10 Mar 2016 15:14:02 +0000 (15:14 +0000)]
Unified the handling of returns in the X87 stackifier so that the stackifier
runs successfully on routines containing IRETs. This fixes PR26410.
Differential Revision: http://reviews.llvm.org/D17643
llvm-svn: 263120
NAKAMURA Takumi [Thu, 10 Mar 2016 15:13:00 +0000 (15:13 +0000)]
Fixup for r263114. llvm::AnalysisBase<CallGraphAnalysis> should be declared as extern.
llvm-svn: 263119
Saleem Abdulrasool [Thu, 10 Mar 2016 15:11:09 +0000 (15:11 +0000)]
ARM: correct __builtin_longjmp on WoA
WoA uses r11 as the FP even though it is a pure thumb-2 environment in contrast
to AAPCS which states r7. This adjusts __builtin_longjmp to not clobber r7 and
to properly restore the frame pointer on execution.
llvm-svn: 263118
Simon Pilgrim [Thu, 10 Mar 2016 14:46:49 +0000 (14:46 +0000)]
Updated SSE3 builtin tests to more closely match the llvm fast-isel equivalent tests
llvm-svn: 263117
Simon Pilgrim [Thu, 10 Mar 2016 14:44:32 +0000 (14:44 +0000)]
Added note to SSE4a builtins about keeping in sync with llvm tests
llvm-svn: 263116
Simon Pilgrim [Thu, 10 Mar 2016 14:42:17 +0000 (14:42 +0000)]
Updated SSSE3 builtin tests to more closely match the llvm fast-isel equivalent tests
llvm-svn: 263115
Chandler Carruth [Thu, 10 Mar 2016 14:33:10 +0000 (14:33 +0000)]
[CG] Back out my pointless move ctor and add the explicit template
instantiation needed for the mingw dll build bot.
llvm-svn: 263114
Simon Pilgrim [Thu, 10 Mar 2016 14:16:36 +0000 (14:16 +0000)]
Minor Wdocumentation fix. NFCI.
llvm-svn: 263113
Chandler Carruth [Thu, 10 Mar 2016 14:16:18 +0000 (14:16 +0000)]
[SROA] Clean up some really weird code, no functionality changed.
We already have the instruction extracted into 'I', just cast that to
a store the way we do for loads. Also, we don't enter the if unless SI
is non-null, so don't test it again for null.
I'm pretty sure the entire test there can be nuked, but this is just the
trivial cleanup.
llvm-svn: 263112
Elena Demikhovsky [Thu, 10 Mar 2016 13:44:22 +0000 (13:44 +0000)]
AVX-512: Fixed a bug in i1 vector zero extending. (Skylake-avx512)
(failed on instruction selection phase)
Differential Revision: http://reviews.llvm.org/D17924
llvm-svn: 263111
Chandler Carruth [Thu, 10 Mar 2016 13:43:06 +0000 (13:43 +0000)]
[CG] Try adding an explicit move constructor to see if that helps the
one build bot that is crashing on this code.
llvm-svn: 263110
Aaron Ballman [Thu, 10 Mar 2016 13:08:22 +0000 (13:08 +0000)]
Correcting an attribute documentation generation error by giving the abi_tag attribute a documentation category.
llvm-svn: 263109
Valery Pykhtin [Thu, 10 Mar 2016 13:06:08 +0000 (13:06 +0000)]
[AMDGPU] Fix SMEM instructions encoding/operand namings
Differential Revision: http://reviews.llvm.org/D17651
llvm-svn: 263108
Ewan Crawford [Thu, 10 Mar 2016 12:38:55 +0000 (12:38 +0000)]
Revert "Track expression language from one place in ClangExpressionParser"
r263099 seems to have broken some OSX tests
llvm-svn: 263107
Filipe Cabecinhas [Thu, 10 Mar 2016 11:51:59 +0000 (11:51 +0000)]
[test/asan/closed-fds] Properly quote log_path for shell invocation.
llvm-svn: 263106
Simon Pilgrim [Thu, 10 Mar 2016 11:50:15 +0000 (11:50 +0000)]
[X86][AVX] Improve target shuffle combining of BLEND+zero
The BLEND+zero combine was failing to combine equivalent BLEND masks.
Follow up to D17483 and D17858
llvm-svn: 263105
Chandler Carruth [Thu, 10 Mar 2016 11:24:11 +0000 (11:24 +0000)]
[CG] Add a new pass manager printer pass for the old call graph and
actually finish wiring up the old call graph.
There were bugs in the old call graph that hadn't been caught because it
wasn't being tested. It wasn't being tested because it wasn't in the
pipeline system and we didn't have a printing pass to run in tests. This
fixes all of that.
As for why I'm still keeping the old call graph alive its so that I can
port GlobalsAA to the new pass manager with out forking it to work with
the lazy call graph. That's clearly the right eventual design, but it
seems pragmatic to defer that until its necessary. The old call graph
works just fine for GlobalsAA.
llvm-svn: 263104
Chandler Carruth [Thu, 10 Mar 2016 11:24:06 +0000 (11:24 +0000)]
[LCG] Spell the printing pass pipeline name for the lazy call graph
'lcg' instead of just 'cg'.
This makes it consistent with the analysis name of 'lcg'.
No functionality changed.
llvm-svn: 263103
Simon Pilgrim [Thu, 10 Mar 2016 11:23:51 +0000 (11:23 +0000)]
[X86][SSE] Basic combining of unary target shuffles of binary target shuffles.
This patch reorders the combining of target shuffle masks so that when a unary shuffle takes a binary shuffle as its input but only references one of its inputs it can correctly combine into a unary shuffle mask.
This is starting to encroach on the purpose of resolveTargetShuffleInputs, but I don't want to remove it until we definitely know we won't need it for full binary shuffle combining.
There is a lot more work before we can properly support binary target shuffle masks but this was an easy case to add support for.
Differential Revision: http://reviews.llvm.org/D17858
llvm-svn: 263102
Chandler Carruth [Thu, 10 Mar 2016 11:08:44 +0000 (11:08 +0000)]
[CG] Actually hoist up the generic CallGraphPrinter pass from a weird
location in the opt tool to live along side the analysis in LLVM's
libraries.
No functionality changed here, but this will allow me to port the
printer to the new pass manager as well.
llvm-svn: 263101
Chandler Carruth [Thu, 10 Mar 2016 11:04:40 +0000 (11:04 +0000)]
[CG] Rename the DOT printing pass to actually reference "DOT".
There is another pass by the generic name 'CallGraphPrinter' which is
actually just a call graph printer tucked away inside the opt tool. I'd
like to bring it out and make it follow the same patterns as the rest of
the CallGraph code, but doing so would end up conflicting with the name
of the DOT printing pass. So this makes the DOT printing pass name be
more precise.
No functionality changed here.
llvm-svn: 263100
Ewan Crawford [Thu, 10 Mar 2016 10:31:08 +0000 (10:31 +0000)]
Track expression language from one place in ClangExpressionParser
The current expression language is currently tracked in a few places within the ClangExpressionParser constructor.
This patch adds a private lldb::LanguageType attribute to the ClangExpressionParser class and tracks the expression language from that one place.
Author: Luke Drummond <luke.drummond@codeplay.com>
Differential Revision: http://reviews.llvm.org/D17719
llvm-svn: 263099
Ekaterina Romanova [Thu, 10 Mar 2016 09:37:04 +0000 (09:37 +0000)]
Add doxygen comments to xmmintrin.h's intrinsics.
Only half of the intrinsics in this file is documented here. The patch for the other half will be sent out later.
The doxygen comments are automatically generated based on Sony's intrinsics document.
I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream.
llvm-svn: 263098
Elena Demikhovsky [Thu, 10 Mar 2016 08:32:09 +0000 (08:32 +0000)]
AVX-512: Fixed a bug in shuffle for v64i8 type
Operation SCALAR_TO_VECTOR for v64i8 and v32i16 should be lowered if BW feature is "on".
Differential Revision: http://reviews.llvm.org/D17994
llvm-svn: 263097