OSDN Git Service
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:19:14 +0000 (01:19 +0000)]
AsmWriter/Bitcode: MDFile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229007
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:17:35 +0000 (01:17 +0000)]
AsmWriter: MDBasicType: Recognize DW_ATE in 'encoding'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229006
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:14:58 +0000 (01:14 +0000)]
AsmWriter/Bitcode: MDBasicType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229005
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:14:11 +0000 (01:14 +0000)]
AsmWriter/Bitcode: MDEnumerator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229004
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:10:38 +0000 (01:10 +0000)]
AsmWriter/Bitcode: MDSubrange
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229003
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:07:46 +0000 (01:07 +0000)]
IR: Add MDExpression::ExprOperand
Port `DIExpression::Operand` over to `MDExpression::ExprOperand`. The
logic is needed directly in `MDExpression` to support printing in
assembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229002
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:05:00 +0000 (01:05 +0000)]
Support: Add dwarf::getOperationEncoding()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229001
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:04:08 +0000 (01:04 +0000)]
Support: Rewrite LocationAtom and OperationEncodingString(), NFC
Use `Dwarf.def` more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229000
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 13 Feb 2015 00:40:41 +0000 (00:40 +0000)]
[LinkModules] Change the way ModuleLinker merges triples.
This commit makes the following changes:
- Stop issuing a warning when the triples' string representations do not match
exactly if the Triple objects generated from the strings compare equal.
- On Apple platforms, choose the triple that has the larger minimum version
number.
rdar://problem/
16743513
Differential Revision: http://reviews.llvm.org/D7591
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228999
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 13 Feb 2015 00:39:38 +0000 (00:39 +0000)]
PPCFrameLowering's FramePointerOffset can be computed at initialization
time. Do so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228998
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 13 Feb 2015 00:39:36 +0000 (00:39 +0000)]
The TOC save offset can be computed at compile time, do so and
propagate changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228997
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 13 Feb 2015 00:39:27 +0000 (00:39 +0000)]
The return save offset can be computed at initialization time - do
so and save the value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228996
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Fri, 13 Feb 2015 00:35:45 +0000 (00:35 +0000)]
Testcase for r228988.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228995
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 00:29:39 +0000 (00:29 +0000)]
[unroll] Don't use a map from pointer to bool. Use a set.
This is much more efficient. In particular, the query with the user
instruction has to insert a false for every missing instruction into the
set. This is just a cleanup a long the way to fixing the underlying
algorithm problems here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228994
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 13 Feb 2015 00:21:34 +0000 (00:21 +0000)]
llvm/test/Transforms/LoopVectorize/PowerPC/small-loop-rdx.ll REQUIRES +Asserts due to -debug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228989
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Fri, 13 Feb 2015 00:17:03 +0000 (00:17 +0000)]
Prevent division by 0.
When we try to estimate number of potentially removed instructions in
loop unroller, we analyze first N iterations and then scale the
computed number by TripCount/N. We should bail out early if N is 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228988
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 00:00:24 +0000 (00:00 +0000)]
[unroll] Update the new analysis logic from r228265 to use modern coding
conventions for function names consistently. Some were already using
this but not all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228987
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 12 Feb 2015 23:29:51 +0000 (23:29 +0000)]
Add support for having multiple sections with the same name and comdat.
Using this in combination with -ffunction-sections allows LLVM to output a .o
file with mulitple sections named .text. This saves space by avoiding long
unique names of the form .text.<C++ mangled name>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228980
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 12 Feb 2015 23:26:26 +0000 (23:26 +0000)]
X86: Don't crash if we can't decode the pshufb mask
Constant pool entries are uniqued by their contents regardless of their
type. This means that a pshufb can have a shuffle mask which isn't a
simple array of bytes.
The code path which attempts to decode the mask didn't check for
failure, causing PR22559.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228979
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 12 Feb 2015 23:11:59 +0000 (23:11 +0000)]
Learn that __DATA,__objc_classrefs is not atomized via symbols.
This should hopefully fix objc on AArch64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228976
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 12 Feb 2015 22:58:53 +0000 (22:58 +0000)]
Add missing override.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228974
91177308-0d34-0410-b5e6-
96231b3b80d8
Olivier Sallenave [Thu, 12 Feb 2015 22:57:58 +0000 (22:57 +0000)]
Change max interleave factor to 12 for POWER7 and POWER8.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228973
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 12 Feb 2015 22:47:45 +0000 (22:47 +0000)]
Ensure integer domain on general shuffle stack folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228972
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 12 Feb 2015 22:45:25 +0000 (22:45 +0000)]
Remove typedef of a pointer type used in a gep to simplify migration of geps to a typeless-pointer future.
I'd modify my migration tool to account for this, but this is the only
instance of a typedef'd pointer type to a gep I found in the whole test
suite, so it didn't seem worthwhile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228970
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Thu, 12 Feb 2015 22:43:52 +0000 (22:43 +0000)]
[SDAG] Don't try to use FP_EXTEND/FP_ROUND for int<->fp promotions
The PowerPC backend has long promoted some floating-point vector operations
(such as select) to integer vector operations. Unfortunately, this behavior was
broken by r216555. When using FP_EXTEND/FP_ROUND for promotions, we must check
that both the old and new types are floating-point types. Otherwise, we must
use BITCAST as we did prior to r216555 for everything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228969
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 12 Feb 2015 21:52:11 +0000 (21:52 +0000)]
IR: Stop abusing DW_TAG_base_type for compile unit arrays
The sub-arrays for compile units have for a long time been initialized
to distinct temporary nodes with the `DW_TAG_base_type` tag, with no
other operands. These invalid `DIBasicType`s are later replaced with
appropriate arrays.
This seems like a poor man's assertion that the arrays do eventually get
replaced. These days, temporaries in the graph will cause assertions
when writing bitcode or assembly, so this isn't necessary. Use
temporary empty tuples instead.
Note that the whole idea of using temporaries and then replacing them
later is wasteful here. We never actually want to merge compile units
by uniquing based on content. Compile units should use `getDistinct()`
instead of `get()`, and then their operands can be freely replaced later
on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228967
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 12 Feb 2015 21:25:58 +0000 (21:25 +0000)]
Attempt to fix the build again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228964
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 12 Feb 2015 21:17:07 +0000 (21:17 +0000)]
Attempt to fix Linux builds after r228960.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228962
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 12 Feb 2015 21:16:34 +0000 (21:16 +0000)]
Remove mostly unused setters.
Most of the code was setting the TargetOptions directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228961
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 12 Feb 2015 21:09:24 +0000 (21:09 +0000)]
Add concrete type overloads to PDBSymbol::findChildren().
Frequently you only want to iterate over children of a specific
type (e.g. functions). Previously you would get back a generic
interface that allowed iteration over the base symbol type,
which you would have to dyn_cast<> each one of. With this patch,
we allow the user to specify the concrete type as a template
parameter, and it will return an iterator which returns instances
of the concrete type directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228960
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Thu, 12 Feb 2015 21:05:12 +0000 (21:05 +0000)]
Add bulk of returning of values to Mips fast-isel
Summary:
Implement the bulk of returning values in Mips fast-isel
Test Plan:
reatabi.ll
Passes test-suite at -O0,-O2 and with mips32r2 and mips32r1.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits, aemerson, rfuhler
Differential Revision: http://reviews.llvm.org/D5920
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228958
91177308-0d34-0410-b5e6-
96231b3b80d8
Bjorn Steinbrink [Thu, 12 Feb 2015 21:04:22 +0000 (21:04 +0000)]
Fix a crash in the assumption cache when inlining indirect function calls
Summary:
Instances of the AssumptionCache are per function, so we can't re-use
the same AssumptionCache instance when recursing in the CallAnalyzer to
analyze a different function. Instead we have to pass the
AssumptionCacheTracker to the CallAnalyzer so it can get the right
AssumptionCache on demand.
Reviewers: hfinkel
Subscribers: llvm-commits, hans
Differential Revision: http://reviews.llvm.org/D7533
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228957
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 12 Feb 2015 20:40:19 +0000 (20:40 +0000)]
Update test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228956
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 12 Feb 2015 20:26:46 +0000 (20:26 +0000)]
InstCombine: Allow folding of xor into icmp by changing the predicate for vectors
The loop vectorizer can create this pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228954
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 12 Feb 2015 20:01:03 +0000 (20:01 +0000)]
Relaxed over-zealous alignment requirement for VEX-encoded AES instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228953
91177308-0d34-0410-b5e6-
96231b3b80d8
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