Mehdi Amini [Tue, 12 Apr 2016 21:35:28 +0000 (21:35 +0000)]
Add a pass to name anonymous/nameless function
Summary:
For correct handling of alias to nameless
function, we need to be able to refer them through a GUID in the summary.
Here we name them using a hash of the non-private global names in the module.
Reviewers: tejohnson
Subscribers: joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D18883
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266132
Mehdi Amini [Tue, 12 Apr 2016 21:35:18 +0000 (21:35 +0000)]
Move summary creation out of llvm-as into opt
Summary:
Let keep llvm-as "dumb": it converts textual IR to bitcode. This
commit removes the dependency from llvm-as to libLLVMAnalysis.
We'll add back summary in llvm-as if we get to a textual
representation for it at some point. In the meantime, opt seems
like a better place for that.
Reviewers: tejohnson
Subscribers: joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D19032
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266131
Justin Bogner [Tue, 12 Apr 2016 21:34:24 +0000 (21:34 +0000)]
X86: Avoid accessing SDValues after they've been RAUW'd
This fixes two use-after-frees in selectLEA64_32Addr. If matchAddress
matches an ADD with an AND as an operand, and that AND hits one of the
"heroic transforms" that folds masks and shifts, we end up with N
pointing to an SDNode that was deleted. Make sure we're done accessing
it before that.
Found by ASan with the recycling allocator changes in llvm.org/PR26808.
llvm-svn: 266130
Enrico Granata [Tue, 12 Apr 2016 21:26:48 +0000 (21:26 +0000)]
Cleanup the arguments for 'memory find' such that the help system reflects the real way to invoke it
llvm-svn: 266129
JF Bastien [Tue, 12 Apr 2016 21:23:05 +0000 (21:23 +0000)]
NFC: MergeFunctions return early
Same effect, easier to read.
llvm-svn: 266128
David Blaikie [Tue, 12 Apr 2016 21:22:48 +0000 (21:22 +0000)]
Add a fixme for an old patch I had lying around that I'm not going to finish any time so n
llvm-svn: 266127
Nicolai Haehnle [Tue, 12 Apr 2016 21:18:10 +0000 (21:18 +0000)]
AMDGPU: add llvm.amdgcn.buffer.load/store intrinsics
Summary:
They correspond to BUFFER_LOAD/STORE_DWORD[_X2,X3,X4] and mostly behave like
llvm.amdgcn.buffer.load/store.format. They will be used by Mesa for SSBO and
atomic counters at least when robust buffer access behavior is desired.
(These instructions perform no format conversion and do buffer range checking
per component.)
As a side effect of sharing patterns with llvm.amdgcn.buffer.store.format,
it has become trivial to add support for the f32 and v2f32 variants of that
intrinsic, so the patch does so.
Also DAG-ify (and fix) some tests that I noticed intermittent failures in
while developing this patch.
Some tests were (temporarily) adjusted for the required mayLoad/hasSideEffects
changes to the BUFFER_STORE_DWORD* instructions. See also
http://reviews.llvm.org/D18291.
Reviewers: arsenm, tstellarAMD, mareko
Subscribers: arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D18292
llvm-svn: 266126
Teresa Johnson [Tue, 12 Apr 2016 21:13:11 +0000 (21:13 +0000)]
[ThinLTO] Only compute imports for current module in FunctionImport pass
Summary:
The function import pass was computing all the imports for all the
modules in the index, and only using the imports for the current module.
Change this to instead compute only for the given module. This means
that the exports list can't be populated, but they weren't being used
anyway.
Longer term, the linker can collect all the imports and export lists
and serialize them out for consumption by the distributed backend
processes which use this pass.
Reviewers: joker.eph
Subscribers: llvm-commits, joker.eph
Differential Revision: http://reviews.llvm.org/D18945
llvm-svn: 266125
JF Bastien [Tue, 12 Apr 2016 21:13:01 +0000 (21:13 +0000)]
NFC: MergeFunctions update more comments
They are wordy. Some words were wrong.
llvm-svn: 266124
Ed Maste [Tue, 12 Apr 2016 21:11:46 +0000 (21:11 +0000)]
Always use --eh-frame-hdr on FreeBSD, even for -static
FreeBSD uses LLVM's libunwind on FreeBSD/arm64 today (and is expected to
use it more widely in the future), and it requires the EH frame segment
in static binaries.
This is the same as r203742 for NetBSD.
Differential Revision: http://reviews.llvm.org/D19029
llvm-svn: 266123
Eric Christopher [Tue, 12 Apr 2016 21:08:54 +0000 (21:08 +0000)]
Add a couple of missing vsx load and store intrinsics.
Patch by Jing Yu!
llvm-svn: 266122
Peter Collingbourne [Tue, 12 Apr 2016 20:41:42 +0000 (20:41 +0000)]
ELF: Give automatically generated __start_* and __stop_* symbols hidden visibility.
These symbols describe a property of a linkage unit, so it seems reasonable
to limit their visibility to the linkage unit. Furthermore the use cases I
am aware of do not require more than hidden visibility.
This is a departure from the behavior of the bfd and gold linkers. However,
it is unclear that the decision to give these symbols default visibility
in those linkers was made deliberately. The __start_*/__stop_* feature
was added to the bfd linker in 1994 [1], while the visibility feature was
added about five years later [2], so it may have been that the visibility
of these symbols was not considered. The feature was implemented in gold
[3] in the same way; the behavior may have simply been copied from bfd.
The only related discussion I could find on the binutils mailing list [4]
was a user issue which would most likely not have occurred if the symbols
had hidden visibility.
[1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=
5efddb2e7c3229b569a862205f61d42860af678b
[2] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=
0fc731e447cd01e7fc35197b487ff0e4fd25afca
[3] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=
bfd58944a64b0997a310b95fbe0423338961e71c
[4] https://sourceware.org/ml/binutils/2014-05/msg00011.html
Differential Revision: http://reviews.llvm.org/D19024
llvm-svn: 266121
Jonathan Peyton [Tue, 12 Apr 2016 20:37:18 +0000 (20:37 +0000)]
Add declarations of OpenMP 4.5 target/offload routines to headers
All these routines are implemented in the offload library.
llvm-svn: 266120
Simon Atanasyan [Tue, 12 Apr 2016 20:37:00 +0000 (20:37 +0000)]
[ELF][MIPS] Add test case to check using GP0 value in relocation calculation. NFC.
llvm-svn: 266119
Greg Clayton [Tue, 12 Apr 2016 20:26:41 +0000 (20:26 +0000)]
Revert to using libdispatch to reap threads on MacOSX. Code was accidentally checked in that is now reverted.
<rdar://problem/
25643874>
llvm-svn: 266118
Yaxun Liu [Tue, 12 Apr 2016 20:22:32 +0000 (20:22 +0000)]
Pass -backend-option to LLVM when there is no target machine.
Clang should pass -backend-option to LLVM even though there is no target machine, since LLVM passes are used when emitting LLVM IR.
Differential Revision: http://reviews.llvm.org/D17552
llvm-svn: 266117
Richard Smith [Tue, 12 Apr 2016 20:20:33 +0000 (20:20 +0000)]
[modules] Extend r266113 to cope with submodules.
llvm-svn: 266116
James Y Knight [Tue, 12 Apr 2016 20:18:48 +0000 (20:18 +0000)]
Add __atomic_* lowering to AtomicExpandPass.
(Recommit of r266002, with r266011, r266016, and not accidentally
including an extra unused/uninitialized element in LibcallRoutineNames)
AtomicExpandPass can now lower atomic load, atomic store, atomicrmw, and
cmpxchg instructions to __atomic_* library calls, when the target
doesn't support atomics of a given size.
This is the first step towards moving all atomic lowering from clang
into llvm. When all is done, the behavior of __sync_* builtins,
__atomic_* builtins, and C11 atomics will be unified.
Previously LLVM would pass everything through to the ISelLowering
code. There, unsupported atomic instructions would turn into __sync_*
library calls. Because of that behavior, Clang currently avoids emitting
llvm IR atomic instructions when this would happen, and emits __atomic_*
library functions itself, in the frontend.
This change makes LLVM able to emit __atomic_* libcalls, and thus will
eventually allow clang to depend on LLVM to do the right thing.
It is advantageous to do the new lowering to atomic libcalls in
AtomicExpandPass, before ISel time, because it's important that all
atomic operations for a given size either lower to __atomic_*
libcalls (which may use locks), or native instructions which won't. No
mixing and matching.
At the moment, this code is enabled only for SPARC, as a
demonstration. The next commit will expand support to all of the other
targets.
Differential Revision: http://reviews.llvm.org/D18200
llvm-svn: 266115
Derek Schuff [Tue, 12 Apr 2016 20:12:05 +0000 (20:12 +0000)]
[WebAssembly] Fix debug info in reg-stackify.ll test
It lacked a CU and thus became invalid with r266102
llvm-svn: 266114
Richard Smith [Tue, 12 Apr 2016 19:58:30 +0000 (19:58 +0000)]
[modules] When an incompatible module file is explicitly provided for a module,
and we fall back to textual inclusion, don't require the module as a whole to
be marked available; it's OK if some other file in the same module is missing,
just as it would be if the header were explicitly marked textual.
llvm-svn: 266113
JF Bastien [Tue, 12 Apr 2016 19:44:40 +0000 (19:44 +0000)]
Delete mergefunctions.clang.svn.patch
The patch doesn't apply, and was removed from zorg by rL266094.
llvm-svn: 266112
Yaxun Liu [Tue, 12 Apr 2016 19:43:36 +0000 (19:43 +0000)]
PR19957: [OpenCL] Incorrectly accepts implicit address space conversion with ternary operator.
Generates addrspacecast instead of bitcast for ternary operator when necessary, and diagnose ternary operator with incompatible second and third operands.
https://llvm.org/bugs/show_bug.cgi?id=19957
Differential Revision: http://reviews.llvm.org/D17412
llvm-svn: 266111
Devin Coughlin [Tue, 12 Apr 2016 19:29:52 +0000 (19:29 +0000)]
[analyzer] Nullability: Suppress return diagnostics in inlined functions.
The nullability checker can sometimes miss detecting nullability precondition
violations in inlined functions because the binding for the parameter
that violated the precondition becomes dead before the return:
int * _Nonnull callee(int * _Nonnull p2) {
if (!p2)
// p2 becomes dead here, so binding removed.
return 0; // warning here because value stored in p2 is symbolic.
else
return p2;
}
int *caller(int * _Nonnull p1) {
return callee(p1);
}
The fix, which is quite blunt, is to not warn about null returns in inlined
methods/functions. This won’t lose much coverage for ObjC because the analyzer
always analyzes each ObjC method at the top level in addition to inlined. It
*will* lose coverage for C — but there aren’t that many codebases with C
nullability annotations.
rdar://problem/
25615050
llvm-svn: 266109
Nico Weber [Tue, 12 Apr 2016 19:04:37 +0000 (19:04 +0000)]
clang-cl: Remove -isystem, add -imsvc.
r260990 exposed -isystem in clang-cl. -isystem adds a directory to the front of
the system include search path. The idea was to use this to point to a hermetic
msvc install, but as it turns out this doesn't work: -isystem then adds the
hermetic headers in front of clang's builtin headers, and clang's headers that
are supposed to wrap msvc headers (say, stdarg.h) aren't picked up at all
anymore.
So revert that, and instead expose -imsvc which works as if the passed
directory was part of %INCLUDE%: The header is treated as a system header, but
it is searched after clang's lib/Header headers.
Fixes half of PRPR26751.
llvm-svn: 266108
Yaxun Liu [Tue, 12 Apr 2016 19:03:49 +0000 (19:03 +0000)]
[OpenCL] Handle AddressSpaceConversion when target address space does not change.
In codegen different address spaces may be mapped to the same address
space for a target, e.g. in x86/x86-64 all address spaces are mapped
to 0. Therefore AddressSpaceConversion should be translated by
CreatePointerBitCastOrAddrSpaceCast instead of CreateAddrSpaceCast.
Differential Revision: http://reviews.llvm.org/D18713
llvm-svn: 266107
Evgeniy Stepanov [Tue, 12 Apr 2016 18:48:41 +0000 (18:48 +0000)]
[safestack] Fix stack canary test on Mac.
Disable FORTIFY_SOURCE and explicitly disable stack protector in the
no-stack-protector run.
llvm-svn: 266106
Tom Stellard [Tue, 12 Apr 2016 18:40:43 +0000 (18:40 +0000)]
AMDGPU/SI: Insert wait states required after v_readfirstlane on SI
Summary:
We will be able to handle this case much better once the hazard recognizer
is finished, but this conservative implementation fixes a hang with the piglit
test:
spec/arb_arrays_of_arrays/execution/sampler/fs-nested-struct-arrays-nonconst-nested-arra
Reviewers: arsenm, nhaehnle
Subscribers: arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D18988
llvm-svn: 266105
Matt Arsenault [Tue, 12 Apr 2016 18:24:38 +0000 (18:24 +0000)]
AMDGPU: Eliminate half of i64 or if one operand is zero_extend from i32
This helps clean up some of the mess when expanding unaligned 64-bit
loads when changed to be promote to v2i32, and fixes situations
where or x, 0 was emitted after splitting 64-bit ors during moveToVALU.
I think this could be a generic combine but I'm not sure.
llvm-svn: 266104
Enrico Granata [Tue, 12 Apr 2016 18:23:18 +0000 (18:23 +0000)]
Initialize the Python script interpreter lazily (i.e. not at debugger startup)
This time it should also pass the gtests
llvm-svn: 266103
Davide Italiano [Tue, 12 Apr 2016 18:22:33 +0000 (18:22 +0000)]
[IR/Verifier] Each DISubprogram with isDefinition: true must belong to a CU.
Add a check to catch violations. ~60 tests were broken and prevented
this change to be committed. Adrian and I (thanks Adrian!) went
through them in the last week or so updating. The check can be
done more efficiently but I'd still like to get this in ASAP to
avoid more broken tests to be checked in (if any).
PR: 27101
llvm-svn: 266102
Matt Arsenault [Tue, 12 Apr 2016 18:17:23 +0000 (18:17 +0000)]
APInt: Add overload of isMask
This mimics the version in MathExtras.h which isn't testing for a
specific mask size.
llvm-svn: 266101
Ahmed Bougacha [Tue, 12 Apr 2016 18:15:39 +0000 (18:15 +0000)]
[CodeGen] Remove constant-folding dead code. NFC.
This code was specific to vector operations with scalar operands:
all the opcodes in FoldValue (via FoldConstantArithmetic) can't
match those criteria.
Replace it with an assert if that ever changes: at that point,
we might need to add back a splat BUILD_VECTOR.
llvm-svn: 266100
JF Bastien [Tue, 12 Apr 2016 18:06:55 +0000 (18:06 +0000)]
Check alloca's special state
Following up to a similar fix in MergeFunctions: r266022. This patch keeps both in sync, it would be nice to not have to do this. It doesn't look like there's an easy way to test this code directly at the moment: AFAICT all currect uses of isSameOperationAs are looking at instructions deep inside a function. IndVarSimplify/pr24952.ll and InstMerge/st_sink_* look at alloca inadvertently but are brittle tests.
llvm-svn: 266099
Philip Reames [Tue, 12 Apr 2016 18:05:10 +0000 (18:05 +0000)]
Introduce an GCRelocateInst class [NFC]
Previously, we were using isGCRelocate predicates. Using a subclass of IntrinsicInst is far more idiomatic. The refactoring also enables a couple of minor simplifications and code sharing.
llvm-svn: 266098
Sanjay Patel [Tue, 12 Apr 2016 18:01:48 +0000 (18:01 +0000)]
fix indentation; NFC
llvm-svn: 266097
Johannes Doerfert [Tue, 12 Apr 2016 17:54:29 +0000 (17:54 +0000)]
[FIX] Check the invalid context agains the context to rule out SCoPs
llvm-svn: 266096
Evgeniy Stepanov [Tue, 12 Apr 2016 17:51:59 +0000 (17:51 +0000)]
Stricter checks in the stack-protector codegen test.
llvm-svn: 266095
Jim Ingham [Tue, 12 Apr 2016 17:17:35 +0000 (17:17 +0000)]
Breakpoint conditions were making result variables, which they should not do.
The result variables aren't useful, and if you have a breakpoint on a
common function you can generate a lot of these. So I changed the
code that checks the condition to set ResultVariableIsInternal in the
EvaluateExpressionOptions that we pass to the execution.
Unfortunately, the check for this variable was done in the wrong place
(the static UserExpression::Evaluate) which is not how breakpoint
conditions execute expressions (UserExpression::Execute). So I moved
the check to UserExpression::Execute (which Evaluate also calls) and made the
overridden method DoExecute.
llvm-svn: 266093
Jim Ingham [Tue, 12 Apr 2016 17:04:12 +0000 (17:04 +0000)]
'int' is reported as an exception on OS X not as a signal. I don't think
this test ever succeeded on OS X.
llvm-svn: 266092
Nico Weber [Tue, 12 Apr 2016 16:52:30 +0000 (16:52 +0000)]
Revert 266090, needs more testing first.
llvm-svn: 266091
Nico Weber [Tue, 12 Apr 2016 16:38:07 +0000 (16:38 +0000)]
clang-cl: Expose -nostdlibinc.
llvm-svn: 266090
David Majnemer [Tue, 12 Apr 2016 16:33:53 +0000 (16:33 +0000)]
[FileManager] Don't crash if reading from stdin and stat(".") fails
addAncestorsAsVirtualDirs("<stdin>") quickly returns without doing work
because "<stdin>" has no parent_path. This violates the expectation
that a subsequent call to getDirectoryFromFile("<stdin>") would succeed.
Instead, it fails because it uses the "." if the file has no path
component.
Fix this by keeping the behavior between addAncestorsAsVirtualDirs and
getDirectoryFromFile symmetric.
llvm-svn: 266089
Nicolai Haehnle [Tue, 12 Apr 2016 16:10:38 +0000 (16:10 +0000)]
AMDGPU/SI: Fix a mis-compilation of multi-level breaks
Summary:
Under certain circumstances, multi-level breaks (or what is understood by
the control flow passes as such) could be miscompiled in a way that causes
infinite loops, by emitting incorrect control flow intrinsics.
This fixes a hang in
dEQP-GLES3.functional.shaders.loops.while_dynamic_iterations.conditional_continue_vertex
Reviewers: arsenm, tstellarAMD
Subscribers: arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D18967
llvm-svn: 266088
Johannes Doerfert [Tue, 12 Apr 2016 16:09:44 +0000 (16:09 +0000)]
Do not by default minimize remarks
We used checks to minimize the number of remarks we present to a user
but these checks can become expensive, especially since all wrapping
assumptions are emitted separately. Because there is not benefit for a
"headless" run we put these checks under a command line flag. Thus, if
the flag is not given we will emit "non-effective" remarks, e.g.,
duplicates and revert to the old behaviour if it is given. As this
also changes the internal representation of some sets we set the flag
by default for our unit tests.
llvm-svn: 266087
Artur Pilipenko [Tue, 12 Apr 2016 15:58:04 +0000 (15:58 +0000)]
Support arbitrary addrspace pointers in masked load/store intrinsics
This is a resubmittion of 263158 change.
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: 266086
Davide Italiano [Tue, 12 Apr 2016 15:51:23 +0000 (15:51 +0000)]
[Bitcode] Fix + regenerate old test so that it includes a DICompileUnit.
llvm-svn: 266085
Geoff Berry [Tue, 12 Apr 2016 15:50:19 +0000 (15:50 +0000)]
[ScheduleDAGInstrs] Handle instructions with multiple MMOs
Summary:
In getUnderlyingObjectsForInstr(): Don't give up on instructions with
multiple MMOs, instead look through all the MMOs and if they all meet
the conservative criteria previously used for single MMO instructions,
then return all of the underlying objects derived from the MMOs.
The change to ScheduleDAGInstrs::buildSchedGraph() is needed to avoid
the case where multiple underlying objects are present and are related
in such a way that successive iterations of the loop end up adding a
dependency from an instruction to itself.
Reviewers: atrick, hfinkel
Subscribers: MatzeB, mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D18093
llvm-svn: 266084
Yaxun Liu [Tue, 12 Apr 2016 15:46:24 +0000 (15:46 +0000)]
Verify commit right by adding a blank line to test/CodeGenOpenCL/address-spaces-conversions.cl.
llvm-svn: 266083
Than McIntosh [Tue, 12 Apr 2016 15:35:05 +0000 (15:35 +0000)]
Test commit, NFC.
Adds a blank line.
llvm-svn: 266082
Petar Jovanovic [Tue, 12 Apr 2016 15:28:16 +0000 (15:28 +0000)]
[mips] add assembler support for .set arch=octeon
This patch enables assembler support for .set arch=octeon.
It will fix issues with inline assembler when this directive is used.
Patch by Strahinja Petrovic.
Differential Revision: http://reviews.llvm.org/D18548
llvm-svn: 266081
Kuba Brecka [Tue, 12 Apr 2016 15:18:11 +0000 (15:18 +0000)]
[tsan] Fix a crash with dispatch_source_set_cancel_handler(NULL) on OS X
We need to handle the case when handler is NULL in dispatch_source_set_cancel_handler and similar interceptors.
Differential Revision: http://reviews.llvm.org/D18968
llvm-svn: 266080
Aaron Ballman [Tue, 12 Apr 2016 15:09:17 +0000 (15:09 +0000)]
Moving clang-test-depends into the Clang tests folder and moving vtables_blacklist into the Misc folder; NFC, this simply cleans up the generated solution so that these targets don't live in the root folder of the IDE.
llvm-svn: 266079
Aaron Ballman [Tue, 12 Apr 2016 15:09:14 +0000 (15:09 +0000)]
Moving llvm-test-depends and test-depends into the Tests folder; NFC, this simply cleans up the generated solution so that these targets don't live in the root folder of the IDE.
llvm-svn: 266078
Matt Arsenault [Tue, 12 Apr 2016 14:41:03 +0000 (14:41 +0000)]
LangRef: Update example syntax for atomic load instruction
llvm-svn: 266077
Rafael Espindola [Tue, 12 Apr 2016 14:35:26 +0000 (14:35 +0000)]
Make a test a bit stronger.
We were not testing that we handle addends in here.
llvm-svn: 266076
Matt Arsenault [Tue, 12 Apr 2016 14:05:11 +0000 (14:05 +0000)]
AMDGPU: Implement i64 global atomics
llvm-svn: 266075
Matt Arsenault [Tue, 12 Apr 2016 14:05:04 +0000 (14:05 +0000)]
AMDGPU: Add atomic_inc + atomic_dec intrinsics
These are different than atomicrmw add 1 because they have
an additional input value to clamp the result.
llvm-svn: 266074
Matt Arsenault [Tue, 12 Apr 2016 14:04:54 +0000 (14:04 +0000)]
AMDGPU: Remove trailing whitespace
llvm-svn: 266073
Pavel Labath [Tue, 12 Apr 2016 13:55:54 +0000 (13:55 +0000)]
Fixup TestFdLeak
this test was unintentionally XFAILed due to a change in the behavior of the expectedFailure
decorator. Fix that. Also, mark the test as debug-info independent while I'm in there.
llvm-svn: 266072
Matt Arsenault [Tue, 12 Apr 2016 13:38:18 +0000 (13:38 +0000)]
AMDGPU: Add volatile to test loads and stores
When the memory vectorizer is enabled, these tests break.
These tests don't really care about the memory instructions,
and it's easier to write check lines with the unmerged loads.
llvm-svn: 266071
Simon Pilgrim [Tue, 12 Apr 2016 13:31:01 +0000 (13:31 +0000)]
[X86] Regenerated avx512 calling convention test checks
llvm-svn: 266070
Johannes Doerfert [Tue, 12 Apr 2016 13:28:39 +0000 (13:28 +0000)]
Record wrapping assumptions early
Utilizing the record option for assumptions we can simplify the wrapping
assumption generation a lot. Additionally, we can now report locations
together with wrapping assumptions, though they might not be accurate yet.
llvm-svn: 266069
Johannes Doerfert [Tue, 12 Apr 2016 13:27:35 +0000 (13:27 +0000)]
Record assumptions first and add them later
There are three reasons why we want to record assumptions first before we
add them to the assumed/invalid context:
1) If the SCoP is not profitable or otherwise invalid without the
assumed/invalid context we do not have to compute it.
2) Information about the context are gathered rather late in the SCoP
construction (basically after we know all parameters), thus the user
might see overly complicated assumptions to be taken while they would
have been simplified later on.
3) Currently we cannot take assumptions at any point but have to wait,
e.g., for the domain generation to finish. This makes wrapping
assumptions much more complicated as they need to be and it will
have a similar effect on "signed-unsigned" assumptions later.
llvm-svn: 266068
Rafael Espindola [Tue, 12 Apr 2016 13:26:51 +0000 (13:26 +0000)]
Use DefinedSynthetic for _gp* symbols.
The test changes to put _gp* in the .got section matches what both bfd
and gold do.
llvm-svn: 266067
Johannes Doerfert [Tue, 12 Apr 2016 13:26:45 +0000 (13:26 +0000)]
Introduce and use MemoryAccess::getPwAff() [NFC]
llvm-svn: 266066
Johannes Doerfert [Tue, 12 Apr 2016 13:25:43 +0000 (13:25 +0000)]
Do not assume switch modeling optimizes a SCoP
llvm-svn: 266065
Rafael Espindola [Tue, 12 Apr 2016 13:23:27 +0000 (13:23 +0000)]
Simplify now that we always have a .got.
llvm-svn: 266064
Rafael Espindola [Tue, 12 Apr 2016 13:21:13 +0000 (13:21 +0000)]
Always create a .got on mips.
The _gp* family of symbols is defined as an offset in .got, and it is
not at all clear what should happen when .got is not defined.
This will allow some simplifications on how these symbols are handled.
llvm-svn: 266063
Rafael Espindola [Tue, 12 Apr 2016 12:30:25 +0000 (12:30 +0000)]
This reverts commit r266002, r266011 and r266016.
They broke the msan bot.
Original message:
Add __atomic_* lowering to AtomicExpandPass.
AtomicExpandPass can now lower atomic load, atomic store, atomicrmw,and
cmpxchg instructions to __atomic_* library calls, when the target
doesn't support atomics of a given size.
This is the first step towards moving all atomic lowering from clang
into llvm. When all is done, the behavior of __sync_* builtins,
__atomic_* builtins, and C11 atomics will be unified.
Previously LLVM would pass everything through to the ISelLowering
code. There, unsupported atomic instructions would turn into __sync_*
library calls. Because of that behavior, Clang currently avoids emitting
llvm IR atomic instructions when this would happen, and emits __atomic_*
library functions itself, in the frontend.
This change makes LLVM able to emit __atomic_* libcalls, and thus will
eventually allow clang to depend on LLVM to do the right thing.
It is advantageous to do the new lowering to atomic libcalls in
AtomicExpandPass, before ISel time, because it's important that all
atomic operations for a given size either lower to __atomic_*
libcalls (which may use locks), or native instructions which won't. No
mixing and matching.
At the moment, this code is enabled only for SPARC, as a
demonstration. The next commit will expand support to all of the other
targets.
Differential Revision: http://reviews.llvm.org/D18200
llvm-svn: 266062
Simon Dardis [Tue, 12 Apr 2016 12:22:45 +0000 (12:22 +0000)]
Revert "[mips] MIPSR6 Compact branch aliases"
This reverts commit r266055.
ps4-buildslave2 is highlighting a failure.
llvm-svn: 266061
Jonas Paulsson [Tue, 12 Apr 2016 12:07:23 +0000 (12:07 +0000)]
[SystemZ] Use LDE32 instead of LE, when Offset is small.
On z13, if eliminateFrameIndex() chooses LE (and not LEY), immediately
transform that LE to LDE32 to avoid partial register dependencies.
LEY should be generally preferred for big offsets over an expansion
into LAY + LDE32.
Reviewed by Ulrich Weigand.
llvm-svn: 266060
George Rimar [Tue, 12 Apr 2016 12:01:31 +0000 (12:01 +0000)]
[ELF] Removed redundant llvm-mc call. NFC.
llvm-svn: 266059
Pavel Labath [Tue, 12 Apr 2016 11:59:41 +0000 (11:59 +0000)]
Bump up timeout in TestGdbRemoteProcessInfo
the process info packet is slow, and sometimes it does not arrive on time when run on the android
emulator.
llvm-svn: 266058
Benjamin Kramer [Tue, 12 Apr 2016 11:49:52 +0000 (11:49 +0000)]
Remove unused diagnostics. NFC.
llvm-svn: 266057
Alexey Bataev [Tue, 12 Apr 2016 11:02:11 +0000 (11:02 +0000)]
[OPENMP 4.0] Support for 'linear' clause in 'declare simd' directive.
The linear clause declares one or more list items to be private to a SIMD lane and to have a linear relationship with respect to the iteration space of a loop.
'linear' '(' <linear-list> [ ':' <linear-step> ] ')'
When a linear-step expression is specified in a linear clause it must be
either a constant integer expression or an integer-typed parameter that is specified in a uniform clause on the directive.
The special this pointer can be used as if was one of the arguments to the function in any of the linear, aligned, or uniform clauses.
llvm-svn: 266056
Simon Dardis [Tue, 12 Apr 2016 10:41:53 +0000 (10:41 +0000)]
[mips] MIPSR6 Compact branch aliases
Summary:
Alias 'jic $reg, 0' to 'jrc $reg' and 'jialc $reg, 0' to 'jalrc $reg' like
binutils.
Reviewers: dsanders
Differential Revision: http://reviews.llvm.org/D18856
llvm-svn: 266055
Pavel Labath [Tue, 12 Apr 2016 10:06:37 +0000 (10:06 +0000)]
Skip a test in TestNamespaceLookup on linux to avoid a crash
llvm-svn: 266054
Johannes Doerfert [Tue, 12 Apr 2016 09:57:34 +0000 (09:57 +0000)]
Introduce an invalid context for each statement
Collect the error domain contexts (formerly in the ErrorDomainCtxMap)
for each statement in the new InvalidContext member variable. While
this commit is basically a [NFC] it is a first step to make hoisting
sound by allowing a more fine grained record of invalid contexts,
e.g., here on statement level.
llvm-svn: 266053
Alexey Bataev [Tue, 12 Apr 2016 09:35:56 +0000 (09:35 +0000)]
[OPENMP 4.0] Support for 'aligned' clause in 'declare simd' directive.
The aligned clause declares that the object to which each list item points is aligned to the number of bytes expressed in the optional parameter of the aligned clause.
'aligned' '(' <argument-list> [ ':' <alignment> ] ')'
The optional parameter of the aligned clause, alignment, must be a constant positive integer expression. If no optional parameter is specified, implementation-defined default alignments for SIMD instructions on the target platforms are assumed.
The special this pointer can be used as if was one of the arguments to the function in any of the linear, aligned, or uniform clauses.
llvm-svn: 266052
Johannes Doerfert [Tue, 12 Apr 2016 09:33:47 +0000 (09:33 +0000)]
Simplify SCEVAffinator code [NFC]
llvm-svn: 266051
Pavel Labath [Tue, 12 Apr 2016 09:06:08 +0000 (09:06 +0000)]
Revert "Restore the lazy initialization of ScriptInterpreterPython, which was lost as part of the SystemLifetimeManager work"
This change breaks python unit tests.
This reverts commit 266033.
llvm-svn: 266050
Stephan Bergmann [Tue, 12 Apr 2016 08:23:44 +0000 (08:23 +0000)]
Avoid GCC -fpermissive error about llvm::Mangler hidden by member named Mangler
llvm-svn: 266049
Michael Zuckerman [Tue, 12 Apr 2016 07:59:39 +0000 (07:59 +0000)]
[Clang][BuiltIn][avx512] Adding avx512 (shuf,sqrt{ss|sd},rsqrt ) builtin to clang
llvm-svn: 266048
Mehdi Amini [Tue, 12 Apr 2016 06:34:10 +0000 (06:34 +0000)]
Refactor the Internalize stage of libLTO in a separate file (NFC)
This is intended to be shared by the ThinLTOCodeGenerator.
Note that there is a change in the way the verifier is run, previously
it was ran as a Pass on the merged module during internalization.
While now the verifier is called explicitely on the merged module
outside of the internalize "pass pipeline".
What remains strange in the API is the fact that `DisableVerify` in
the API does not disable this initial verifier.
Differential Revision: http://reviews.llvm.org/D19000
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266047
Mehdi Amini [Tue, 12 Apr 2016 06:33:44 +0000 (06:33 +0000)]
Use StringSet instead of StringMap where it makes sense to in LTOCodeGenerator (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266046
Junmo Park [Tue, 12 Apr 2016 06:02:11 +0000 (06:02 +0000)]
Minor code cleanup. NFC.
llvm-svn: 266045
Matthias Gehre [Tue, 12 Apr 2016 05:45:13 +0000 (05:45 +0000)]
[clang-tidy] fix readability-avoid-const-params-in-decls creating invalid code in fix-its
Summary:
The Fix-Its for the added test cases were before:
-void F11(const unsigned int /*version*/);
+void F11(unsigned int int /*version*/);
-void F12(const bool b = true);
+void F12(_Bool true);
Reviewers: fowles, hokein, sbenza, alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D18993
llvm-svn: 266044
Matthias Gehre [Tue, 12 Apr 2016 05:43:18 +0000 (05:43 +0000)]
[ASTMatchers]: fix crash in hasReturnValue
Summary:
The crash was reproduced by the included test case. It was initially
found through a crash of clang-tidy's misc-misplaced-widening-cast
check.
Reviewers: klimek, alexfh
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D18991
llvm-svn: 266043
Saleem Abdulrasool [Tue, 12 Apr 2016 05:40:51 +0000 (05:40 +0000)]
Process: fix the build with certain kernel versions
The structure definitions are not provided, but we perform a sizeof operation of
them which causes a build failure. Include `asm/ptrace.h` to get the structure
definitions.
llvm-svn: 266042
Alexey Bataev [Tue, 12 Apr 2016 05:28:34 +0000 (05:28 +0000)]
[OPENMP 4.0] Support for 'uniform' clause in 'declare simd' directive.
OpenMP 4.0 defines clause 'uniform' in 'declare simd' directive:
'uniform' '(' <argument-list> ')'
The uniform clause declares one or more arguments to have an invariant value for all concurrent invocations of the function in the execution of a single SIMD loop.
The special this pointer can be used as if was one of the arguments to the function in any of the linear, aligned, or uniform clauses.
llvm-svn: 266041
Chuang-Yu Cheng [Tue, 12 Apr 2016 03:10:52 +0000 (03:10 +0000)]
[PPC64] Mark CR0 Live if PPCInstrInfo::optimizeCompareInstr Creates a Use of CR0
Resolve Bug 27046 (https://llvm.org/bugs/show_bug.cgi?id=27046).
The PPCInstrInfo::optimizeCompareInstr function could create a new use of
CR0, even if CR0 were previously dead. This patch marks CR0 live if a use of
CR0 is created.
Author: Tom Jablin (tjablin)
Reviewers: hfinkel kbarton cycheng
http://reviews.llvm.org/D18884
llvm-svn: 266040
Saleem Abdulrasool [Tue, 12 Apr 2016 03:05:03 +0000 (03:05 +0000)]
Basic: fix profiling with GNU EABI
The GNU profiling support indicates that the interface is `_mcount` rather than
`mcount`. Conditionalise the behaviour according to the `-meabi gnu` flag.
Resolves PR27311
llvm-svn: 266039
Chuang-Yu Cheng [Tue, 12 Apr 2016 03:04:44 +0000 (03:04 +0000)]
[PPC64] Use mfocrf in prologue when we only need to save 1 nonvolatile CR field
In the ELFv2 ABI, we are not required to save all CR fields. If only one
nonvolatile CR field is clobbered, use mfocrf instead of mfcr to
selectively save the field, because mfocrf has short latency compares to
mfcr.
Thanks Nemanja's invaluable hint!
Reviewers: nemanjai tjablin hfinkel kbarton
http://reviews.llvm.org/D17749
llvm-svn: 266038
Rafael Espindola [Tue, 12 Apr 2016 02:24:43 +0000 (02:24 +0000)]
Devide _gp in the same spot as other mips symbols. NFC.
The test changes are just because of the symbol order.
llvm-svn: 266037
Matthias Braun [Tue, 12 Apr 2016 02:16:15 +0000 (02:16 +0000)]
TargetLowering: Add missing doxygen group end.
The missing end was also confusing the '{', '}' matching heuristics in
vim.
llvm-svn: 266036
Matthias Braun [Tue, 12 Apr 2016 02:16:13 +0000 (02:16 +0000)]
AArch64: Drive-by cleanup
llvm-svn: 266035
George Burgess IV [Tue, 12 Apr 2016 01:44:13 +0000 (01:44 +0000)]
Attempt to make buildbot happier with r266032.
Apparently std::numeric_limits<unsigned>::max() isn't constexpr
everywhere yet.
llvm-svn: 266034
Enrico Granata [Tue, 12 Apr 2016 01:08:35 +0000 (01:08 +0000)]
Restore the lazy initialization of ScriptInterpreterPython, which was lost as part of the SystemLifetimeManager work
llvm-svn: 266033
George Burgess IV [Tue, 12 Apr 2016 01:05:35 +0000 (01:05 +0000)]
Add the allocsize attribute to LLVM.
`allocsize` is a function attribute that allows users to request that
LLVM treat arbitrary functions as allocation functions.
This patch makes LLVM accept the `allocsize` attribute, and makes
`@llvm.objectsize` recognize said attribute.
The review for this was split into two patches for ease of reviewing:
D18974 and D14933. As promised on the revisions, I'm landing both
patches as a single commit.
Differential Revision: http://reviews.llvm.org/D14933
llvm-svn: 266032
Devin Coughlin [Tue, 12 Apr 2016 00:53:26 +0000 (00:53 +0000)]
[analyzer] Fix assertion in ReturnVisitor for body-farm synthesized getters
Don't emit a path note marking the return site if the return statement does not
have a valid location. This fixes an assertion failure I introduced in r265839.
llvm-svn: 266031