OSDN Git Service
Michael Zolotukhin [Thu, 12 Feb 2015 19:57:24 +0000 (19:57 +0000)]
Add a testcase for r228432.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228951
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 12 Feb 2015 19:53:49 +0000 (19:53 +0000)]
Try to fix the MSVC build.
0xFFFFFFFFFFFFFFFFLL doesn't fit in a long long so it should have
type 'unsigned long long'. MSVC thinks it's a (signed) __int64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228950
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Thu, 12 Feb 2015 18:21:50 +0000 (18:21 +0000)]
gold-plugin: delete the output file for OT_DISABLE
bfd creates the output file early, so calling exit(0) is not enough, the file needs to be explicitly deleted.
Patch by: H.J. Lu <hjl.tools@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228946
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 12 Feb 2015 17:46:49 +0000 (17:46 +0000)]
On ELF, put PIC jump tables in a non executable section.
Fixes PR22558.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228939
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 12 Feb 2015 17:16:46 +0000 (17:16 +0000)]
Put each jump table in an independent section if the function is too.
This allows the linker to GC both, fixing pr22557.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228937
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 12 Feb 2015 16:30:00 +0000 (16:30 +0000)]
Fix accidental bit flip.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228936
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 12 Feb 2015 16:18:07 +0000 (16:18 +0000)]
CoverageMapping: Bitvectorize code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228934
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Thu, 12 Feb 2015 15:54:14 +0000 (15:54 +0000)]
[LoopRerolling] Be more forgiving with instruction order.
We can't solve the full subgraph isomorphism problem. But we can
allow obvious cases, where for example two instructions of different
types are out of order. Due to them having different types/opcodes,
there is no ambiguity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228931
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 12 Feb 2015 15:35:40 +0000 (15:35 +0000)]
MathExtras: Bring Count(Trailing|Leading)Ones and CountPopulation in line with countTrailingZeros
Update all callers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228930
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 12 Feb 2015 15:12:13 +0000 (15:12 +0000)]
Triple: refactor redundant code.
Should be no functional change, since most of the logic removed was
completely pointless (after some previous refactoring) and the rest
duplicated elsewhere.
Patch by Kamil Rytarowski.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228926
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Thu, 12 Feb 2015 14:17:35 +0000 (14:17 +0000)]
[X86] Call frame optimization - allow stack-relative movs to be folded into a push
Since we track esp precisely, there's no reason not to allow this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228924
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Thu, 12 Feb 2015 14:17:24 +0000 (14:17 +0000)]
[TTI] Teach the cost heuristic how to query TLI to check if a zext/trunc is 'free' for the target.
Now that SimplifyCFG uses TTI for the cost heuristic, we can teach BasicTTIImpl
how to query TLI in order to get a more accurate cost for truncates and
zero-extends.
Before this patch, the basic cost heuristic in TargetTransformInfoImplCRTPBase
would have conservatively returned a 'default' TCC_Basic for all zero-extends,
and TCC_Free for truncates on native types.
This patch improves the heuristic so that we query TLI (if available) to get
more accurate answers. If TLI is available, then methods 'isZExtFree' and
'isTruncateFree' can be used to check if a zext/trunc is free for the target.
Added more test cases to SimplifyCFG/X86/speculate-cttz-ctlz.ll.
With this change, SimplifyCFG is now able to speculate a 'cheap' cttz/ctlz
immediately followed by a free zext/trunc.
Differential Revision: http://reviews.llvm.org/D7585
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228923
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 12 Feb 2015 14:02:58 +0000 (14:02 +0000)]
BitVector: Remove manual bit width dispatch, this is handled by templates
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228922
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 12 Feb 2015 13:47:29 +0000 (13:47 +0000)]
MathExtras: Parametrize count(Trailing|Leading)Zeros on the type size.
Otherwise we will always select the generic version for e.g. unsigned
long if uint64_t is typedef'd to 'unsigned long long'. Also remove
enable_if hacks in favor of static_assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228921
91177308-0d34-0410-b5e6-
96231b3b80d8
Asiri Rathnayake [Thu, 12 Feb 2015 13:37:28 +0000 (13:37 +0000)]
ARM: Fix another regression introduced in r223113
The changes in r223113 (ARM modified-immediate syntax) have broken
instructions like:
mov r0, #~0xffffff00
The problem is that I've added a spurious range check on the immediate
operand to ensure that it lies between INT32_MIN and UINT32_MAX. While
this range check is correct in theory, it causes problems because the
operand is stored in an int64_t (by MC). So valid 32-bit constants like
\#~0xffffff00 become out of range. The solution is to simply remove this
range check. It is not possible to validate the range of the immediate
operand with the current setup because: 1) The operand is stored in an
int64_t by MC, 2) The immediate can be of the forms #imm, #-imm, #~imm
or even #((~imm)) etc. So we just chop the value to 32 bits and use it.
Also noted that the original range check was note tested by any of the
unit tests. I've added a new test to cover #~imm kind of operands.
Change-Id: I411e90d84312a2eff01b732bb238af536c4a7599
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228920
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitry Vyukov [Thu, 12 Feb 2015 09:55:28 +0000 (09:55 +0000)]
tsan: do not instrument not captured values
I've built some tests in WebRTC with and without this change. With this change number of __tsan_read/write calls is reduced by 20-40%, binary size decreases by 5-10% and execution time drops by ~5%. For example:
$ ls -l old/modules_unittests new/modules_unittests
-rwxr-x--- 1 dvyukov
41708976 Jan 20 18:35 old/modules_unittests
-rwxr-x--- 1 dvyukov
38294008 Jan 20 18:29 new/modules_unittests
$ objdump -d old/modules_unittests | egrep "callq.*__tsan_(read|write|unaligned)" | wc -l
239871
$ objdump -d new/modules_unittests | egrep "callq.*__tsan_(read|write|unaligned)" | wc -l
148365
http://reviews.llvm.org/D7069
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228917
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Thu, 12 Feb 2015 08:40:34 +0000 (08:40 +0000)]
AVX-512: Fixed the "test" operation for i1 type
Using KORTESTW for comparison i1 value with zero was wrong since the instruction tests 16 bits.
KORTESTW may be used with KSHIFTL+KSHIFTR that clean the 15 upper bits.
I removed (X86cmp i1, 0) pattern and zero-extend i1 to i8 and then use TESTB.
There are some cases where i1 is in the mask register and the upper bits are already zeroed.
Then KORTESTW is the better solution, but it is subject for optimization.
Meanwhile, I'm fixing the correctness issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228916
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Thu, 12 Feb 2015 08:36:35 +0000 (08:36 +0000)]
[X86] A heuristic to estimate the size impact for converting stack-relative parameter movs to pushes
This gives a rough estimate of whether using pushes instead of movs is profitable, in terms of size.
We go over all calls in the MachineFunction and compute:
a) For each callsite that can not use pushes, the penalty of not having a reserved call frame.
b) For each callsite that can use pushes, the gain of actually replacing the movs with pushes (and the potential penalty of having to readjust the stack).
Differential Revision: http://reviews.llvm.org/D7561
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228915
91177308-0d34-0410-b5e6-
96231b3b80d8
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