Commit Graph

81630 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith
0567cb7e1a DI: Remove dead code: getDICompositeType()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243158 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 20:46:46 +00:00
Duncan P. N. Exon Smith
88c307a010 AsmPrinter: Use DICompositeType in updateAcceleratorTables(), NFC
`DISubroutineType` is impossible at this `dyn_cast` site, since we're
only dealing with named types and `DISubroutineType` cannot be named.
Strengthen the `dyn_cast` to `DICompositeType`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243157 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 20:45:26 +00:00
Alex Lorenz
dfe0e536ee MIR Serialization: Serialize the simple virtual register allocation hints.
This commit serializes the virtual register allocations hints of type 0.
These hints specify the preferred physical registers for allocations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243156 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 20:35:40 +00:00
Duncan P. N. Exon Smith
7b464ae8b9 DI: Remove DIDerivedTypeBase
Remove an unnecessary (and confusing) common subclass for
`DIDerivedType` and `DICompositeType`.  These classes aren't really
related, and even in the old debug info hierarchy, there was a
long-standing FIXME to separate them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243152 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 20:16:36 +00:00
Duncan P. N. Exon Smith
b2c91c5ecd Verifier: Sink filename check into visitMDCompositeType(), NFC
We really only want to check this for unions and classes (all the other
tags have been ruled out), so simplify the check and move it to the
right place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243150 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 19:57:19 +00:00
Duncan P. N. Exon Smith
cb21505064 Verifier: Remove unnecessary references to DW_TAG_subroutine_type, NFC
Remove unnecessary references to `DW_TAG_subroutine_type` in
`visitDICompositeType()` and `visitDIDerivedTypeBase()`, since
`visitDISubroutineType()` doesn't call either of those (and shouldn't,
since subroutine types are really quite special).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243149 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 19:52:18 +00:00
Duncan P. N. Exon Smith
18673740dc DI: Clarify isUnsignedDIType(), NFC
Refactor `isUnsignedDIType()` to deal with `DICompositeType` explicitly.
Since `DW_TAG_subroutine_type` isn't handled here (the assertions about
tags rule it out), this allows strengthening the `dyn_cast` to
`DIDerivedType`.

Besides making the code clearer, this it removes a use of
`DIDerivedTypeBase`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243148 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 19:42:12 +00:00
Pete Cooper
62eb62e6f5 Add const to some Type* parameters which didn't need to be mutable. NFC.
We were only getting the size of the type which doesn't need to modify
the type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243146 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 19:19:26 +00:00
Diego Novillo
8cae9a32fc Remove unused variable. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243145 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 19:18:32 +00:00
Duncan P. N. Exon Smith
c63e16a6d4 DI: Strengthen some dyn_casts to DIDerivedType, NFC
The surrounding code proves in both cases that these must be
`DIDerivedType` if they're `DIDerivedTypeBase`, so strengthen the
`dyn_cast`s to the more specific type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243143 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 19:17:20 +00:00
Jingyue Wu
ab0a70d3a3 Remove the user-count threshold when analyzing read attributes
Summary:
This threshold limited FunctionAttrs ability to prove arguments to be read-only. 
In NVPTX, a specialized instruction ld.global.nc can be used to load memory
with non-coherent texture cache. We notice that in SHOC [1] benchmark, some
function arguments are not marked with readonly because FunctionAttrs reaches
a hardcoded threshold when analysis uses.

Removing this threshold won't cause significant regression in compilation time, because the worst-case time complexity of the algorithm is still O(# of instructions) for each parameter.

Patched by Xuetian Weng.  

[1] https://github.com/vetter/shoc

Reviewers: nlewycky, jingyue, nicholas

Subscribers: nicholas, test, llvm-commits

Differential Revision: http://reviews.llvm.org/D11311

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243141 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 19:05:53 +00:00
Philip Reames
ec2871f730 [RewriteStatepointsForGC] Adjust naming scheme to be more stable
The names for instructions inserted were previous dependent on iteration order.  By deriving the names from the original instructions, we can avoid instability in tests without resorting to ordered traversals.  It also makes the IR mildly easier to read at large scale.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243140 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 19:01:39 +00:00
Duncan P. N. Exon Smith
e4a9f1b6e7 DI: Strengthen block-byref cast to DIDerivedType, NFC
This code is visiting the members of a block-byref, and we know those
are all `DIDerivedType`.  Strengthen the cast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243138 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 18:58:32 +00:00
Pete Cooper
2914cbf164 Use foreach loops for StructType::elements(). NFC.
We had a few places where we did

