Commit Graph

96151 Commits

Author SHA1 Message Date
David Blaikie
994c37fcb0 DebugInfo: llvm-dwarfdump support for gnu_pubnames section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191050 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 23:01:29 +00:00
Kai Nacke
ceb3b46490 PR16726: extend rol/ror matching
C-like languages promote types like unsigned short to unsigned int before
performing an arithmetic operation. Currently the rotate matcher in the
DAGCombiner does not consider this situation.

This commit extends the DAGCombiner in the way that the pattern

(or (shl ([az]ext x), (*ext y)), (srl ([az]ext x), (*ext (sub 32, y))))

is folded into

([az]ext (rotl x, y))

The matching is restricted to aext and zext because in this cases the upper
bits are either undefined or known. Test case is included.

This fixes PR16726.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191049 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 23:00:28 +00:00
Kai Nacke
7cb98c9cb7 Revert PR16726: extend rol/ror matching
There is a buildbot failure. Need to investigate this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191048 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 22:53:36 +00:00
Kai Nacke
a5950e0149 PR16726: extend rol/ror matching
C-like languages promote types like unsigned short to unsigned int before
performing an arithmetic operation. Currently the rotate matcher in the
DAGCombiner does not consider this situation.

This commit extends the DAGCombiner in the way that the pattern

(or (shl ([az]ext x), (*ext y)), (srl ([az]ext x), (*ext (sub 32, y))))

is folded into

([az]ext (rotl x, y))

The matching is restricted to aext and zext because in this cases the upper
bits are either undefined or known. Test case is included.

This fixes PR16726.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191045 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 22:36:39 +00:00
David Blaikie
18a6ade6cd DebugInfo: Improve IR annotation comments for GNU pubthings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191043 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 22:19:37 +00:00
Peter Collingbourne
88fae0edcc Fix LTO handling of module-level assembly (PR14152).
Patch by Tom Roeder!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191042 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 22:15:52 +00:00
Bill Wendling
617305a0eb Add testcase to make sure we don't generate too many jumps for a une compare.
<rdar://problem/7859988>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191040 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 21:58:20 +00:00
Benjamin Kramer
03fadd7f14 Unbreak C++03 build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191039 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 21:30:00 +00:00
Shuxin Yang
b1ccfb3a54 [Fast-math] Disable "(C1/X)*C2 => (C1*C2)/X" if C1/X has multiple uses.
If "C1/X" were having multiple uses, the only benefit of this
transformation is to potentially shorten critical path. But it is at the
cost of instroducing additional div.

  The additional div may or may not incur cost depending on how div is
implemented. If it is implemented using Newton–Raphson iteration, it dosen't
seem to incur any cost (FIXME). However, if the div blocks the entire
pipeline, that sounds to be pretty expensive. Let CodeGen to take care 
this transformation.

  This patch sees 6% on a benchmark.

rdar://15032743


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191037 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 21:13:46 +00:00
Benjamin Kramer
bf22298093 InstCombine: Don't allow turning vector-of-pointer loads into vector-of-integer.
The code below can't handle any pointers. PR17293.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191036 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 20:59:04 +00:00
David Blaikie
9599f51559 Unshift the GDB index/GNU pubnames constants modified in r191025
Based on code review feedback from Eric Christopher, unshifting these
constants as they can appear in the gdb_index itself, shifted a further
24 bits. This means that keeping them preshifted is a bit inflexible, so
let's not do that.

Given the motivation, wrap up some nicer enums, more type safety, and
some utility functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191035 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 20:40:26 +00:00
Anders Waldenborg
f2144ed439 llvm-c: Add LLVMGetPointerToFunction
Differential Revision: http://llvm-reviews.chandlerc.com/D1715



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191030 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 19:55:06 +00:00
Anders Waldenborg
f89dacb782 llvm-c: Make LLVMGetFirstTarget a proper prototype
This avoids warnings when included in a application that
uses -Wstrict-prototypes.

