Commit Graph

110478 Commits

Author SHA1 Message Date
Nick Lewycky
0f87df2033 Fix test to use the right metadata node (reapply r223239 plus a fix) and also to use the correct path to the GCNO file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223244 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 17:32:44 +00:00
Colin LeMahieu
e6c2d47e82 [Hexagon] [NFC] Renaming *packetStart to *packetBegin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223243 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 17:31:43 +00:00
Alexander Potapenko
22b6c01fc8 Revert r223239, which broke some bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223240 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 16:03:08 +00:00
Alexander Potapenko
2afd191abd Fix the metadata number used by llvm.gcov to match the number of the inserted metadata node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223239 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 15:15:58 +00:00
Aaron Ballman
42fcf3d61a Silencing several "multiple copy constructors" warnings from MSVC; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223238 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 14:44:16 +00:00
Aaron Ballman
13e20a9dac Silencing a 32-bit implicit conversion warning in MSVC; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223237 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 14:39:58 +00:00
Evgeniy Stepanov
78d5d1ea1b msan] Add compile-time checks for missing origins.
This change makes MemorySanitizer instrumentation a bit more strict
about instructions that have no origin id assigned to them.

This would have caught the bug that was fixed in r222918.

This is re-commit of r222997, reverted in r223211, with 3 more
missing origins added.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223236 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 14:15:53 +00:00
Erik Eckstein
10e28ca6b1 InstCombine: simplify signed range checks
Try to convert two compares of a signed range check into a single unsigned compare.
Examples:
(icmp sge x, 0) & (icmp slt x, n) --> icmp ult x, n
(icmp slt x, 0) | (icmp sgt x, n) --> icmp ugt x, n




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223224 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 10:39:15 +00:00
Hal Finkel
cf988bca67 [PowerPC] Print all inline-asm consts as signed numbers
Almost all immediates in PowerPC assembly (both 32-bit and 64-bit) are signed
numbers, and it is important that we print them as such. To make sure that
happens, we change PPCTargetLowering::LowerAsmOperandForConstraint so that it
does all intermediate checks on a signed-extended int64_t value, and then
creates the resulting target constant using MVT::i64. This will ensure that all
negative values are printed as negative values (mirroring what is done in other
backends to achieve the same sign-extension effect).

This came up in the context of inline assembly like this:
  "add%I2   %0,%0,%2", ..., "Ir"(-1ll)
where we used to print:
  addi   3,3,4294967295
and gcc would print:
  addi   3,3,-1
and gas accepts both forms, but our builtin assembler (correctly) does not. Now
we print -1 like gcc does.

While here, I replaced a bunch of custom integer checks with isInt<16> and
friends from MathExtras.h.

Thanks to Paul Hargrove for the bug report.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223220 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 09:37:50 +00:00
Charlie Turner
10cae8e352 Emit ABI_FP_rounding attribute.
LLVM understands a -enable-sign-dependent-rounding-fp-math codegen option. When
the user has specified this option, the Tag_ABI_FP_rounding attribute should be
emitted with value 1. This option currently does not appear to disable
transformations and optimizations that assume default floating point rounding
behavior, AFAICT, but the intention should be recorded in the build attributes,
regardless of what the compiler actually does with the intention.

Change-Id: If838578df3dc652b6f2796b8d152545674bcb30e

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223218 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 08:12:26 +00:00
Charlie Turner
78f9ab5f7c Add tests for default value of Tag_ABI_FP_rounding.
Change-Id: I051866d073fc6ce87ce3e693a3762da6d81f4393

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223217 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 07:59:50 +00:00
Benjamin Poulain
a941057b6c Fix a typo in the documentation of LTO
Fix defininitions->definitions.

Reviewed by David Blaikie.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223216 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 07:32:36 +00:00
Rafael Espindola
eee41dbb65 Ask the module for its the identified types.
When lazy reading a module, the types used in a function will not be visible to
a TypeFinder until the body is read.

This patch fixes that by asking the module for its identified struct types.
If a materializer is present, the module asks it. If not, it uses a TypeFinder.

This fixes pr21374.

I will be the first to say that this is ugly, but it was the best I could find.

Some of the options I looked at:

