Commit Graph

119972 Commits

Author SHA1 Message Date
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
Alex Lorenz
4420c488b2 MIR Tests: Add liveins and successors to make tests pass with machine verifier.
This commit adds the liveins and successors properties to machine basic blocks
in some of the MIR tests to ensure that the tests will pass when the MIR parser
will run the machine verifier after initializing a machine function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243124 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 17:36:55 +00:00
Alex Lorenz
9b1988a840 MIR Tests: Make the basic block successor test an X86 specific test.
This commit moves and transforms the generic test
'CodeGen/MIR/successor-basic-blocks.mir' into an X86 specific test
'CodeGen/MIR/X86/successor-basic-blocks.mir'. This change is required in order
to enable the machine verifier for the MIR parser, as the machine verifier
verifies that the machine basic blocks contain instructions that actually
determine the machine basic block successors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243123 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 17:31:55 +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
Chandler Carruth
5da92333c3 Update for r243115 which changed the DataLayout API on TargetMachine but
didn't update the gold-plugin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243121 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 17:23:09 +00:00
Hans Wennborg
b8f373eb60 test-release.sh: Defer test errors until the end
This makes the script run to the end and produce tarballs even on test
failures, and then highlights any errors afterwards.

(I first tried just storing the errors in a global variable, but that
didn't work as the "test_llvmCore" function invocation is actually
running as a sub-shell.)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243116 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 16:16:09 +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
NAKAMURA Takumi
ca1494b52d llvm/test/tools/dsymutil/ARM/lit.local.cfg: Fix possibly typo, s/X86/ARM/.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243106 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 11:55:11 +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
Frederic Riss
fa7f7bd017 [dsymutil] Implement support for universal mach-o object files.
This patch allows llvm-dsymutil to read universal (aka fat) macho object
files and archives. The patch touches nearly everything in the BinaryHolder,
but it is fairly mechinical: the methods that returned MemoryBufferRefs or
ObjectFiles now return a vector of those, and the high-level access function
takes a triple argument to select the architecture.

There is no support yet for handling fat executables and thus no support for
writing fat object files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243096 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 06:41:11 +00:00
Frederic Riss
1556296615 [dsymutil] Make the triple detection more strict.
MachOObjectFile offers a method for detecting the correct triple, use
it instead of the previous approximation. This doesn't matter right
now, but it will become important for mach-o universal (fat) binaries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243095 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 06:41:04 +00:00
Frederic Riss
e10885312d [dsymutil] Refactor BinaryHolder internals. NFC
Call a helper that resets all the internal state of the BinaryHolder
when we change the underlying memory buffer. Makes a followup patch
a tiny bit smaller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243094 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 06:40:59 +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
Davide Italiano
c46ea19bd3 [llvm-reaobj] Display COFF-specific sections/tables only if the object is COFF.
Just skip them otherwise.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243086 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 02:14:20 +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
Saleem Abdulrasool
994d77147e build: fix small typo in cmake doxygen build
A search word spelled as "searhc" in the LLVM_DOXYGEN_SEARCHENGINE_URL cmake
variable docstring.

Patch by Daniel Otero!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243082 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 01:14:25 +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
Eric Christopher
168ef66330 Clean up function attributes on PPC fast-isel tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243079 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 01:07:50 +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
Jonathan Roelofs
147f0e84e6 Add missing underlines for a docs section. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243075 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 00:29:50 +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
JF Bastien
4cd3b05c67 WebAssembly: test that valid -mcpu flags are accepted.
Summary: AArch64 has a similar test.

Subscribers: sunfish, aemerson, llvm-commits, jfb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243058 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 23:00:04 +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
Colin LeMahieu
5fb71b264d Moving tests in to X86 directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243049 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 21:55:26 +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
Colin LeMahieu
8782d64e37 Using an input object file instead of trying to generate an object file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243044 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 21:40:19 +00:00
Colin LeMahieu
a5c7608532 Specifying a test triple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243042 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 21:24:52 +00:00