for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {

but those could instead do

for (auto *EltTy : STy->elements()) {

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243136 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 18:55:49 +00:00
Pete Cooper
c653b44276 Add const to a bunch of Type* in DataLayout. NFC.
Almost all methods in DataLayout took mutable pointers but didn't need to.
These were only accessing constant methods of the types, or using the Type*
to key a map.  Neither of these needs a mutable pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243135 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 18:29:09 +00:00
Duncan P. N. Exon Smith
a012f0dcc4 DI: Only DICompositeType has getElements(), NFC
There is an assertion inside `DICompositeTypeBase::getElements()` that
`this` is not a `DISubroutineType`, leaving only `DICompositeType`.
Make that clear at the call sites.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243134 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 18:17:17 +00:00
Alex Lorenz
56cf65b377 MIR Parser: Run the machine verifier after initializing machine functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243128 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 17:44:49 +00:00
Lang Hames
8530ec85c1 [RuntimeDyld] MachO: Add support for ARM scattered vanilla relocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243126 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 17:40:04 +00:00
Igor Breger
a1692b30cb AVX-512: Implemented encoding , DAG lowering and intrinsics for Integer Truncate with/without saturation
Added tests for DAG lowering ,encoding and intrinsic

Differential Revision: http://reviews.llvm.org/D11218

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243122 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 17:24:15 +00:00
Mehdi Amini
15e1e7f179 Remove access to the DataLayout in the TargetMachine
Summary:
Replace getDataLayout() with a createDataLayout() method to make
explicit that it is intended to create a DataLayout only and not
accessing it for other purpose.

This change is the last of a series of commits dedicated to have a
single DataLayout during compilation by using always the one owned
by the module.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits, rafael, yaron.keren

Differential Revision: http://reviews.llvm.org/D11103

(cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea)

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243114 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 16:04:22 +00:00
Sanjay Patel
87663dbefa fix wrong comment; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243113 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 16:02:14 +00:00
Luke Cheeseman
67b17f9ff8 [ARM] - Fix lowering of shufflevectors in AArch32
Some shufflevectors are currently being incorrectly lowered in the AArch32
backend as the existing checks for detecting the NEON operations from the
shufflevector instruction expects the shuffle mask and the vector operands to be
of the same length.

This is not always the case as the mask may be twice as long as the operand;
here only the lower half of the shufflemask gets checked, so provided the lower
half of the shufflemask looks like a vector transpose (or even is just all -1
for undef) then the intrinsics may get incorrectly lowered into a vector
transpose (VTRN) instruction.

This patch fixes this by accommodating for both cases and adds regression tests.

Differential Revision: http://reviews.llvm.org/D11407



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243103 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 09:57:05 +00:00
Luke Cheeseman
ca2a3eb2e7 When lowering vector shifts a check is performed to see if the value to shift by
is an immediate, in this check the value is negated and stored in and int64_t.
The value can be -2^63 yet the result cannot be stored in an int64_t and this
gives some undefined behaviour causing failures. The negation is only necessary
when the values is within a certain range and so it should not need to negate
-2^63, this patch introduces this and also a regression test.

Differential Revision: http://reviews.llvm.org/D11408



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243100 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 09:31:48 +00:00
Mehdi Amini
26be214232 Revert "Remove access to the DataLayout in the TargetMachine"
This reverts commit 0f720d984f.

It breaks clang too badly, I need to prepare a proper patch for clang
first.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243089 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 03:36:55 +00:00
Alexei Starovoitov
90908cb34d [bpf] initial support for debug_info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243087 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 03:17:08 +00:00
Michael Zolotukhin
fc561accb7 Handle resolvable branches in complete loop unroll heuristic.
Summary:
Resolving a branch allows us to ignore blocks that won't be executed, and thus make our estimate more accurate.
This patch is intended to be applied after D10205 (though it could be applied independently).

Reviewers: chandlerc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10206

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243084 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 01:53:04 +00:00
Mehdi Amini
0f720d984f Remove access to the DataLayout in the TargetMachine
Summary:
Replace getDataLayout() with a createDataLayout() method to make
explicit that it is intended to create a DataLayout only and not
accessing it for other purpose.

This change is the last of a series of commits dedicated to have a
single DataLayout during compilation by using always the one owned
by the module.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits, rafael, yaron.keren

Differential Revision: http://reviews.llvm.org/D11103

(cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea)

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243083 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 01:44:39 +00:00
NAKAMURA Takumi
152d200641 MIRParser/LLVMBuild.txt: Add MC for MCRegisterInfo::getDwarfRegNum().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243081 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 01:12:36 +00:00
NAKAMURA Takumi
af9a5bc3e4 Reorder alphabetically.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243080 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 01:12:28 +00:00
Kostya Serebryany
33a9a09cd7 [libFuzzer] allow users to supply their own implementation of rand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243078 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 01:06:40 +00:00
Philip Reames
a8f6ce415b [RewriteStatepointsForGC] Fix release build warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243076 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 00:42:55 +00:00
Philip Reames
eb902a7509 [RewriteStatepointsForGC] Use a worklist algorithm for first part of base pointer algorithm [NFC]
The new code should hopefully be equivalent to the old code; it just uses a worklist to track instructions which need to visited rather than iterating over all instructions visited each time. This should be faster, but the primary benefit is that the purpose should be more clear and the diff of adding another instruction type (forthcoming) much more obvious.

Differential Revision: http://reviews.llvm.org/D11480



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243071 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 00:02:11 +00:00
Lawrence Hu
b5441878c4 test commit, only added one space
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243070 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 23:55:28 +00:00
Jingyue Wu
cab4b8c41b [NaryReassociate] remove redundant code
This check is already done by findClosestMatchingDominator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243065 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 23:13:37 +00:00
Alex Lorenz
832202c797 MIR Serialization: Serialize the '.cfi_offset' CFI instruction.
Reviewers: Duncan P. N. Exon Smith


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243062 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 23:09:07 +00:00
Sanjay Patel
c3bac701a5 fix crash in machine trace metrics due to processing dbg_value instructions (PR24199)
The test in PR24199 ( https://llvm.org/bugs/show_bug.cgi?id=24199 ) crashes because machine
trace metrics was not ignoring dbg_value instructions when calculating data dependencies.

The machine-combiner pass asks machine trace metrics to calculate an instruction trace, 
does some reassociations, and calls MachineInstr::eraseFromParentAndMarkDBGValuesForRemoval()
along with MachineTraceMetrics::invalidate(). The dbg_value instructions have their operands
invalidated, but the instructions are not expected to be deleted.

On a subsequent loop iteration of the machine-combiner pass, machine trace metrics would be
called again and die while accessing the invalid debug instructions.

Differential Revision: http://reviews.llvm.org/D11423



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243057 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 22:56:53 +00:00
Philip Reames
e2d5247dee [RewriteStatepointsForGC] Rename PhiState to reflect that it's associated w/more than just PHIs
Today, Select instructions also have associated PhiStates.  In the near future, so will ExtractElement and SuffleVector.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243056 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 22:49:14 +00:00
Philip Reames
173e222715 [RewriteStatepointsForGC] Use idomatic mechanisms for debug tracing [NFC]
Deleting much of the code using trace-rewrite-statepoints and use idiomatic DEBUG statements instead.  This includes adding operator<< to a helper class.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243054 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 22:25:26 +00:00
David Gross
99d1c88279 [ARM] Register (existing) ARMLoadStoreOpt pass with LLVM pass manager.
Summary: Among other things, this allows -print-after-all/-print-before-all to dump IR around this pass.

Subscribers: aemerson, llvm-commits, rengolin

Differential Revision: http://reviews.llvm.org/D11373

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243052 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 22:12:46 +00:00
David Gross
e8f876d972 Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243046 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 21:46:09 +00:00
Philip Reames
6c5bfdf124 [RewriteStatepointsForGC] Simplify code around meet of PhiStates [NFC]
We don't need to pass in the map from BDV to PhiStates; we can instead handle that externally and let the MeetPhiStates helper class just meet PhiStates.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243045 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 21:41:27 +00:00
Matt Wala
106d75d396 [Scalarizer] Fix potential for stale data in Scattered across invocations
Summary:
Scalarizer has two data structures that hold information about changes
to the function, Gathered and Scattered. These are cleared in finish()
at the end of runOnFunction() if finish() detects any changes to the
function.

However, finish() was checking for changes by only checking if
Gathered was non-empty. The function visitStore() only modifies
Scattered without touching Gathered. As a result, Scattered could have
ended up having stale data if Scalarizer only scalarized store
instructions. Since the data in Scattered is used during the execution
of the pass, this introduced dangling pointer errors.

The fix is to check whether both Scattered and Gathered are empty
before deciding what to do in finish(). This also fixes a problem
where the Function can be modified although the pass returns false.

Reviewers: rnk

Subscribers: rnk, srhines, llvm-commits

Differential Revision: http://reviews.llvm.org/D10459

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243040 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 20:53:46 +00:00
Duncan P. N. Exon Smith
31c063d405 X86: Use dyn_cast instead of isa+cast, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243034 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 19:27:07 +00:00
Weiming Zhao
8d5c72d513 This patch eanble register coalescing to coalesce the following:
%vreg2<def> = MOVi32imm 1; GPR32:%vreg2
  %W1<def> = COPY %vreg2; GPR32:%vreg2
into:
  %W1<def> = MOVi32imm 1
Patched by Lawrence Hu (lawrence@codeaurora.org)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243033 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 19:24:53 +00:00
Kostya Serebryany
6cbc095f13 [libFuzzer] dump long running units to disk
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243031 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 18:37:22 +00:00
Michael Kuperstein
e31d7f83c5 [X86] Allow load folding into PUSH instructions
Adds pushes to the folding tables.
This also required a fix to the TD definition, since the memory forms of 
the push instructions did not have the right mayLoad/mayStore flags.

Differential Revision: http://reviews.llvm.org/D11340

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243010 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 12:23:45 +00:00
Kuba Brecka
00a917ca7c [asan] Rename the ABI versioning symbol to '__asan_version_mismatch_check' instead of abusing '__asan_init'
We currently version `__asan_init` and when the ABI version doesn't match, the linker gives a `undefined reference to '__asan_init_v5'` message. From this, it might not be obvious that it's actually a version mismatch error. This patch makes the error message much clearer by changing the name of the undefined symbol to be `__asan_version_mismatch_check_xxx` (followed by the version string). We obviously don't want the initializer to be named like that, so it's a separate symbol that is used only for the purpose of version checking.

Reviewed at http://reviews.llvm.org/D11004



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243003 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 10:54:06 +00:00
Michael Kuperstein
dedb07fcbe [X86] Fix order of operands for ins and outs instructions when parsing intel syntax
Patch by: marina.yatsina@intel.com
Differential Revision: http://reviews.llvm.org/D11337

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243001 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 10:23:48 +00:00
Chandler Carruth
8de7149b0d [GMR] Add a late run of GlobalsModRef to the main pass pipeline behind
the general GMR-in-non-LTO flag.

Without this, we have the global information during the CGSCC pipeline
for GVN and such, but don't have it available during the late loop
optimizations such as the vectorizer. Moreover, after the CGSCC pipeline
has finished we have substantially more accurate and refined call graph
information, function annotations, etc, which will make GMR even more
powerful than it is early in the pipelien.

Note that we have to play silly games with preserving AliasAnalysis
(which is now trivially preserved) in order to let a module analysis
magically be preserved into the entire function pass pipeline.
Simultaneously we have to not make GMR an immutable pass in order to be
able to re-run it and collect fresh data on the final call graph.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242999 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 09:34:01 +00:00
Elena Demikhovsky
fb09d25df5 X86: Fixed assertion failure in 32-bit mode
The DAG Node "SCALAR_TO_VECTOR" may be created if the type of the scalar element is legal.
Added a check for the scalar type before creating this node.
Added a test that fails with assertion on the current version.

Differential Revision: http://reviews.llvm.org/D11413



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242994 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 08:25:23 +00:00