* Asking the LLVMContext. This could be made to work for gold, but not currently
  for ld64. ld64 will load multiple modules into a single context before merging
  them. This causes us to see types from future merges. Unfortunately,
  MappedTypes is not just a cache when it comes to opaque types. Once the
  mapping has been made, we have to remember it for as long as the key may
  be used. This would mean moving MappedTypes to the Linker class and having
  to drop the Linker::LinkModules static methods, which are visible from C.

* Adding an option to ignore function bodies in the TypeFinder. This would
  fix the PR by picking the worst result. It would work, but unfortunately
  we are currently quite dependent on the upfront type merging. I will
  try to reduce our dependency, but it is not clear that we will be able
  to get rid of it for now.

The only clean solution I could think of is making the Module own the types.
This would have other advantages, but it is a much bigger change. I will
propose it, but it is nice to have this fixed while that is discussed.

With the gold plugin, this patch takes the number of types in the LTO clang
binary from 52817 to 49669.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223215 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 07:18:23 +00:00
Duncan P. N. Exon Smith
59c9cb75d2 ADT: Rename argument in emplace_back_impl
Rename a functor argument in r223201 from `emplace` to `construct` to
reduce confusion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223212 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 05:53:24 +00:00
Nick Lewycky
3c6860c8a1 Revert r222997. The newly added compile-time checks are finding missing origins, testcase is being reduced and a PR will be posted shortly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223211 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 05:47:00 +00:00
Duncan P. N. Exon Smith
5ed8a767a0 LoopVectorize: Remove unnecessary RAUW
Remove an unnecessary `MDNode::replaceAllUsesWith()`.  In the preceding
line, `TheLoop->setLoopID()` visits all backedges and sets the new loop
ID.  This sufficiently updates the loop metadata.

Metadata RAUW is going away as part of PR21532.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223210 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 05:41:20 +00:00
Matt Arsenault
a4ec31ed52 R600/SI: Fix SIFixSGPRCopies for copies to physical registers
This shows up when operands required to be passed in VCC are copied
to.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223208 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 05:22:39 +00:00
Matt Arsenault
5c2d295d86 R600/SI: Remove incorrect assertion
This can be a COPY to a physical register, such as VCC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223207 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 05:22:38 +00:00
Matt Arsenault
ec0a7cd15a R600/SI: Remove i1 pseudo VALU ops
Select i1 logical ops directly to 64-bit SALU instructions.
Vector i1 values are always really in SGPRs, with each
bit for each item in the wave. This saves about 4 instructions
when and/or/xoring any condition, and also helps write conditions
that need to be passed in vcc.

This should work correctly now that the SGPR live range
fixing pass works. More work is needed to eliminate the VReg_1
pseudo regclass and possibly the entire SILowerI1Copies pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223206 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 05:22:35 +00:00
Matt Arsenault
bd5f9f45d1 R600/SI: Fix suspicious indexing
The loop is over the operands of an instruction, and checks the
register with the sub reg index of the dest register. This probably
meant to be checking the sub reg index of the same operand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223205 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 05:22:32 +00:00
Matt Arsenault
cfde1fb5be R600/SI: Fix running SILowerI1Copies a second time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223204 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 05:22:30 +00:00
Matt Arsenault
84e23e08f1 R600/SI: Fix live range error hidden by SIFoldOperands
m0 is treated as a virtual register class with a single register
rather than the physical register it really is. This was updating
the live range of the used virtual copy of m0 from the first ds_read
instruction, and leaving the unused copy unchanged. This resulted in a
"Live segment doesn't end at a valid instruction" verifier error because
the erased instructions. Update the live range of the second copy (which
should be dead).