Differential Revision: http://llvm-reviews.chandlerc.com/D1713



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191029 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 19:43:55 +00:00
Eric Christopher
43c8ad1718 Remove extraneous space, the asm printing infrastructure adds a space
in normally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191026 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 18:41:40 +00:00
David Blaikie
ecb41cfe36 DebugInfo: Simplify gnu_pubnames index computation.
Names open to bikeshedding. Could switch back to the constants being
unshifted, but this way seems a bit easier to work with.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191025 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 18:39:59 +00:00
Yi Jiang
cdfb43f0a6 X86 horizontal vector reduction cost model
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191021 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 17:48:48 +00:00
David Blaikie
e56a4d9236 Remove unnecessary conditional operators performing bool->bool conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191020 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 17:33:35 +00:00
David Blaikie
08b5ff7f58 Fix a typo and simplify a boolean expression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191018 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 17:27:48 +00:00
Shuxin Yang
1bc7315c02 GVN proceeds in the presence of dead code.
This is how it ignores the dead code:
1) When a dead branch target, say block B, is identified, all the
    blocks dominated by B is dead as well.

2) The PHIs of those blocks in dominance-frontier(B) is updated such
   that the operands corresponding to dead predecessors are replaced
   by "UndefVal".

   Using lattice's jargon, the "UndefVal" is the "Top" in essence.
   Phi node like this "phi(v1 bb1, undef xx)" will be optimized into
   "v1" if v1 is constant, or v1 is an instruction which dominate this
   PHI node.

3) When analyzing the availability of a load L, all dead mem-ops which
   L depends on disguise as a load which evaluate exactly same value as L.

4) The dead mem-ops will be materialized as "UndefVal" during code motion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191017 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 17:22:51 +00:00
Reid Kleckner
31eb340cb6 msbuild: Set _MSC_VER to match the CRT we're using
Various Windows SDK headers use _MSC_VER values to figure out what
version of the VC++ headers they're using, in particular for SAL macros.

Patch by Paul Hampson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191015 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 17:18:35 +00:00
Shuxin Yang
4f77a21d6c Add function DominatorTree::getDescendants().
As its name suggests, this function will return all basic blocks
dominated by a given block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191014 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 17:18:35 +00:00
Reid Kleckner
a22ff961db Include an LLVM-vs2012_xp toolset in the MSBuild integration
Patch by Paul Hampson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191010 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 16:50:40 +00:00
Evgeniy Stepanov
6591308b7e [msan] Wrap indirect functions.
Adds a flag to the MemorySanitizer pass that enables runtime rewriting of
indirect calls. This is part of MSanDR implementation and is needed to return
control to the DynamiRio-based helper tool on transition between instrumented
and non-instrumented modules. Disabled by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191006 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 15:22:35 +00:00
Benjamin Kramer
530d09a22b DAGCombiner: Don't fold vector muls with constants that look like a splat of a power of 2 but differ in bit width.
PR17283.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191000 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 13:28:20 +00:00
Justin Holewinski
c9554b1342 [NVPTX] Make constant vector test case endian-independent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190998 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 13:14:44 +00:00
Justin Holewinski
3917535b1a [NVPTX] Support constant vector globals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190997 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 12:51:46 +00:00
Amara Emerson
5df37dab76 [ARMv8] Add support for the v8 cryptography extensions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190996 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 11:59:01 +00:00
Tim Northover
adadf887cb X86: FrameIndex addressing modes do have a base register.
When selecting the DAG (add (WrapperRIP ...), (FrameIndex ...)), X86 code had
spotted the FrameIndex possibility and was working out whether it could fold
the WrapperRIP into this.

The test for forming a %rip version is notionally whether we already have a
base or index register (%rip precludes both), but we were forgetting to account
for the register that would be inserted later to access the frame.

rdar://problem/15024520

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190995 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 11:33:53 +00:00
Andrew Trick
abe68f5917 Revert "Encapsulate PassManager debug flags to avoid static init and cxa_exit."
Working on a better solution to this.

This reverts commit 7d4e9934e7.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190990 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 06:02:43 +00:00
Andrew Trick
7d4e9934e7 Encapsulate PassManager debug flags to avoid static init and cxa_exit.
This puts all the global PassManager debugging flags, like
-print-after-all and -time-passes, behind a managed static. This
eliminates their static initializers and, more importantly, exit-time
destructors.

