OSDN Git Service
Xinliang David Li [Wed, 22 Jun 2016 23:20:59 +0000 (23:20 +0000)]
[PM]: LoopAccessInfo simple refactoring
To make definition of mov ctors easier.
Differential Revision: http://reviews.llvm.org/D21563
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273506
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 Jun 2016 22:42:24 +0000 (22:42 +0000)]
[pdb] Treat a stream size of ~0U as 0
My PDBs always have this size for stream 11. Not sure why.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273504
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 22 Jun 2016 22:19:08 +0000 (22:19 +0000)]
[MachO] Finish moving fat header swap functions to MachO.h
This is a follow-up to r273479. At the time I wrote r273479 I didn't connect the dots that the functions I was adding had to exist somewhere. Turns out, they do. This finishes moving the functions to MachO.h.
Existing MachO fat header tests like test/tools/llvm-readobj/Inputs/macho-universal-archive.x86_64.i386 execute this code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273502
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Wed, 22 Jun 2016 22:16:51 +0000 (22:16 +0000)]
[ImplicitNullChecks] Hoist trivial depdendencies if possible
When trying to convert a loading instruction into a FAULTING_LOAD, we
sometimes face code like this:
if %R10 is not null:
%R9<def> = MOV32ri Immediate
%R9<def, tied> = AND32rm %R9, 0x20(%R10)
else:
goto TRAP
In these cases we would like to use the AND32rm instruction as the
faulting operation by hoisting the "depedency" def-ing %R9 also above
the control flow, transforming the program into:
%R9<def> = MOV32ri Immediate
%R9<def, tied> = FAULTING_LOAD_OP(AND32rm %R9, 0x20(%R10), FailPath: TRAP)
This change teaches ImplicitNullChecks to do the above, when safe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273501
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 Jun 2016 22:09:17 +0000 (22:09 +0000)]
Use shouldAssumeDSOLocal.
With this it handle -fPIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273499
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 Jun 2016 21:56:34 +0000 (21:56 +0000)]
Extract a few variables to make 'if' smaller. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273497
91177308-0d34-0410-b5e6-
96231b3b80d8
Changpeng Fang [Wed, 22 Jun 2016 21:33:49 +0000 (21:33 +0000)]
AMDGPU/SI: Define an intrinsic to expose ds_swizzle_b32
Reviewers: tstellarAMD, arsenm
Differential Revision: http://reviews.llvm.org/D21533
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273496
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 22 Jun 2016 21:22:13 +0000 (21:22 +0000)]
[codeview] Write LF_UDT_SRC_LINE records (PR28251)
Differential Revision: http://reviews.llvm.org/D21621
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273495
91177308-0d34-0410-b5e6-
96231b3b80d8
Pawel Bylica [Wed, 22 Jun 2016 21:15:51 +0000 (21:15 +0000)]
Do not require __STDC_LIMIT_MACROS and others
Summary: Do not require __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS macros to be defined globally. They are not needed for C++11 compliant standard headers.
Reviewers: joerg, jyknight
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D21553
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273493
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 22 Jun 2016 21:01:19 +0000 (21:01 +0000)]
[CMake] LLVM_BINARY_DIR was not being properly set in LLVMConfig.cmake
LLVMConfig.cmake needs to set LLVM_BINARY_DIR differently based on whether or not it is the build directory or the install directory. The build directory just needs to set the value from the configuration, the install directory needs to set it to the install prefix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273479
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 22 Jun 2016 21:01:17 +0000 (21:01 +0000)]
[MachO] Adding a few missing swapStruct functions
These are just missing swap functions for handling endian conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273478
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 Jun 2016 20:59:17 +0000 (20:59 +0000)]
[codeview] Fix the alignment padding that we add to list records
Tweak the big-types.ll test case to catch this bug. We just need an
enumerator name that doesn't have a length that is a multiple of 4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273477
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 22 Jun 2016 20:48:15 +0000 (20:48 +0000)]
[IRObjectFile] Propagate .weak attribute correctly for ASM symbols.
PR: 28256
Differential Revision: http://reviews.llvm.org/D21616
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273474
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Wed, 22 Jun 2016 20:31:12 +0000 (20:31 +0000)]
Update header documentation for API deliberately made public
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273473
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 22 Jun 2016 20:29:42 +0000 (20:29 +0000)]
IR: Introduce Module::global_objects().
This is a convenience iterator that allows clients to enumerate the
GlobalObjects within a Module.
Also start using it in a few places where it is obviously the right thing
to use.
Differential Revision: http://reviews.llvm.org/D21580
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273470
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 22 Jun 2016 20:26:24 +0000 (20:26 +0000)]
AMDGPU: Run verifier after 2nd run of SIShrinkInstructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273469
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 22 Jun 2016 20:15:28 +0000 (20:15 +0000)]
AMDGPU: Fix verifier errors in SILowerControlFlow
The main sin this was committing was using terminator
instructions in the middle of the block, and then
not updating the block successors / predecessors.
Split the blocks up to avoid this and introduce new
pseudo instructions for branches taken with exec masking.
Also use a pseudo instead of emitting s_endpgm and erasing
it in the special case of a non-void return.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273467
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 22 Jun 2016 20:08:27 +0000 (20:08 +0000)]
[Hexagon] Add SDAG preprocessing step to expose shifted addressing modes
Transform: (store ch addr (add x (add (shl y c) e)))
to: (store ch addr (add x (shl (add y d) c))),
where e = (shl d c) for some integer d.
The purpose of this is to enable generation of loads/stores with
shifted addressing mode, i.e. mem(x+y<<#c). For that, the shift
value c must be 0, 1 or 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273466
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 22 Jun 2016 19:50:42 +0000 (19:50 +0000)]
[UpdateCompilerUsed] API rename and cleanup, suggested by Rafaael.
* UpdateCompilerUsed() -> updateCompilerUsed()
* ThinLTO doesn't use the API so we can remove the include
* Clean up unused #include <functional> from the header
* Rename #ifdef guard comment to be correct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273461
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Wed, 22 Jun 2016 19:26:44 +0000 (19:26 +0000)]
[MBFI]: Add a new suboption for graph viewer
-view-machine-block-freq-propagation-dags currently
support integer and fraction as the suboptions. This
patch adds the 'count' suboption to display actual
profile count if available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273460
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 22 Jun 2016 19:20:59 +0000 (19:20 +0000)]
[ValueTracking] improve ComputeNumSignBits for vector constants
This is similar to the computeKnownBits improvement in rL268479.
There's probably more we can do for vector logic instructions, but
this should let us see non-splat constant masking ops that can
become vector selects instead of and/andn/or sequences.
Differential Revision: http://reviews.llvm.org/D21610
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273459
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 22 Jun 2016 19:18:52 +0000 (19:18 +0000)]
[AArch64] Remove an overly aggressive assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273458
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 Jun 2016 19:09:14 +0000 (19:09 +0000)]
Start using shouldAssumeDSOLocal on Hexagon.
Include a token test showing that access to private is now the same as
to internal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273457
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Wed, 22 Jun 2016 19:03:26 +0000 (19:03 +0000)]
Preserve DebugInfo when replacing values in DAGCombiner
Recommiting after fixing over-aggressive assertion
[DAG] Previously debug values would transfer debuginfo for the selected
start node for a replacement which allows for debug to be dropped.
Push debug value transfer to occur with node/value replacement in
SelectionDAG, remove now extraneous transfers of debug values.
This refixes PR9817 which was being incompletely checked in the
testsuite.
Reviewers: jyknight
Subscribers: dblaikie, llvm-commits
Differential Revision: http://reviews.llvm.org/D21037
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273456
91177308-0d34-0410-b5e6-
96231b3b80d8
Wei Ding [Wed, 22 Jun 2016 18:51:08 +0000 (18:51 +0000)]
AMDGPU: Add convergent flag to INLINEASM instruction.
Differential Revision: http://reviews.llvm.org/D21214
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273455
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 Jun 2016 18:31:14 +0000 (18:31 +0000)]
[codeview] Add IntroducingVirtual debug info flag
CodeView needs to know if a virtual method was introduced in the current
class, and base classes may not have complete type information, so we
need to thread this bit through from the frontend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273453
91177308-0d34-0410-b5e6-
96231b3b80d8
Jason Henline [Wed, 22 Jun 2016 18:01:11 +0000 (18:01 +0000)]
Removing whitespace from test commit rL273447
Undoing the trivial change I introduced in rL273447.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273449
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 22 Jun 2016 17:47:39 +0000 (17:47 +0000)]
AMDGPU: Make FrameLowering stack alignment 16
We don't need it to be that high. The natural alignment
for a single workitem's stack is 16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273448
91177308-0d34-0410-b5e6-
96231b3b80d8
Jason Henline [Wed, 22 Jun 2016 17:40:02 +0000 (17:40 +0000)]
Add whitespace to check commit access
No functional changes. Just adding whitespace in a comment in order to
check that I am able to push a commit to the repo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273447
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 Jun 2016 17:32:59 +0000 (17:32 +0000)]
[codeview] Fix trivial bug in OneMethodRecord::isIntroducingVirtual
These should be equality comparisons. Fixes assertions while
self-hosting clang with codeview debug info.
Ultimately this is going to be covered by real tests for virtual method
emission, so I'm not adding a "don't crash on this input" test that I'll
remove soon afterwards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273446
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Wed, 22 Jun 2016 17:30:58 +0000 (17:30 +0000)]
[asan] Do not instrument accesses to profiling globals
It's only useful to asan-itize profiling globals while debugging llvm's
profiling instrumentation passes. Enabling asan along with instrprof or
gcov instrumentation shouldn't incur extra overhead.
This patch is in the same spirit as r264805 and r273202, which disabled
tsan instrumentation of instrprof/gcov globals.
Differential Revision: http://reviews.llvm.org/D21541
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273444
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 Jun 2016 17:15:28 +0000 (17:15 +0000)]
[codeview] Defer emission of all referenced complete records
This is the motivating example:
struct B { int b; };
struct A { B *b; };
int f(A *p) { return p->b->b; }
Clang emits complete types for both A and B because they are required to
be complete, but our CodeView emission would only emit forward
declarations of A and B. This was a consequence of the fact that the A*
type must reference the forward declaration of A, which doesn't
reference B at all.
We can't eagerly emit complete definitions of A and B when we request
the forward declaration's type index because of recursive types like
linked lists. If we did that, our stack usage could get out of hand, and
it would be possible to lower a type while attempting to lower a type,
and we would need to double check if our type is already present in the
TypeIndexMap after all recursive getTypeIndex calls.
Instead, defer complete type emission until after all type lowering has
completed. This ensures that all referenced complete types are emitted,
and that type lowering is not re-entrant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273443
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Wed, 22 Jun 2016 17:12:12 +0000 (17:12 +0000)]
[BFI]: NFC refactoring
move getBlockProfileCount implementation to the
base class so that MBFI can share too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273442
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhan Jun Liau [Wed, 22 Jun 2016 16:16:27 +0000 (16:16 +0000)]
[SystemZ] Recognize RISBG opportunities involving a truncate
Summary:
Recognize RISBG opportunities where the end result is narrower than the
original input - where a truncate separates the shift/and operations.
The motivating case is some code in postgres which looks like:
srlg %r2, %r0, 11
nilh %r2, 255
Reviewers: uweigand
Author: RolandF
Differential Revision: http://reviews.llvm.org/D21452
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273433
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 22 Jun 2016 16:07:10 +0000 (16:07 +0000)]
[Hexagon] Handle expansion of cmpxchg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273432
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 Jun 2016 16:06:42 +0000 (16:06 +0000)]
[codeview] Remove ClassInfoMap
From a design perspective, complete record type emission should not
depend on information from other complete record types.
Currently this map is unused, and needlessly accumulates data throughout
compilation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273431
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Wed, 22 Jun 2016 16:04:51 +0000 (16:04 +0000)]
[MBFI]: show branch probability in DOT graph
Differential Revision: http://reviews.llvm.org/D21596
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273430
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 22 Jun 2016 15:44:25 +0000 (15:44 +0000)]
llvm-ar: reduce some duplication, NFC
Improve the previous change by using a local function to reduce the duplication
of the object file scanning. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273429
91177308-0d34-0410-b5e6-
96231b3b80d8
Artur Pilipenko [Wed, 22 Jun 2016 15:16:06 +0000 (15:16 +0000)]
Upgrade old memset/memcpy signatures (without isVolatile argument) in tests
We no longer have corresponding code in autoupgrade and the vast majority of the tests were fixed long time ago. Fix the remaining few. One of the verifier test cases is marked as XFAIL because it was passing only because the signature was incorrect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273428
91177308-0d34-0410-b5e6-
96231b3b80d8
Artur Pilipenko [Wed, 22 Jun 2016 14:56:33 +0000 (14:56 +0000)]
NFC. Move Verifier::verifyIntrinsicType to Intrinsics.h
Move Verifier::verifyIntrinsicType to Intrinsics::matchIntrinsicsType. Will be used to accumulate overloaded types of a given intrinsic by the upcoming patch to fix intrinsics names when overloaded types are renamed.
Reviewed By: reames
Differential Revision: http://reviews.llvm.org/D19372
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273424
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 22 Jun 2016 14:18:04 +0000 (14:18 +0000)]
[InstSimplify] add ashr tests including vector types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273421
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 22 Jun 2016 14:07:46 +0000 (14:07 +0000)]
[SLPVectorizer][X86] Added ceil/floor/nearbyint/rint/trunc vectorization tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273420
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 22 Jun 2016 14:00:16 +0000 (14:00 +0000)]
[InstSimplify] regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273419
91177308-0d34-0410-b5e6-
96231b3b80d8
George Rimar [Wed, 22 Jun 2016 13:43:38 +0000 (13:43 +0000)]
[llvm-readobj] - Teach llvm-readobj to print dependencies of SHT_GNU_verdef and refactor dumping method.
This patch changes single method of llvm-readobj.
It teaches SHT_GNU_verdef dumper to print version dependencies,
also it removes few fields from output that can be dumped with other keys
and slightly refactors code.
Testcase was also modified to match the changes.
Change is required for testcases of upcoming lld patches.
Differential revision: http://reviews.llvm.org/D21552
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273417
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 22 Jun 2016 12:58:15 +0000 (12:58 +0000)]
Regenerated test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273404
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 22 Jun 2016 12:54:25 +0000 (12:54 +0000)]
[SDAG] Remove FixedArgs parameter from CallLoweringInfo::setCallee
The setCallee function will set the number of fixed arguments based
on the size of the argument list. The FixedArgs parameter was often
explicitly set to 0, leading to a lack of consistent value for non-
vararg functions.
Differential Revision: http://reviews.llvm.org/D20376
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273403
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 Jun 2016 12:44:16 +0000 (12:44 +0000)]
Delete more dead code.
Found by gcc 6.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273402
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 22 Jun 2016 04:52:43 +0000 (04:52 +0000)]
[LTO] Move UpdateCompilerUsed.h from lib/ to include/
I plan to use it in lld soon.
Differential Revision: http://reviews.llvm.org/D21575
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273380
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 22 Jun 2016 04:47:42 +0000 (04:47 +0000)]
[X86] Remove GCC builtins from masked integer cmp and ucmp instrinsics so we can emit native IR in clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273376
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 22 Jun 2016 04:03:28 +0000 (04:03 +0000)]
llvm-ar: be more clever about default format
Try to be more clever about selecting the default format. When an existing
archive is used, use the type of the archive to determine the format. When
existing members are present, use the first member's format to determine the
format to use. If we are creating an empty archive (MRI mode) or are adding
non-object members, default to the current behaviour of using the host type due
to the lack of a better alternative. This aids in cross-compilation on Darwin
to non-Darwin platforms which rely on GNU format archives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273373
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Wed, 22 Jun 2016 03:30:24 +0000 (03:30 +0000)]
[OCaml] Add functions for accessing metadata nodes.
Patch by Xinyu Zhuang.
Differential Revision: http://reviews.llvm.org/D19309
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273370
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Wed, 22 Jun 2016 02:12:54 +0000 (02:12 +0000)]
Add an option to enable MBFI dot viewer for a given function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273366
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 22 Jun 2016 01:53:49 +0000 (01:53 +0000)]
AMDGPU: Fix gcc warnings
Mostly removing dead code. Apparently gcc's warning
for unused functions is better
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273363
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 Jun 2016 01:32:56 +0000 (01:32 +0000)]
[codeview] Improve names of types in scopes and member function ids
We now include namespace scope info in LF_FUNC_ID records and we emit
LF_MFUNC_ID records for member functions as we should.
Class names are now fully qualified, which is what MSVC does.
Add a little bit of scaffolding to handle ThisAdjustment when it arrives
in DISubprogram.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273358
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 Jun 2016 01:17:05 +0000 (01:17 +0000)]
[codeview] Add missing test from r273294
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273355
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Wed, 22 Jun 2016 00:15:52 +0000 (00:15 +0000)]
[asan] Do not instrument pointers with address space attributes
Do not instrument pointers with address space attributes since we cannot track
them anyway. Instrumenting them results in false positives in ASan and a
compiler crash in TSan. (The compiler should not crash in any case, but that's
a different problem.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273339
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Tue, 21 Jun 2016 23:42:48 +0000 (23:42 +0000)]
IR: Allow metadata attachments on declarations, and fix lazy loaded metadata issue with globals.
This change is motivated by an upcoming change to the metadata representation
used for CFI. The indirect function call checker needs type information for
external function declarations in order to correctly generate jump table
entries for such declarations. We currently associate such type information
with declarations using a global metadata node, but I plan [1] to move all
such metadata to global object attachments.
In bitcode, metadata attachments for function declarations appear in the
global metadata block. This seems reasonable to me because I expect metadata
attachments on declarations to be uncommon. In the long term I'd also expect
this to be the case for CFI, because we'd want to use some specialized bitcode
format for this metadata that could be read as part of the ThinLTO thin-link
phase, which would mean that it would not appear in the global metadata block.
To solve the lazy loaded metadata issue I was seeing with D20147, I use the
same bitcode representation for metadata attachments for global variables as I
do for function declarations. Since there's a use case for metadata attachments
in the global metadata block, we might as well use that representation for
global variables as well, at least until we have a mechanism for lazy loading
global variables.
In the assembly format, the metadata attachments appear after the "declare"
keyword in order to avoid a parsing ambiguity.
[1] http://lists.llvm.org/pipermail/llvm-dev/2016-June/100462.html
Differential Revision: http://reviews.llvm.org/D21052
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273336
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Tue, 21 Jun 2016 23:36:12 +0000 (23:36 +0000)]
Clang format change /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273335
91177308-0d34-0410-b5e6-
96231b3b80d8
Artem Belevich [Tue, 21 Jun 2016 23:10:37 +0000 (23:10 +0000)]
[build] Fixed build break for OCaml bindings.
After r273302 LLVM_SYSTEM_LIBS may have entries that already have
-l prefix and we need to deal with that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273333
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 21 Jun 2016 23:01:17 +0000 (23:01 +0000)]
Make DeadMachineInstructionElim preserve CFG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273330
91177308-0d34-0410-b5e6-
96231b3b80d8
Haicheng Wu [Tue, 21 Jun 2016 22:47:56 +0000 (22:47 +0000)]
[Kryo] Enable loop prefetcher.
Differential Revision: http://reviews.llvm.org/D21535
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273329
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Tue, 21 Jun 2016 22:22:33 +0000 (22:22 +0000)]
[Coverage] Clarify ownership of a MemoryBuffer in the reader (NFC)
Pass a `MemoryBuffer &` to BinaryCoverageReader::create() instead of a
`std::unique_ptr<MemoryBuffer> &`. This makes it easier to reason about
the ownership of the buffer at a glance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273326
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Tue, 21 Jun 2016 21:55:01 +0000 (21:55 +0000)]
Update llvm-obdump(1) to print FAT_MAGIC_64 for Darwin’s 64-bit universal files
with the -macho and -universal-headers flags.
Just a follow on to r273207, I missed updating the printing of the fat magic
number when the universal file is a 64-bit universal file.
rdar://
26899493
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273324
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Jun 2016 21:51:41 +0000 (21:51 +0000)]
Delete more dead code.
Found by gcc 6.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273322
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Tue, 21 Jun 2016 20:46:22 +0000 (20:46 +0000)]
AMDGPU: Remove gcc builtin names from workitem intrinsics
We'll need to emit these manually in clang to add range metadata
Reviewers: arsenm
Differential Revision: http://reviews.llvm.org/D20691
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273318
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Tue, 21 Jun 2016 20:46:20 +0000 (20:46 +0000)]
AMDGPU: Add implicitarg.ptr intrinsic.
Points to the start of implicit arguments (appended after explicit arguments)
Differential Revision: http://reviews.llvm.org/D20297
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273317
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Tue, 21 Jun 2016 20:41:40 +0000 (20:41 +0000)]
[X86] Make arithmetic operations cost model test saner. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273316
91177308-0d34-0410-b5e6-
96231b3b80d8
Artem Belevich [Tue, 21 Jun 2016 20:30:26 +0000 (20:30 +0000)]
[NVPTX] Improve lowering of byval args of device functions.
Avoid unnecessary spills of such vars to local space on SASS level and
pointer space conversion.
Instead, make a local copy with appropriate addrspacecasts and let
LLVM optimize them away when possible.
This allows loading value of the argument using [symbol+offset]
instead of converting argument to general space pointer and using it
for indexing (which also implicitly converts param space pointer to
local space one on SASS level and triggers copying of argument into
local space in the process).
This reduces call overhead, uses less registers and reduces overall
SASS size by 2-4%.
Differential Review: http://reviews.llvm.org/D21421
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273313
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Jun 2016 20:09:22 +0000 (20:09 +0000)]
Add back some dead code.
It was there just to avoid warnings. Add a LLVM_ATTRIBUTE_UNUSED
attribute so that it doesn't produce warnings with gcc 6.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273308
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Jun 2016 19:48:12 +0000 (19:48 +0000)]
Delete some dead code.
Found by gcc 6.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273303
91177308-0d34-0410-b5e6-
96231b3b80d8
Artem Belevich [Tue, 21 Jun 2016 19:34:40 +0000 (19:34 +0000)]
[build] Make sure to link main executable with pthreads
Otherwise it gets linked in by one of the dependencies of shared
libraries which may be too late and we end up with weird crashes in
std::call_once().
Differential Revision: http://reviews.llvm.org/D21478
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273302
91177308-0d34-0410-b5e6-
96231b3b80d8
Easwaran Raman [Tue, 21 Jun 2016 19:29:49 +0000 (19:29 +0000)]
Fix PR28219: Use profile summary from reader and not compute it
Differentiaal revision: http://reviews.llvm.org/D21546
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273301
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Tue, 21 Jun 2016 18:39:20 +0000 (18:39 +0000)]
Add MemoryAccess creation and PHI creation APIs to MemorySSA
Reviewers: george.burgess.iv, gberry, hfinkel
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D21463
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273295
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 21 Jun 2016 18:33:01 +0000 (18:33 +0000)]
[codeview] Add support for splitting field list records over 64KB
The basic structure is that once a list record goes over 64K, the last
subrecord of the list is an LF_INDEX record that refers to the next
record. Because the type record graph must be toplogically sorted, this
means we have to emit them in reverse order. We build the type record in
order of declaration, so this means that if we don't want extra copies,
we need to detect when we were about to split a record, and leave space
for a continuation subrecord that will point to the eventual split
top-level record.
Also adds dumping support for these records.
Next we should make sure that large method overload lists work properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273294
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Tue, 21 Jun 2016 17:19:28 +0000 (17:19 +0000)]
llvm-ar: correct typo
Default was misspelt. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273287
91177308-0d34-0410-b5e6-
96231b3b80d8
Silviu Baranga [Tue, 21 Jun 2016 17:15:49 +0000 (17:15 +0000)]
[AArch64] Fix merge-store.ll regression test after r273271
r273271 changed the RUN line of the regression test to use
-march=cyclone instead of -mtriple=aarch64-none-none.
This caused a change in the output syntax for the ext
instruction, causing the test to fail. Change this test
back to using -mtriple=aarch64-none-none.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273286
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Tue, 21 Jun 2016 16:16:52 +0000 (16:16 +0000)]
Fix typo, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273284
91177308-0d34-0410-b5e6-
96231b3b80d8
Etienne Bergeron [Tue, 21 Jun 2016 15:58:55 +0000 (15:58 +0000)]
[StackProtector] Fix computation of GSCookieOffset and EHCookieOffset with SEH4
Summary:
Fix the computation of the offsets present in the scopetable when using the
SEH (__except_handler4).
This patch added an intrinsic to track the position of the allocation on the
stack of the EHGuard. This position is needed when producing the ScopeTable.
```
struct _EH4_SCOPETABLE {
DWORD GSCookieOffset;
DWORD GSCookieXOROffset;
DWORD EHCookieOffset;
DWORD EHCookieXOROffset;
_EH4_SCOPETABLE_RECORD ScopeRecord[1];
};
struct _EH4_SCOPETABLE_RECORD {
DWORD EnclosingLevel;
long (*FilterFunc)();
union {
void (*HandlerAddress)();
void (*FinallyFunc)();
};
};
```
The code to generate the EHCookie is added in `X86WinEHState.cpp`.
Which is adding these instructions when using SEH4.
```
Lfunc_begin0:
# BB#0: # %entry
pushl %ebp
movl %esp, %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $28, %esp
movl %ebp, %eax <<-- Loading FramePtr
movl %esp, -36(%ebp)
movl $-2, -16(%ebp)
movl $L__ehtable$use_except_handler4_ssp, %ecx
xorl ___security_cookie, %ecx
movl %ecx, -20(%ebp)
xorl ___security_cookie, %eax <<-- XOR FramePtr and Cookie
movl %eax, -40(%ebp) <<-- Storing EHGuard
leal -28(%ebp), %eax
movl $__except_handler4, -24(%ebp)
movl %fs:0, %ecx
movl %ecx, -28(%ebp)
movl %eax, %fs:0
movl $0, -16(%ebp)
calll _may_throw_or_crash
LBB1_1: # %cont
movl -28(%ebp), %eax
movl %eax, %fs:0
addl $28, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
retl
```
And the corresponding offset is computed:
```
Luse_except_handler4_ssp$parent_frame_offset = -36
.p2align 2
L__ehtable$use_except_handler4_ssp:
.long -2 # GSCookieOffset
.long 0 # GSCookieXOROffset
.long -40 # EHCookieOffset <<----
.long 0 # EHCookieXOROffset
.long -2 # ToState
.long _catchall_filt # FilterFunction
.long LBB1_2 # ExceptionHandler
```
Clang is not yet producing function using SEH4, but it's a work in progress.
This patch is a step toward having a valid implementation of SEH4.
Unfortunately, it is not yet fully working. The EH registration block is not
allocated at the right offset on the stack.
Reviewers: rnk, majnemer
Subscribers: llvm-commits, chrisha
Differential Revision: http://reviews.llvm.org/D21231
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273281
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Tue, 21 Jun 2016 15:55:18 +0000 (15:55 +0000)]
[AArch64] Change the preferred alignment for char and short to word alignment
Differential Revision: http://reviews.llvm.org/D21414
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273279
91177308-0d34-0410-b5e6-
96231b3b80d8
Silviu Baranga [Tue, 21 Jun 2016 15:53:54 +0000 (15:53 +0000)]
[AArch64] Restore codegen for AArch64 Cortex-A72/A73 after NFCI
Summary:
Code generation for Cortex-A72/Cortex-A73 was accidentally changed
by r271555, which was a NFCI. The isCortexA57() predicate was not true
for Cortex-A72/Cortex-A73 before r271555 (since it was checking the CPU
string). Because Cortex-A72/Cortex-A73 inherit all features from Cortex-A57,
all decisions previously guarded by isCortexA57() are now taken.
This change restores the behaviour before r271555 by adding separate
ProcA72/ProcA73, which have the required features to preserve code
generation.
Reviewers: kristof.beyls, aadg, mcrosier, rengolin
Subscribers: mcrosier, llvm-commits, aemerson, t.p.northover, MatzeB, rengolin
Differential Revision: http://reviews.llvm.org/D21182
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273277
91177308-0d34-0410-b5e6-
96231b3b80d8
Etienne Bergeron [Tue, 21 Jun 2016 15:21:04 +0000 (15:21 +0000)]
fix indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273274
91177308-0d34-0410-b5e6-
96231b3b80d8
Silviu Baranga [Tue, 21 Jun 2016 15:16:34 +0000 (15:16 +0000)]
[AArch64] Switch regression tests to test features not CPUs
Summary:
We have switched to using features for all heuristics, but
the tests for these are still using -mcpu, which means we
are not directly testing the features.
This converts at least some of the existing regression tests
to use the new features.
This still leaves the following features untested:
merge-narrow-ld
predictable-select-expensive
alternate-sextload-cvt-f32-pattern
disable-latency-sched-heuristic
Reviewers: mcrosier, t.p.northover, rengolin
Subscribers: MatzeB, aemerson, llvm-commits, rengolin
Differential Revision: http://reviews.llvm.org/D21288
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273271
91177308-0d34-0410-b5e6-
96231b3b80d8
Etienne Bergeron [Tue, 21 Jun 2016 15:07:29 +0000 (15:07 +0000)]
This is part of the effort for asan to support Windows 64 bit.
The large offset is being tested on Windows 10 (which has larger usable
virtual address space than Windows 8 or earlier)
Patch by: Wei Wang
Differential Revision: http://reviews.llvm.org/D21523
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273269
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 21 Jun 2016 14:56:24 +0000 (14:56 +0000)]
[codeview] Fix DenseMap pointer invalidation bug
When you have a map holding a unique_ptr, hold a reference to the raw
pointer instead of the unique pointer. The unique_ptr will be moved on
rehash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273268
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 21 Jun 2016 14:37:39 +0000 (14:37 +0000)]
Strip trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273264
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 21 Jun 2016 14:24:48 +0000 (14:24 +0000)]
Switch to using an API that handles non-ASCII paths appropriately on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273262
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Jun 2016 14:21:53 +0000 (14:21 +0000)]
Define a isPositionIndependent helper for ARMAsmPrinter. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273261
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Tue, 21 Jun 2016 12:29:03 +0000 (12:29 +0000)]
[arm+x86] Make GNU variants behave like GNU w.r.t combining sin+cos into sincos.
Summary:
canCombineSinCosLibcall() would previously combine sin+cos into sincos for
GNUX32/GNUEABI/GNUEABIHF regardless of whether UnsafeFPMath were set or not.
However, GNU would only combine them for UnsafeFPMath because sincos does not
set errno like sin and cos do. It seems likely that this is an oversight.
Reviewers: t.p.northover
Subscribers: t.p.northover, aemerson, llvm-commits, rengolin
Differential Revision: http://reviews.llvm.org/D21431
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273259
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Tue, 21 Jun 2016 12:10:11 +0000 (12:10 +0000)]
reverted the prev commit due to assertion failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273258
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Tue, 21 Jun 2016 11:32:01 +0000 (11:32 +0000)]
Fixed consecutive memory access detection in Loop Vectorizer.
It did not handle correctly cases without GEP.
The following loop wasn't vectorized:
for (int i=0; i<len; i++)
*to++ = *from++;
I use getPtrStride() to find Stride for memory access and return 0 is the Stride is not 1 or -1.
Differential revision: http://reviews.llvm.org/D20789
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273257
91177308-0d34-0410-b5e6-
96231b3b80d8
Junmo Park [Tue, 21 Jun 2016 08:09:58 +0000 (08:09 +0000)]
[TargetSchedule] Use 'isOutOfOrder' as possible to avoid magic number. NFC.
Summary:
Using isOutOfOrder makes the code more clear.
Reviewers: rengolin, atrick, hfinkel.
Differential Revision: http://reviews.llvm.org/D21548
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273255
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 21 Jun 2016 07:37:32 +0000 (07:37 +0000)]
[AVX512] Add patterns for any-extending a mask that use the def of KMOVW/KMOVB without going through an EXTRACT_SUBREG and a MOVZX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273253
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 21 Jun 2016 07:37:27 +0000 (07:37 +0000)]
[AVX512] Use update_llc_test_checks.py to regenerate a test in preparation for a future commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273252
91177308-0d34-0410-b5e6-
96231b3b80d8
James Y Knight [Tue, 21 Jun 2016 05:40:41 +0000 (05:40 +0000)]
Revert "Change RelaxELFRelocations for llc."
This reverts commit r273019.
From email I sent to list:
> I don't think this makes sense. Either the linker you're using supports
> this feature, or it doesn't. Having it enabled for llc if your linker
> doesn't support it is not fun.
>
> Further note that this also affects basically all other code using llvm
> libraries -- other than Clang, which explicitly sets it back to false by
> default, unless you set the ENABLE_X86_RELAX_RELOCATIONS cmake flag to
> true.
>
> If you want to enable the relax mode across all llvm tools in some
> circumstances, I think it should be via moving the cmake flag from clang
> down into llvm.
>
> I'm going to revert this commit, since I both think it intrinsically
> doesn't make sense to do this, and because it's breaking some of our
> tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273245
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 21 Jun 2016 05:10:24 +0000 (05:10 +0000)]
Replace silly uses of 'signed' with 'int'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273244
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 21 Jun 2016 04:32:21 +0000 (04:32 +0000)]
[TargetLibraryInfo] Reduce code duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273241
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 21 Jun 2016 03:53:24 +0000 (03:53 +0000)]
[AVX512] Remove the masked vpcmpeq/vcmpgt intrinsics and autoupgrade them to native icmps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273240
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 21 Jun 2016 03:24:03 +0000 (03:24 +0000)]
TableGen/CodeGenSchedule: Move some getAllDerivedDefinitions() calls out of inner loops
This cuts the runtime of the two slowest tblgen invocations in aarch64
in half for me...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273235
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 21 Jun 2016 03:05:40 +0000 (03:05 +0000)]
[X86] Pre-allocate SmallVector instead of using push_back in a loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273234
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Tue, 21 Jun 2016 02:39:08 +0000 (02:39 +0000)]
clang format change /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273233
91177308-0d34-0410-b5e6-
96231b3b80d8