No test since I'm not sure how to trigger this with SIFoldOperands
enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223203 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 05:22:29 +00:00
Duncan P. N. Exon Smith
ba2915d05c ADT: Add SmallVector<>::emplace_back(): fixup
Add missing `void` return type from `!LLVM_HAS_VARIADIC_TEMPLATES` case
in r223201.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223202 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 04:49:16 +00:00
Duncan P. N. Exon Smith
fe03508abd ADT: Add SmallVector<>::emplace_back()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223201 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 04:45:09 +00:00
Tom Stellard
857550322c StructurizeCFG: Use LoopInfo analysis for better loop detection
We were assuming that each back-edge in a region represented a unique
loop, which is not always the case.  We need to use LoopInfo to
correctly determine which back-edges are loops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223199 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 04:28:32 +00:00
Duncan P. N. Exon Smith
2212800542 NVPTX: Delete dead code
`MDNode` does not inherit from `User`, and it never has a name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223198 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 04:13:23 +00:00
Tom Stellard
a4cb89023d R600/SI: Enable inline assembly
We just needed to remove the assertion in
AMDGPURegisterInfo::getFrameRegister(), which is called when
initializing the parser for inline assembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223197 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 04:08:00 +00:00
Peter Zotov
0245b12df2 [OCaml] [cmake] Disable OCaml bindings if ctypes >=0.3 is not found.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223195 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 03:39:01 +00:00
Matt Arsenault
5097660f86 R600/SI: Change mubuf offsets to print as decimal
This matches SC's behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223194 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 03:12:13 +00:00
Nick Lewycky
92d7d4dcd7 Emit the entry block first and the exit block second, then all the blocks in between afterwards. This is what gcc always does, and some out of tree tools depend on that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223193 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 02:45:01 +00:00
NAKAMURA Takumi
61372ea958 GCRelocateOperands: Try to appease msc17.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223192 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 02:40:24 +00:00
Peter Collingbourne
bb660fc192 Prologue support
Patch by Ben Gamari!

This redefines the `prefix` attribute introduced previously and
introduces a `prologue` attribute.  There are a two primary usecases
that these attributes aim to serve,

  1. Function prologue sigils

  2. Function hot-patching: Enable the user to insert `nop` operations
     at the beginning of the function which can later be safely replaced
     with a call to some instrumentation facility

  3. Runtime metadata: Allow a compiler to insert data for use by the
     runtime during execution. GHC is one example of a compiler that
     needs this functionality for its tables-next-to-code functionality.

Previously `prefix` served cases (1) and (2) quite well by allowing the user
to introduce arbitrary data at the entrypoint but before the function
body. Case (3), however, was poorly handled by this approach as it
required that prefix data was valid executable code.

Here we redefine the notion of prefix data to instead be data which
occurs immediately before the function entrypoint (i.e. the symbol
address). Since prefix data now occurs before the function entrypoint,
there is no need for the data to be valid code.

The previous notion of prefix data now goes under the name "prologue
data" to emphasize its duality with the function epilogue.

The intention here is to handle cases (1) and (2) with prologue data and
case (3) with prefix data.

References
----------

This idea arose out of discussions[1] with Reid Kleckner in response to a
proposal to introduce the notion of symbol offsets to enable handling of
case (3).