The only behavioral change I anticipate is that tools need to
initialize the PassManager before parsing the command line in order to
export these options, which makes sense. Tools that already initialize
the standard passes (opt/llc) don't need to do anything new.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190974 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 23:31:16 +00:00
Andrew Trick
2cccc6220c whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190973 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 23:31:10 +00:00
Reed Kotler
c1fe3e3b33 Fix two issues regarding Got pointer (GP) setup.
1) make sure that the first two instructions of the sequence cannot
separate from each other. The linker requires that they be sequential.
If they get separated, it can still work but it will not work in all
cases because the first of the instructions mostly involves the hi part
of the pc relative offset and that part changes slowly. You would have
to be at the right boundary for this to matter.
2) make sure that this sequence begins  on a longword boundary. 
There appears to be a bug in binutils which makes some of these calculations
get messed up if the instruction sequence does not begin on a longword
boundary. This is being investigated with the appropriate binutils folks.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190966 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 22:46:09 +00:00
Adrian Prantl
0a4371a207 Debug info: Get rid of the VLA indirection hack in FastISel.
Use the DIVariable::isIndirect() flag set by the frontend instead of
guessing whether to set the machine location's indirection bit.
Paired commit with CFE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190961 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 22:08:59 +00:00
Preston Gurd
51279d45f7 Attempt to fix llvm-ppc64-linux2 buildbot failure by adding
-march=x86 to SLM test.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190958 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 21:39:33 +00:00
Preston Gurd
7d03cc8715 Verify that llvm can generate the prefetchw instruction when the CPU is
Atom Silvermont.

Patch by Sriram Murali.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190957 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 21:08:09 +00:00
Galina Kistanova
d139e02e9b Remove empty dir.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190952 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 18:39:38 +00:00
Galina Kistanova
5e7acc63e0 Remove empty dir.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190948 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 17:58:41 +00:00
Filip Pizlo
b4b9b3b24c Make DynamicLibrary use ManagedStatic. This is pretty simple and should just work as
advertised - but it does have the caveat that calls to DynamicLibrary::AddSymbol will 
"reset" if you shutdown llvm and try to come back for seconds.  This is a subtle 
behavior change, but I'm assuming that nobody is affected by it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190946 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 16:40:14 +00:00
Chandler Carruth
69f99bf3a3 More XCore TTI cleanup -- remove an unused private field flagged by
-Wunused-private-field with Clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190941 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 14:11:11 +00:00
Chandler Carruth
89ec610f76 Name the XCore target-specific subdirectories canonically.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190940 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 14:08:30 +00:00
Kostya Serebryany
ac04abaf5a [asan] call __asan_stack_malloc_N only if use-after-return detection is enabled with the run-time option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190939 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 14:07:14 +00:00
NAKAMURA Takumi
fa7b1e24e5 A couple of tests, in llvm/test/Transforms/*/xcore, are XCore-specific. They should be excluded when XCore is not built.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190938 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 13:56:16 +00:00
NAKAMURA Takumi
8c03d6a9e8 Target/XCore/CMakeLists.txt: Add XCoreTargetTransformInfo.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190937 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 12:59:41 +00:00
Robert Lytton
d072d1b2a3 Prevent LoopVectorizer and SLPVectorizer running if the target has no vector registers.
XCore target: Add XCoreTargetTransformInfo
This is where getNumberOfRegisters() resides, which in turn returns the
number of vector registers (=0).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190936 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 12:43:35 +00:00
Andrea Di Biagio
af96481135 Re-add tests from r179291 which were accidentally removed by r181177.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190934 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 12:06:59 +00:00
Richard Sandiford
e2d6f91d63 [SystemZ] Add unsigned compare-and-branch instructions
For some reason I never got around to adding these at the same time as
the signed versions.  No idea why.

I'm not sure whether this SystemZII::BranchC* stuff is useful, or whether
it should just be replaced with an "is normal" flag.  I'll leave that
for later though.

There are some boundary conditions that can be tweaked, such as preferring
unsigned comparisons for equality with [128, 256), and "<= 255" over "< 256",
but again I'll leave those for a separate patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190930 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 09:56:40 +00:00
Joey Gouly
8634b0ee47 'svn add' the test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190929 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 09:46:49 +00:00
Joey Gouly
a4d46d7fc6 [ARMv8] Add CRC instructions.
Patch by Bradley Smith!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190928 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 09:45:55 +00:00
Filip Pizlo
163df38bdf Revert r190921. It broke Windows.
I'll roll it back in when I have a chance to look at it in detail.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190923 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 06:37:55 +00:00
Filip Pizlo
e77ea6b07e Make DynamicLibrary use ManagedStatic. This is pretty simple and should just work as
advertised - but it does have the caveat that calls to DynamicLibrary::AddSymbol will 
"reset" if you shutdown llvm and try to come back for seconds.  This is a subtle 
behavior change, but I'm assuming that nobody is affected by it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190921 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 06:03:27 +00:00