OSDN Git Service
Ahmed Bougacha [Thu, 12 Feb 2015 06:15:29 +0000 (06:15 +0000)]
[CodeGen] Don't blindly combine (fp_round (fp_round x)) to (fp_round x).
We used to do this DAG combine, but it's not always correct:
If the first fp_round isn't a value preserving truncation, it might
introduce a tie in the second fp_round, that wouldn't occur in the
single-step fp_round we want to fold to.
In other words, double rounding isn't the same as rounding.
Differential Revision: http://reviews.llvm.org/D7571
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228911
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Thu, 12 Feb 2015 03:07:07 +0000 (03:07 +0000)]
Fixed a bug where CFLAA would crash the compiler.
We would crash if we couldn't locate a Function that either Location's
Value belonged to. Now we just print out a debug message and return
conservatively.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228901
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 12 Feb 2015 02:30:56 +0000 (02:30 +0000)]
[slp] Fix a nasty bug in the SLP vectorizer that Joerg pointed out.
Apparently some code finally started to tickle this after my
canonicalization changes to instcombine.
The bug stems from trying to form a vector type out of scalars that
aren't compatible at all. In this example, from x86_mmx values. The code
in the vectorizer that checks for reasonable types whas checking for
aggregates or vectors, but there are lots of other types that should
just never reach the vectorizer.
Debugging this was made more confusing by the lie in an assert in
VectorType::get() -- it isn't that the types are *primitive*. The types
must be integer, pointer, or floating point types. No other types are
allowed.
I've improved the assert and added a helper to the vectorizer to handle
the element type validity checks. It now re-uses the VectorType static
function and then further excludes weird target-specific types that we
probably shouldn't be touching here (x86_fp80 and ppc_fp128). Neither of
these are really reachable anyways (neither 80-bit nor 128-bit things
will get vectorized) but it seems better to just eagerly exclude such
nonesense.
I've added a test case, but while it definitely covers two of the paths
through this code there may be more paths that would benefit from test
coverage. I'm not familiar enough with the SLP vectorizer to synthesize
test cases for all of these, but was able to update the code itself by
inspection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228899
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Thu, 12 Feb 2015 01:02:52 +0000 (01:02 +0000)]
[PowerPC] Mark jumps as expensive (using using CR bits)
On PowerPC, which has a full set of logical operations on (its multiple sets
of) condition-register bits, it is not profitable to break of complex
conditions feeding a jump into multiple jumps. We can turn off this feature of
CGP/SDAGBuilder by marking jumps as "expensive".
P7 test-suite speedups (no regressions):
MultiSource/Benchmarks/FreeBench/pcompress2/pcompress2
-0.626647% +/- 0.323583%
MultiSource/Benchmarks/Olden/power/power
-18.2821% +/- 8.06481%
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228895
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 12 Feb 2015 00:05:49 +0000 (00:05 +0000)]
Revert "Change Path::filename_pos() to skip the drive letter."
This reverts commit 228874. For some reason users reported
seeing Clang taking up 25+GB of memory and bringing down
machines with this change. Reverting until we figure it out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228890
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 11 Feb 2015 23:38:33 +0000 (23:38 +0000)]
Invert the section relocation map.
It now points from rel section to section. Use it to set sh_info, avoiding
a brittle name lookup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228889
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 11 Feb 2015 23:33:46 +0000 (23:33 +0000)]
Use the existing SymbolTableIndex instead of doing a lookup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228888
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 11 Feb 2015 23:17:48 +0000 (23:17 +0000)]
Create the Seciton -> Rel Section map when it is first needed. NFC.
Saves a walk over every section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228886
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 11 Feb 2015 23:13:11 +0000 (23:13 +0000)]
DeadArgElim: aggregate Return assessment properly.
I mistakenly thought the liveness of each "RetVal(F, i)" depended only on F. It
actually depends on the index too, which means we need to be careful about how
the results are combined before return. In particular if a single Use returns
Live, that counts for the entire object, at the granularity we're considering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228885
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 11 Feb 2015 23:11:18 +0000 (23:11 +0000)]
Remove unused argument. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228884
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 11 Feb 2015 22:51:55 +0000 (22:51 +0000)]
Unbreak buildbots
The next offset should be updated as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228883
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 11 Feb 2015 22:41:26 +0000 (22:41 +0000)]
Don't recompute the entire section map just to add 3 entries. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228881
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 11 Feb 2015 22:22:30 +0000 (22:22 +0000)]
MC, COFF: Align section contents to a four byte boundary
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228879
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 11 Feb 2015 21:16:35 +0000 (21:16 +0000)]
Change Path::filename_pos() to skip the drive letter.
For Windows, filename_pos() tries to find the filename by
searching for separators after the last :. Instead, it should
really check for the only location that a : is valid, which is
in the second character, and search for separators after that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228874
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 11 Feb 2015 21:08:00 +0000 (21:08 +0000)]
Remove unused argument. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228873
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 11 Feb 2015 19:54:44 +0000 (19:54 +0000)]
Reassociate: cannot negate a INT_MIN value
Summary:
When trying to canonicalize negative constants out of
multiplication expressions, we need to check that the
constant is not INT_MIN which cannot be negated.
Reviewers: mcrosier
Reviewed By: mcrosier
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7286
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228872
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 11 Feb 2015 18:24:53 +0000 (18:24 +0000)]
R600/SI: Disable subreg liveness
This is temporary while we try to fix a crash in the register coalescer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228861
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 11 Feb 2015 18:14:35 +0000 (18:14 +0000)]
[X86][SSE] Added dual vector truncation tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228857
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 11 Feb 2015 17:45:10 +0000 (17:45 +0000)]
Allow DIBuilder::replaceVTableHolder() to work with temporary nodes,
tested via the clang test CodeGenCXX/vtable-holder-self-reference.cpp .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228854
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 11 Feb 2015 17:45:08 +0000 (17:45 +0000)]
Add a trackIfUnresolved to DIBuilder::createInheritance(),
tested via the clang test CodeGenCXX/vtable-holder-self-reference.cpp .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228853
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 11 Feb 2015 17:45:05 +0000 (17:45 +0000)]
Generalize DIBuilder's createReplaceableForwardDecl() to a more flexible
createReplaceableCompositeType() that allows to create non-forward-declared
temporary nodes.
Paired commit with CFE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228852
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 11 Feb 2015 17:11:51 +0000 (17:11 +0000)]
R600: Split AMDGPUPassConfig into R600PassConfig and GCNPassConfig
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228850
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 11 Feb 2015 17:11:50 +0000 (17:11 +0000)]
R600: Create an R600TargetMachine for pre-gcn GPUs
No functinality change. R600TargetMachine inherits from
AMDGPUTargetMachine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228849
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 11 Feb 2015 17:11:48 +0000 (17:11 +0000)]
R600/SI: Fix -march in test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228848
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Wen Voung [Wed, 11 Feb 2015 16:12:50 +0000 (16:12 +0000)]
Gold-plugin: Broaden scope of get/release_input_file to scope of Module.
Summary:
Move calls to get_input_file and release_input_file out of
getModuleForFile(). Otherwise release_input_file may end up
unmapping a view of the file while the view is still being
used by the Module (on 32-bit hosts).
Fix for PR22482.
Test Plan: Add test using --no-map-whole-files.
Reviewers: rafael, nlewycky
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7539
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228842
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Paulsson [Wed, 11 Feb 2015 16:10:31 +0000 (16:10 +0000)]
Fix SelectionDAG compile time issue with alias analysis.
Add new token factor node and its users to worklist if alias analysis is
turned on, in DAGCombiner::visitTokenFactor(). Alias analysis may cause
a lot of new token factors to be inserted into the DAG, and they need to
be optimized to avoid significant slow-downs.
Reviewed by Hal Finkel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228841
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 11 Feb 2015 15:00:41 +0000 (15:00 +0000)]
fixed to test features, not CPUs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228836
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 11 Feb 2015 15:00:19 +0000 (15:00 +0000)]
fixed to test features, not CPUs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228835
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 11 Feb 2015 14:58:25 +0000 (14:58 +0000)]
fixed to test features, not CPUs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228834
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 11 Feb 2015 14:44:17 +0000 (14:44 +0000)]
Don't repeat name in comment and clang-format a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228831
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Olsak [Wed, 11 Feb 2015 14:26:46 +0000 (14:26 +0000)]
R600/SI: Enable a lot of existing tests for VI (squashed commits)
This is a union of these commits:
* R600/SI: Enable more tests for VI which need no changes
* R600/SI: Enable V_BCNT tests for VI
Differences:
- v_bcnt_..._e32 -> _e64
- s_load_dword* inline offset is in bytes instead of dwords
* R600/SI: Enable all tests for VI which use S_LOAD_DWORD
The inline offset is changed from dwords to bytes.
* R600/SI: Enable LDS tests for VI
Differences:
- the s_load_dword inline offset changed from dwords to bytes
- the tests checked very little on CI, so they have been fixed to check all
instructions that "SI" checked
* R600/SI: Enable lshr tests for VI
* R600/SI: Fix divrem64 tests
- "v_lshl_64" was missing "b" before "64"
- added VI-NOT checks
* R600/SI: Enable the SI.tid test for VI
* R600/SI: Enable the frem test for VI
Also, the frem_f64 checking is added for CI-VI.
* R600/SI: Add VI tests for rsq.clamped
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228830
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Wed, 11 Feb 2015 14:22:18 +0000 (14:22 +0000)]
[TTI] Improved cost heuristic for cttz/ctlz calls.
This patch is a follow-up of r228826 (see code-review: D7506).
Now that SimplifyCFG uses TargetTransformInfo for cost analysis, we
have to fix the cost heuristic for intrinsic calls to cttz/ctlz.
This patch defines method 'getIntrinsicCost' in BasicTTIImpl: now, BasicTTIImpl
queries TLI to check if a call to cttz/ctlz is cheap for the target.
Added test cases in Transforms/SimplifyCFG/X86 to verify that on x86,
SimplifyCFG only speculates a call to cttz/ctlz if it is cheap.
Differential Revision: http://reviews.llvm.org/D7554
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228829
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Wed, 11 Feb 2015 12:24:09 +0000 (12:24 +0000)]
Make buildbots better.
This testcase change was associated incorrectly to a followup commit in my git tree, not the base commit. Sorry!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228827
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Wed, 11 Feb 2015 12:15:41 +0000 (12:15 +0000)]
[SimplifyCFG] Swap to using TargetTransformInfo for cost
analysis.
We're already using TTI in SimplifyCFG, so remove the hard-baked "cheapness"
heuristic and use TTI directly. Generally NFC intended, but we're using a slightly
different heuristic now so there is a slight test churn.
Test changes:
* combine-comparisons-by-cse.ll: Removed unneeded branch check.
* 2014-08-04-muls-it.ll: Test now doesn't branch but emits muleq.
* coalesce-subregs.ll: Superfluous block check.
* 2008-01-02-hoist-fp-add.ll: fadd is safe to speculate. Change to udiv.
* PhiBlockMerge.ll: Superfluous CFG checking code. Main checks still present.
* select-gep.ll: A variable GEP is not expensive, just TCC_Basic, according to the TTI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228826
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 11 Feb 2015 11:28:56 +0000 (11:28 +0000)]
[mips] Merge disassemblers into a single implementation.
Summary:
Currently we have Mips32 and Mips64 disassemblers and this causes the target
triple to affect the disassembly despite all the relevant information being in
the ELF header. These implementations do not need to be separate.
This patch merges them together such that the appropriate tables are checked
for the subtarget (e.g. Mips64 is checked when GP64 is enabled).
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7498
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228825
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Wed, 11 Feb 2015 09:19:47 +0000 (09:19 +0000)]
[LoopReroll] Introduce the concept of DAGRootSets.
A DAGRootSet models an induction variable being used in a rerollable
loop. For example:
x[i*3+0] = y1
x[i*3+1] = y2
x[i*3+2] = y3
Base instruction -> i*3
+---+----+
/ | \
ST[y1] +1 +2 <-- Roots
| |
ST[y2] ST[y3]
There may be multiple DAGRootSets, for example:
x[i*2+0] = ... (1)
x[i*2+1] = ... (1)
x[i*2+4] = ... (2)
x[i*2+5] = ... (2)
x[(i+1234)*2+5678] = ... (3)
x[(i+1234)*2+5679] = ... (3)
This concept is similar to the "Scale" member used previously, but allows
multiple independent sets of roots based off the same induction variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228821
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 11 Feb 2015 09:13:11 +0000 (09:13 +0000)]
AsmParser: Validate alloca's type
An alloca's type should be weird things like metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228820
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 11 Feb 2015 09:13:09 +0000 (09:13 +0000)]
DataLayout: Report when the preferred alignment is less than the ABI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228819
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 11 Feb 2015 09:13:06 +0000 (09:13 +0000)]
Verifier: Check for null operands in !llvm.module.flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228818
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Wed, 11 Feb 2015 08:53:55 +0000 (08:53 +0000)]
[X86] Split information collection from actual transformation in call frame optimization
This splits collecting information from actually performing the transformation, so that we can add a heuristic in between the two.
NFC.
Differential Revision: http://reviews.llvm.org/D7497
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228817
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Wed, 11 Feb 2015 08:25:36 +0000 (08:25 +0000)]
[PBQP] Cautiously update edge costs in the solver
The NodeMetadata are maintained in an incremental way. When an edge between
2 nodes has its cost updated, in the course of graph reduction for example,
the NodeMetadata need first to have the old edge cost removed, then the new
edge cost added. Only once the NodeMetadata have been fully updated, it
becomes safe to consider promoting the nodes to the
ConservativelyAllocatable or OptimallyReducible sets. Previously, this
promotion was occuring right after the removing the old cost, and this was
breaking the assumption that a ConservativelyAllocatable should not be
spilled.
This patch also adds asserts to:
- enforces the invariant that a node's reduction can not be downgraded,
- only not provably allocatable or optimally reducible nodes can be spilled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228816
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 11 Feb 2015 08:23:20 +0000 (08:23 +0000)]
Verifier: Make sure !llvm.ident's operand isn't null
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228815
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 11 Feb 2015 07:43:58 +0000 (07:43 +0000)]
AsmParser: Don't crash when insertvalue has bad operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228813
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 11 Feb 2015 07:43:56 +0000 (07:43 +0000)]
AsmParser: Switch some vectors to maps
This speeds up parsing .ll files with metadata nodes with large IDs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228812
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 11 Feb 2015 05:58:57 +0000 (05:58 +0000)]
Fix build for CMake < 2.8.12.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228810
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 11 Feb 2015 03:28:02 +0000 (03:28 +0000)]
Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects.
This allows IDEs to recognize the entire set of header files for
each of the core LLVM projects.
Differential Revision: http://reviews.llvm.org/D7526
Reviewed By: Chris Bieneman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228798
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Wed, 11 Feb 2015 02:52:44 +0000 (02:52 +0000)]
InstrProf: Lower coverage mappings by setting their sections appropriately
Add handling for __llvm_coverage_mapping to the InstrProfiling
pass. We need to make sure the constant and any profile names it
refers to are in the correct sections, which is easier and cleaner to
do here where we have to know about profiling sections anyway.
This is really tricky to test without a frontend, so I'm committing
the test for the fix in clang. If anyone knows a good way to test this
within LLVM, please let me know.
Fixes PR22531.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228793
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Wed, 11 Feb 2015 02:16:34 +0000 (02:16 +0000)]
Temporary workaround to fix MSVC 2012 build problems
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228788
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 11 Feb 2015 02:06:47 +0000 (02:06 +0000)]
Fix invalid LLVM IR in PruneEH tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228786
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 11 Feb 2015 01:23:16 +0000 (01:23 +0000)]
Don't promote asynch EH invokes of nounwind functions to calls
If the landingpad of the invoke is using a personality function that
catches asynch exceptions, then it can catch a trap.
Also add some landingpads to invalid LLVM IR test cases that lack them.
Over-the-shoulder reviewed by David Majnemer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228782
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 11 Feb 2015 00:34:35 +0000 (00:34 +0000)]
R600/SI: Store immediate offsets > 12-bits in soffset
This will save us from having to extend these offsets to 64-bits
and storing them in a pair of vgprs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228776
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 11 Feb 2015 00:34:32 +0000 (00:34 +0000)]
R600/SI: Add soffset operand to mubuf addr64 instruction
We were previously hard-coding soffset to 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228775
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 11 Feb 2015 00:33:00 +0000 (00:33 +0000)]
Fix warning due to unused private member variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228774
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 11 Feb 2015 00:13:39 +0000 (00:13 +0000)]
Fix some warnings due to -Wcovered-switch-default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228773
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Tue, 10 Feb 2015 23:46:48 +0000 (23:46 +0000)]
Convert std::make_unique<> to llvm::make_unique<>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228768
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 10 Feb 2015 23:32:56 +0000 (23:32 +0000)]
Add the missing testcase for r228764.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228766
91177308-0d34-0410-b5e6-
96231b3b80d8
Petar Jovanovic [Tue, 10 Feb 2015 23:30:14 +0000 (23:30 +0000)]
Fix makeLibCall argument (signed) in SoftenFloatRes_XINT_TO_FP function
The isSigned argument of makeLibCall function was hard-coded to false
(unsigned). This caused zero extension on MIPS64 soft float.
As the result SingleSource/Benchmarks/Stanford/FloatMM test and
SingleSource/UnitTests/2005-07-17-INT-To-FP test failed.
The solution was to use the proper argument.
Patch by Strahinja Petrovic.
Differential Revision: http://reviews.llvm.org/D7292
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228765
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 10 Feb 2015 23:18:28 +0000 (23:18 +0000)]
Debug Info: Support variables that are described by more than one MMI
table entry. This happens when SROA splits up an alloca and the resulting
allocas cannot be lowered to SSA values because their address is passed
to a function.
Fixes PR22502.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228764
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 10 Feb 2015 23:18:15 +0000 (23:18 +0000)]
Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228763
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 10 Feb 2015 23:11:02 +0000 (23:11 +0000)]
EarlyCSE: Add check lines for test added in r228760
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228761
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 10 Feb 2015 23:09:43 +0000 (23:09 +0000)]
EarlyCSE: It isn't safe to CSE across synchronization boundaries
This fixes PR22514.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228760
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Tue, 10 Feb 2015 22:56:21 +0000 (22:56 +0000)]
Add missing function and header include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228758
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Tue, 10 Feb 2015 22:47:14 +0000 (22:47 +0000)]
Oops. Don't call Windows functions on non-windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228756
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Tue, 10 Feb 2015 22:43:25 +0000 (22:43 +0000)]
Rewrite llvm-pdbdump in terms of LLVMDebugInfoPDB.
This makes llvm-pdbdump available on all platforms, although it
will currently fail to create a dumper if there is no PDB reader
implementation for the current platform.
It implements dumping of compilands and children, which is less
information than was previously available, but it has to be
rewritten from scratch using the new set of interfaces, so the
rest of the functionality will be added back in subsequent commits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228755
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 10 Feb 2015 22:00:34 +0000 (22:00 +0000)]
X86: @llvm.frameaddress should defer to SelectionDAG for Win CFI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228754
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Tue, 10 Feb 2015 21:40:29 +0000 (21:40 +0000)]
Fix build due to mismatched function signatures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228752
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Tue, 10 Feb 2015 21:38:25 +0000 (21:38 +0000)]
[Object] Reformat the code with clang-format
No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228751
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 10 Feb 2015 21:22:05 +0000 (21:22 +0000)]
X86: Make @llvm.frameaddress work correctly with Windows unwind codes
Simply loading or storing the frame pointer is not sufficient for
Windows targets. Instead, create a synthetic frame object that we will
lower later. References to this synthetic object will be replaced with
the correct reference to the frame address.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228748
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Tue, 10 Feb 2015 21:17:52 +0000 (21:17 +0000)]
Provide DIA implementation of DebugInfoPDB.
This implements DebugInfoPDB when the DIA SDK is present on the system.
Specifically, this means that the following conditions are met:
1) You are building on Windows.
2) You are building with MSVC.
3) Visual Studio did not corrupt the installation of DIA due to a
known issue with side-by-side installations of VS2012 and VS2013.
If all of these conditions are true, you will be able to pass a value
of PDB_Reader::DIA to PDB::createPdbReader().
There are no tests for this yet, as any test will be in the form of a
lit test which tests the llvm-pdbdump.exe, which still needs to be
rewritten in terms of this library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228747
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 10 Feb 2015 21:15:06 +0000 (21:15 +0000)]
Reformat (and remove some tabs) to make debugging this code a
little easier to step through.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228746
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 10 Feb 2015 21:13:04 +0000 (21:13 +0000)]
Now use the __debugbreak intrinsic instead of calling RaiseException; it requires no forward declares and still calls VEH.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228745
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 10 Feb 2015 20:49:05 +0000 (20:49 +0000)]
Fix overly prescriptive test that broken on Mac after r228725.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228742
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Tue, 10 Feb 2015 20:43:54 +0000 (20:43 +0000)]
fix docs typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228741
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 10 Feb 2015 20:13:52 +0000 (20:13 +0000)]
Changing the status code generated by LLVM_BUILTIN_TRAP on Windows to be something categorized as a valid error code. Fixes crashing uses (such as not --crash) with existing sys::Wait behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228738
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Tue, 10 Feb 2015 19:52:43 +0000 (19:52 +0000)]
Adding support for llvm.eh.begincatch and llvm.eh.endcatch intrinsics and beginning the documentation of native Windows exception handling.
Differential Revision: http://reviews.llvm.org/D7398
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228733
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 10 Feb 2015 19:49:18 +0000 (19:49 +0000)]
DeadArgElim: arguments affect all returned sub-values by default.
Unless we meet an insertvalue on a path from some value to a return, that value
will be live if *any* of the return's components are live, so all of those
components must be added to the MaybeLiveUses.
Previously we were deleting arguments if sub-value 0 turned out to be dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228731
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Tue, 10 Feb 2015 19:31:55 +0000 (19:31 +0000)]
Fix up r228725, missed change in PPCSubtarget definition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228728
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 10 Feb 2015 19:13:46 +0000 (19:13 +0000)]
IR: Add MDNode::replaceWithPermanent()
Add new API for converting temporaries that may self-reference.
Self-referencing nodes are not allowed to be uniqued, so sending them
into `replaceWithUniqued()` is dangerous (and this commit adds
assertions that prevent it).
`replaceWithPermanent()` has similar semantics to `get()` followed by
calls to `replaceOperandWith()`. In particular, if there's a
self-reference, it returns a distinct node; otherwise, it returns a
uniqued one. Like `replaceWithUniqued()` and `replaceWithDistinct()`
(well, it calls out to them) it mutates the temporary node in place if
possible, only calling `replaceAllUsesWith()` on a uniquing collision.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228726
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Tue, 10 Feb 2015 19:09:05 +0000 (19:09 +0000)]
[PowerPC] Fix reverted patch r227976 to avoid register assignment issues
See full discussion in http://reviews.llvm.org/D7491.
We now hide the add-immediate and call instructions together in a
separate pseudo-op, which is tagged to define GPR3 and clobber the
call-killed registers. The PPCTLSDynamicCall pass prior to RA now
expands this op into the two separate addi and call ops, with explicit
definitions of GPR3 on both instructions, and explicit clobbers on the
call instruction. The pass is now marked as requiring and preserving
the LiveIntervals and SlotIndexes analyses, and fixes these up after
the replacement sequences are introduced.
Self-hosting has been verified on LE P8 and BE P7 with various
optimization levels, etc. It has also been verified with the
--no-tls-optimize flag workaround removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228725
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 10 Feb 2015 19:01:47 +0000 (19:01 +0000)]
X86: Emit Win64 SaveXMM opcodes at the right offset in the right order
Walk the instructions marked FrameSetup and consider any stores of XMM
registers to the stack as needing a SaveXMM opcode.
This fixes PR22521.
Differential Revision: http://reviews.llvm.org/D7527
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228724
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 10 Feb 2015 18:45:02 +0000 (18:45 +0000)]
[PowerPC] Support the (old) cntlz instruction alias
Some old assembly code uses the cntlz alias for cntlzw, binutils supports this,
and we should too. Fixes PR22519.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228719
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Tue, 10 Feb 2015 17:54:54 +0000 (17:54 +0000)]
Add a test case for new unrolling heuristics.
THe heuristics were added in r228265 and r228434.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228713
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 10 Feb 2015 16:59:36 +0000 (16:59 +0000)]
[Hexagon] Adding vector load with post-increment instructions. Adding decoder function for 64bit control register class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228708
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Tue, 10 Feb 2015 16:36:20 +0000 (16:36 +0000)]
[mips][microMIPS] Implement movep instruction
Differential Revision: http://reviews.llvm.org/D7465
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228703
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Paulsson [Tue, 10 Feb 2015 15:34:29 +0000 (15:34 +0000)]
Two comment typo fixes in lib/CodeGen/SelectionDAG/DAGCombiner.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228700
91177308-0d34-0410-b5e6-
96231b3b80d8
Paul Robinson [Tue, 10 Feb 2015 15:30:02 +0000 (15:30 +0000)]
Explicitly initialize a flag in a default constructor.
Works around a Visual C++ issue.
Patch by Douglas Yung!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228699
91177308-0d34-0410-b5e6-
96231b3b80d8
Bradley Smith [Tue, 10 Feb 2015 15:15:08 +0000 (15:15 +0000)]
[ARM] Add armv6s[-]m as an alias to armv6[-]m
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228696
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 10 Feb 2015 14:28:11 +0000 (14:28 +0000)]
Re-committing r228628 with a fix for 64-bit builds.
On Windows, we now use RaiseException to generate the kind of trap we require (one which calls our vectored exception handler), and fall back to using a volatile write to simulate a trap elsewhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228691
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Tue, 10 Feb 2015 14:15:58 +0000 (14:15 +0000)]
Fix typo in cmake example docs
Patch by Vinicius Tinti.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228690
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 10 Feb 2015 13:22:57 +0000 (13:22 +0000)]
[X86][AVX2] Missing AVX2 memory folding instructions
Added most of the missing vector folding patterns for AVX2 (as well as fixing the vpermpd and verpmq patterns)
Differential Revision: http://reviews.llvm.org/D7492
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228688
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Tue, 10 Feb 2015 13:20:51 +0000 (13:20 +0000)]
[mips][microMIPS] Add disassembler tests for 16-bit instructions BREAK16 and SDBBP16
Differential Revision: http://reviews.llvm.org/D7443
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228687
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Paulsson [Tue, 10 Feb 2015 13:03:32 +0000 (13:03 +0000)]
Bugfix for missed dependency from store to load in buildSchedGraph().
Background: When handling underlying objects for a store, the vector
of previous mem uses, mapped to the same Value, is afterwards cleared
(regardless of ThisMayAlias). This means that during handling of the
next store using the same Value, adjustChainDeps() must be called,
otherwise a dependency might be missed.
For example, three spill/reload (NonAliasing) memory accesses using
the same Value 'a', with different offsets:
SU(2): store @a
SU(1): store @a, Offset:1
SU(0): load @a
In this case we have:
* SU(1) does not need a dep against SU(0). Therefore,SU(0) ends up in
RejectMemNodes and is removed from the mem-uses list (AliasMemUses
or NonAliasMemUses), as this list is cleared.
* SU(2) needs a dep against SU(0). Therefore, SU(2) must check
RejectMemNodes by calling adjustChainDeps().
Previously, for store SUs, adjustChainDeps() was only called if
MayAlias was true, missing the S(2) to S(0) dependency in the case
above. The fix is to always call adjustChainDeps(), regardless of
MayAlias, since this applies both for AliasMemUses and
NonAliasMemUses.
No testcase found for any in-tree target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228686
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 10 Feb 2015 12:57:17 +0000 (12:57 +0000)]
[X86][XOP] Added XOP memory folding patterns + tests
This patch adds the complete AMD Bulldozer XOP instruction set to the memory folding pattern tables for stack folding, etc.
Note: Many of the XOP instructions have multiple table entries as it can fold loads from different sources.
Differential Revision: http://reviews.llvm.org/D7484
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228685
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Tue, 10 Feb 2015 12:41:13 +0000 (12:41 +0000)]
[mips][microMIPS] Fix disassembling of 16-bit microMIPS instructions LWM16 and SWM16
Differential Revision: http://reviews.llvm.org/D7436
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228683
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Tue, 10 Feb 2015 12:04:41 +0000 (12:04 +0000)]
[X86][FastIsel] Avoid introducing legacy SSE instructions if the target has AVX.
This patch teaches X86FastISel how to select AVX instructions for scalar
float/double convert operations.
Before this patch, X86FastISel always selected legacy SSE instructions
for FPExt (from float to double) and FPTrunc (from double to float).
For example:
\code
define double @foo(float %f) {
%conv = fpext float %f to double
ret double %conv
}
\end code
Before (with -mattr=+avx -fast-isel) X86FastIsel selected a CVTSS2SDrr which is
legacy SSE:
cvtss2sd %xmm0, %xmm0
With this patch, X86FastIsel selects a VCVTSS2SDrr instead:
vcvtss2sd %xmm0, %xmm0, %xmm0
Added test fast-isel-fptrunc-fpext.ll to check both the register-register and
the register-memory float/double conversion variants.
Differential Revision: http://reviews.llvm.org/D7438
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228682
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 10 Feb 2015 08:07:32 +0000 (08:07 +0000)]
Revert r228556: InstCombine: propagate nonNull through assume
This commit isn't using the correct context, and is transfoming calls
that are operands to loads rather than calls that are operands to an
icmp feeding into an assume. I've replied on the original review thread
with a very reduced test case and some thoughts on how to rework this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228677
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 10 Feb 2015 07:35:39 +0000 (07:35 +0000)]
[Orc] Fix a bug in the LazyEmittingLayer - capture names by value (as
std::strings) rather than StringRefs in JITSymbol get-address lambda.
Capturing a StringRef by-value is still effectively capturing a reference, which
is no good here because the referenced string may be gone by the time the lambda
is being evaluated the original value may be gone. Make sure to capture a
std::string instead.
No test case: This bug doesn't manifest under OrcMCJITReplacement, since it
keeps IR modules (from which the StringRefs are sourced) alive permanently.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228676
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 10 Feb 2015 07:26:19 +0000 (07:26 +0000)]
[Orc] Add missing casserts header to JITSymbol.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228675
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 10 Feb 2015 06:29:28 +0000 (06:29 +0000)]
[X86] Preserve mem refs on newly created 'Store' node instead of 'Load' node when handling store unfolding.
Bug spotted by Steve King.
I have no idea how to test this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228672
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 10 Feb 2015 05:10:50 +0000 (05:10 +0000)]
[X86] Remove unnecessary alignment checks from the load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228671
91177308-0d34-0410-b5e6-
96231b3b80d8