[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-May/073235.html

Test Plan: testsuite

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223189 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 02:08:38 +00:00
NAKAMURA Takumi
8cc929ea00 ExceptionDemo: Let setMCJITMemoryManager() take unique_ptr, since r223183.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223188 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 02:05:51 +00:00
Ahmed Bougacha
ad41590c48 [X86][MC] Intel syntax: accept implicit memory operand sizes larger than 80.
The X86AsmParser intel handling was refactored in r216481, making it
try each different memory operand size to see which one matches.
Operand sizes larger than 80 ("[xyz]mmword ptr") were forgotten, which
led to an "invalid operand" error for code such as:
  movdqa [rax], xmm0


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223187 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 02:03:26 +00:00
Lang Hames
5ab94e7135 [MCJIT] Unique-ptrify the RTDyldMemoryManager member of MCJIT. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223183 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 00:51:19 +00:00
Hal Finkel
1dce7b19a0 [PowerPC] Fix readcyclecounter to be custom expanded for all 32-bit targets
We need to use the custom expansion of readcyclecounter on all 32-bit targets
(even those with 64-bit registers). This should fix the ppc64 buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223182 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 00:19:17 +00:00
Tim Northover
09d2a61cd4 AArch64: strengthen Darwin ABI alignment assumptions
A global variable without an explicit alignment specified should be assumed to
be ABI-aligned according to its type, like on other platforms. This allows us
to use better memory operations when accessing it.

rdar://18533701

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223180 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 23:53:43 +00:00
Pete Cooper
dfc69d2c27 Use a typed enum instead of 'unsigned char' for packed field. NFC.
This makes it easier to debug Twine as the 'Kind' fields now show their enum values in lldb and not escaped characters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223178 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 23:34:23 +00:00
Tim Northover
1dad6937c5 AArch64: don't be too greedy when folding :lo12: accesses into mem ops.
This frequently leads to cases like:
   ldr xD, [xN, :lo12:var]
   add xA, xN, :lo12:var
   ldr xD, [xA, #8]

where the ADD would have been needed anyway, and the two distinct addressing
modes can prevent the formation of an ldp. Because of how we handle ADRP
(aggressively forming an ADRP/ADD pseudo-inst at ISel time), this pattern also
results in duplicated ADRP instructions (one on its own to cover the ldr, and
one combined with the add).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223172 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 23:13:39 +00:00
Michael Zolotukhin
97be10d98f PR21302. Vectorize only bottom-tested loops.
rdar://problem/18886083

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223171 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 22:59:06 +00:00
Michael Zolotukhin
6845cace0e Apply loop-rotate to several vectorizer tests.
Such loops shouldn't be vectorized due to the loops form.
After applying loop-rotate (+simplifycfg) the tests again start to check
what they are intended to check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223170 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 22:59:02 +00:00
Simon Pilgrim
ec49b722fd [X86][SSE] Keep 4i32 vector insertions in integer domain on SSE4.1 targets
4i32 shuffles for single insertions into zero vectors lowers to X86vzmovl which was using (v)blendps - causing domain switch stalls. This patch fixes this by using (v)pblendw instead.

The updated tests on test/CodeGen/X86/sse41.ll still contain a domain stall due to the use of insertps - I'm looking at fixing this in a future patch.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223165 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 22:31:23 +00:00
Chris Matthews
dcedd15f58 Give lit a --xunit-xml-output option for saving results in xunit format
--xunit-xml-output saves test results to disk in JUnit's xml format. This will allow Jenkins to report the details of a lit run.
  
  Based on a patch by David Chisnall.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223163 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 22:19:21 +00:00
Hal Finkel
1855b261db [PowerPC] Implement readcyclecounter for PPC32
We've long supported readcyclecounter on PPC64, but it is easier there (the
read of the 64-bit time-base register can be accomplished via a single
instruction). This now provides an implementation for PPC32 as well. On PPC32,
the time-base register is still 64 bits, but can only be read 32 bits at a time
via two separate SPRs. The ISA manual explains how to do this properly (it
involves re-reading the upper bits and looping if the counter has wrapped while
being read).

This requires PPC to implement a custom integer splitting legalization for the
READCYCLECOUNTER node, turning it into a target-specific SDAG node, which then
gets turned into a pseudo-instruction, which is then expanded to the necessary
sequence (which has three SPR reads, the comparison and the branch).

Thanks to Paul Hargrove for pointing out to me that this was still unimplemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223161 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 22:01:00 +00:00
Tom Stellard
db7067607f R600/SI: Emit amd_kernel_code_t header for AMDGPU environment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223160 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 22:00:07 +00:00
Eric Christopher
9643005b50 Make sure that the TargetOptions operator== is checking the
full contents of the class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223159 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 21:57:15 +00:00
Lang Hames
26cc5bea39 [AArch64][Stackmaps] Optimize stackmap shadows on AArch64.
Reduce the number of nops emitted for stackmap shadows on AArch64 by counting
non-stackmap instructions up to the next branch target towards the requested
shadow.

<rdar://problem/14959522>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223156 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 21:36:24 +00:00
Tom Stellard
d90fc9d0fc R600/SI: Move more information into SIProgramInfo struct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223154 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 21:28:53 +00:00
Eric Christopher
73271f0853 Add bindings for the rest of the MCJIT options that we previously
had support for. We're still missing a binding for an MCJIT
memory manager.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223153 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 21:09:01 +00:00
Matt Arsenault
8d7b46d0d6 R600: Cleanup some tests and add missing testcases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223151 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 21:02:20 +00:00