Commit Graph

93565 Commits

Author SHA1 Message Date
Sylvestre Ledru 93a491bbf4 The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD.
This kind of simplification is sometimes useful, but in general it's not correct. 

As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the
build definitions used for FreeBSD, whereas for userland-related issues we want to
match the definitions used for other systems with Glibc.

The current modification adjusts the build system so that they can be distinguished,
and explicitly adds GNU/kFreeBSD to the build checks in which it belongs.

Fixes bug #16444.

Patch by Robert Millan in the context of Debian.

llvm-svn: 185311
2013-07-01 08:07:52 +00:00
Arnold Schwaighofer ef51cf202b LoopVectorize: Math functions only read rounding mode
Math functions are mark as readonly because they read the floating point
rounding mode. Because we don't vectorize loops that would contain function
calls that set the rounding mode it is safe to ignore this memory read.

llvm-svn: 185299
2013-07-01 00:54:44 +00:00
Vincent Lejeune a8a50248d8 R600: Fix an unitialized variable in R600InstrInfo.cpp
llvm-svn: 185294
2013-06-30 21:44:06 +00:00
Ahmed Bougacha 8347352e11 X86: POP*rmm: move address operand to (ins) from (outs).
llvm-svn: 185292
2013-06-30 20:44:50 +00:00
Stephen Lin 2e551adcd9 DeadArgumentElimination: keep return value on functions that have a live argument with the 'returned' attribute (rather than generate invalid IR); however, if both can be eliminated, both will be
llvm-svn: 185290
2013-06-30 20:26:21 +00:00
Benjamin Kramer cc846016bf ConstantFold: Check that truncating the other side is safe under a sext when trying to remove a sext from a compare.
Fixes PR16462.

llvm-svn: 185284
2013-06-30 13:47:43 +00:00
David Majnemer 7a69d2c06a ValueTracking: Teach isKnownToBeAPowerOfTwo about (ADD X, (XOR X, Y)) where X is a power of two
This allows us to simplify urem instructions involving the add+xor to
turn into simpler math.

llvm-svn: 185272
2013-06-29 23:44:53 +00:00
Benjamin Kramer 3cc579a95b NVPTX: Fold otherwise unused variable into assert.
Avoids unused variable warnings in release builds.

llvm-svn: 185271
2013-06-29 22:51:12 +00:00
Benjamin Kramer 4093f29366 InstCombine: Also turn selects fed by an and into arithmetic when the types don't match.
Inserting a zext or trunc is sufficient. This pattern is somewhat common in
LLVM's pointer mangling code.

llvm-svn: 185270
2013-06-29 21:17:04 +00:00
Benjamin Kramer 396906456f R600: Unbreak GCC build.
operator++ on an enum is not legal. clang happens to accept it anyways, I think
that's a known bug.

llvm-svn: 185269
2013-06-29 20:04:19 +00:00
Vincent Lejeune 77a8352476 R600: Support schedule and packetization of trans-only inst
llvm-svn: 185268
2013-06-29 19:32:43 +00:00
Vincent Lejeune bb8a872158 R600: Bank Swizzle now display SCL equivalent
llvm-svn: 185267
2013-06-29 19:32:29 +00:00
Benjamin Kramer fd51092719 misched: Compress pairs returned by getUnderlyingObjectsForInstr.
llvm-svn: 185266
2013-06-29 18:41:17 +00:00
Benjamin Kramer 4ab72f9b9a LoopVectorizer: Pack MemAccessInfo pairs.
llvm-svn: 185263
2013-06-29 17:52:08 +00:00
Benjamin Kramer 53545693d7 Move helper classes into anonymous namespaces.
llvm-svn: 185262
2013-06-29 17:02:06 +00:00
David Majnemer 5953d3712a InstCombine: FoldGEPICmp shouldn't change sign of base pointer comparison
Changing the sign when comparing the base pointer would introduce all
sorts of unexpected things like:
  %gep.i = getelementptr inbounds [1 x i8]* %a, i32 0, i32 0
  %gep2.i = getelementptr inbounds [1 x i8]* %b, i32 0, i32 0
  %cmp.i = icmp ult i8* %gep.i, %gep2.i
  %cmp.i1 = icmp ult [1 x i8]* %a, %b
  %cmp = icmp ne i1 %cmp.i, %cmp.i1
  ret i1 %cmp

into:
  %cmp.i = icmp slt [1 x i8]* %a, %b
  %cmp.i1 = icmp ult [1 x i8]* %a, %b
  %cmp = xor i1 %cmp.i, %cmp.i1
  ret i1 %cmp

By preserving the original sign, we now get:
  ret i1 false

This fixes PR16483.

llvm-svn: 185259
2013-06-29 10:28:04 +00:00
David Majnemer 92a8a7d45a InstCombine: Small whitespace cleanup in FoldGEPICmp
llvm-svn: 185258
2013-06-29 09:45:35 +00:00
David Majnemer 797227eea6 InstCombine: Be more agressive optimizing 'udiv' instrs with 'select' denoms
Real world code sometimes has the denominator of a 'udiv' be a
'select'.  LLVM can handle such cases but only when the 'select'
operands are symmetric in structure (both select operands are a constant
power of two or a left shift, etc.).  This falls apart if we are dealt a
'udiv' where the code is not symetric or if the select operands lead us
to more select instructions.

Instead, we should treat the LHS and each select operand as a distinct
divide operation and try to optimize them independently.  If we can
to simplify each operation, then we can replace the 'udiv' with, say, a
'lshr' that has a new select with a bunch of new operands for the
select.

llvm-svn: 185257
2013-06-29 08:40:07 +00:00
Nadav Rotem 0a25727f31 We preserve the CFG and some of the analysis passes.
llvm-svn: 185251
2013-06-29 05:38:15 +00:00
Nadav Rotem e00343446c Update docs.
llvm-svn: 185250
2013-06-29 05:37:19 +00:00
Manman Ren 9822a1104c Debug Info: clean up usage of Verify.
No functionality change.
It should suffice to check the type of a debug info metadata, instead of
calling Verify. For cases where we know the type of a DI metadata, use
assert.

llvm-svn: 185249
2013-06-29 05:01:19 +00:00
Richard Trieu d7fd95a5c1 Change assert(0 && "text") to llvm_unreachable(0 && "text")
llvm-svn: 185243
2013-06-28 23:46:19 +00:00
David Majnemer b889e405eb InstCombine: Optimize (1 << X) Pred CstP2 to X Pred Log2(CstP2)
We may, after other optimizations, find ourselves with IR that looks
like:

  %shl = shl i32 1, %y
  %cmp = icmp ult i32 %shl, 32

Instead, we should just compare the shift count:

  %cmp = icmp ult i32 %y, 5

llvm-svn: 185242
2013-06-28 23:42:03 +00:00
Preston Briggs bb97db3df9 extending the interface of Dependence slightly to support future work
llvm-svn: 185241
2013-06-28 23:34:23 +00:00
Matt Arsenault 50a16a4275 Fix copypaste error in test.
Thename says it's an i32*, but it was actually creating another i8*

llvm-svn: 185239
2013-06-28 23:24:10 +00:00
Matt Arsenault b74e3dec30 Fix extra whitespace / formatting
llvm-svn: 185238
2013-06-28 23:24:05 +00:00
Jakob Stoklund Olesen 7735d82f64 Try to unbreak Linux buildbots.
llvm-svn: 185237
2013-06-28 22:54:16 +00:00
Jakob Stoklund Olesen 0b075103cd Minimize precision loss when computing cyclic probabilities.
Allow block frequencies to exceed 32 bits by using the new
BlockFrequency division function.

llvm-svn: 185236
2013-06-28 22:40:43 +00:00
Hal Finkel ac1a24b508 PPC: Ignore spill/restore requests for VRSAVE (except on Darwin)
This fixes PR16418, which reports that a function calling
__builtin_unwind_init() asserts. The cause is that this generates a
spill/restore for VRSAVE, and we support that only on Darwin (because VRSAVE is
only really used on Darwin).

The test case checks only that we don't crash. We can add correctness checks
once someone verifies what behavior the function is supposed to have.

llvm-svn: 185235
2013-06-28 22:29:56 +00:00
Daniel Malea bfd578dc18 Replace UNIXy path with os-independent one in DebugIR unit test
- should resolve windows buildbot failure

llvm-svn: 185232
2013-06-28 22:17:57 +00:00
Nadav Rotem 060be733a5 SLP Vectorizer: Add support for trees with external users.
To support this we have to insert 'extractelement' instructions to pick the right lane.
We had this functionality before but I removed it when we moved to the multi-block design because it was too complicated.

llvm-svn: 185230
2013-06-28 22:07:09 +00:00
Richard Trieu 4d18c9cc4e Fix broken asserts that never fire.
Change assert("text") to assert(0 && "text").  The first case is a const char *
to bool conversion, which always evaluates to true, never triggering the
assert.  The second case will always trigger the assert.

llvm-svn: 185227
2013-06-28 21:54:25 +00:00
Jakob Stoklund Olesen 3192b2fcea Fix a bad overflow check pointed out by Ben.
llvm-svn: 185226
2013-06-28 21:51:18 +00:00
Daniel Malea 7291340c24 Fix Windows/Darwin build error in DebugIR unit tests
- mistakenly used get_current_dir() linux function
- replaced with getcwd/_getcwd as appropriate for current platform

llvm-svn: 185225
2013-06-28 21:49:53 +00:00
Andrew Kaylor b595f53069 Revising the MCJIT ObjectCache interface to allow subclasses to avoid retaining references to returned objects
llvm-svn: 185221
2013-06-28 21:40:16 +00:00
David Blaikie a5fc6219ee Remove unused member
llvm-svn: 185219
2013-06-28 21:28:01 +00:00
Jakob Stoklund Olesen c7e503f2e2 Eliminate an assortment of undefined behavior.
Hopefully, this fixes the PPC64 buildbots.

llvm-svn: 185218
2013-06-28 21:10:25 +00:00
Nadav Rotem 9ce3fedcdd LoopVectorizer: Refactor the code that checks if it is safe to predicate blocks.
In this code we keep track of pointers that we are allowed to read from, if they are accessed by non-predicated blocks.
We use this list to allow vectorization of conditional loads in predicated blocks because we know that these addresses don't segfault.

llvm-svn: 185214
2013-06-28 20:46:27 +00:00
Daniel Malea 4146b0404e Adding tests for DebugIR pass
- lit tests verify that each line of input LLVM IR gets a !dbg node and a
  corresponding entry of metadata that contains the line number 
- unit tests verify that DebugIR works as advertised in the interface
- refactored some useful IR generation functionality from the MCJIT unit tests
  so it can be reused

llvm-svn: 185212
2013-06-28 20:37:20 +00:00
Tom Stellard c46e56721e R600/SI: Add processor types for each CIK variant
Patch By: Alex Deucher

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
llvm-svn: 185209
2013-06-28 20:23:29 +00:00
Hal Finkel 147c287d91 Fix CodeGen/PowerPC/stack-protector.ll on OpenBSD
On OpenBSD, the stack-smash protection transform uses "__guard_local"
and "__stack_smash_handler" instead of "__stack_chk_guard" and
"__stack_chk_fail".  However, CodeGen/PowerPC/stack-protector.ll
doesn't specify a target OS, so on OpenBSD it fails.

Add -mtriple=ppc32-unknown-linux to make the test host-OS agnostic. While
there, convert to FileCheck.

Patch by Matthew Dempsky.

llvm-svn: 185206
2013-06-28 20:18:14 +00:00
David Blaikie f269497068 DebugInfo: PR14728: TLS support
Based on GCC's output for TLS variables (OP_constNu, x@dtpoff,
OP_lo_user), this implements debug info support for TLS in ELF. Verified
that this output is correct/sufficient on Linux (using gold - if you're
using binutils-ld, you'll need something with the fix for
http://sourceware.org/bugzilla/show_bug.cgi?id=15685 in it).

Support on non-ELF is sort of "arbitrary" at the moment - if Apple folks
want to discuss (or just go ahead & implement) how this should work in
MachO, etc, I'm open.

llvm-svn: 185203
2013-06-28 20:05:11 +00:00
David Blaikie f3cd7c5115 DebugInfo: Pass MCSymbolRefExprs for labels instead of MCSymbols
This is a precursor to adding debug info support for TLS which requires
non-default relocations applied to TLS symbols.

llvm-svn: 185202
2013-06-28 20:05:04 +00:00
Hal Finkel 4ca70100de Fix a PPC rlwimi instruction-selection bug
Under certain (evidently rare) circumstances, this code used to convert OR(a,
AND(x, y)) into OR(a, x). This was incorrect.

While there, I've added a comment to the code immediately above.

llvm-svn: 185201
2013-06-28 20:00:07 +00:00
Daniel Malea b17b1cd6f5 Remove needless include (unistd.h) in DebugIR pass
- should unbreak Windows builds

llvm-svn: 185198
2013-06-28 19:19:44 +00:00
Daniel Malea a960c54d3a Add flag to lli to enable debugging of IR when used with MCJIT.
- warn users when -debug-ir is used with old JIT engine (only partial debug
  info is available) 

For example, to debug an IR file with GDB (that supports JIT registration), do:

$ gdb --args lli -use-mcjit -debug-ir testcase.ll
(gdb) break main
(gdb) run
<Process continues to lli main>
(gdb) continue
<Process continues to testcase.ll main()
(gdb) step
<Now stepping through the LLVM IR in testcase.ll>

llvm-svn: 185197
2013-06-28 19:11:40 +00:00
Daniel Malea 0673464a92 Add missing header for DebugIR
- missed svn add...

llvm-svn: 185194
2013-06-28 19:07:59 +00:00
Daniel Malea 31321fa53d Remove limitation on DebugIR that made it require existing debug metadata.
- Build debug metadata for 'bare' Modules using DIBuilder
- DebugIR can be constructed to generate an IR file (to be seen by a debugger)
  or not in cases where the user already has an IR file on disk.

llvm-svn: 185193
2013-06-28 19:05:23 +00:00
Chad Rosier ee740c4d88 Fix an off-by-one error. Also make the code a little more explicit in what it
is trying to do.

llvm-svn: 185191
2013-06-28 18:57:01 +00:00
David Blaikie a67de2b1bc DebugInfo: Revise r185189 to avoid subtle 'unsigned += bool'
llvm-svn: 185190
2013-06-28 18:55:13 +00:00
David Blaikie b8ef7851dc DebugInfo: Simplify the AddressPool representation
llvm-svn: 185189
2013-06-28 18:47:19 +00:00
David Blaikie dea547b94d DebugInfo: constify the AddressPool MCSymbol pointers
llvm-svn: 185188
2013-06-28 18:47:14 +00:00
Preston Briggs 6c286b6029 (no commit message)
llvm-svn: 185187
2013-06-28 18:44:48 +00:00
Lang Hames c22e39d83d Add missing case to switch statement - DAGTypeLegalizer::ExpandIntegerResult
should expand ATOMIC_CMP_SWAP nodes the same way that it does for ATOMIC_SWAP.

Since ATOMIC_LOADs on some targets (e.g. older ARM variants) get legalized to
ATOMIC_CMP_SWAPs, the missing case had been causing i64 atomic loads to crash
during isel.

<rdar://problem/14074644>

llvm-svn: 185186
2013-06-28 18:36:42 +00:00
Jakob Stoklund Olesen ff9a5c29fe Stylistic cleanups, no functional change.
- Use static functions instead of anonymous namespace.
- Appease the Doxygen lobby.
- Use 0-based induction variable.

llvm-svn: 185185
2013-06-28 18:33:19 +00:00
Jakob Stoklund Olesen c506e5d98c Add a division operator to BlockFrequency.
Allow a BlockFrequency to be divided by a non-zero BranchProbability
with saturating arithmetic. This will be used to compute the frequency
of a loop header given the probability of leaving the loop.

Our long division algorithm already saturates on overflow, so that was a
freebie.

llvm-svn: 185184
2013-06-28 18:23:42 +00:00
Eric Christopher 7ca071bcf6 Remove unused variables.
llvm-svn: 185180
2013-06-28 18:03:54 +00:00
Justin Holewinski 8df08c73c6 [NVPTX] Select -1 instead of 1 when anyextend'ing i1 types
This makes it more consistent with the ZeroOrNegativeOneBooleanContent flag

llvm-svn: 185179
2013-06-28 17:58:15 +00:00
Justin Holewinski af258be134 [NVPTX] Add (1.0 / sqrt(x)) => rsqrt(x) generation when allowable by FP flags
llvm-svn: 185178
2013-06-28 17:58:13 +00:00
Justin Holewinski e04e4bdf71 [NVPTX] Calling conventions fix
Fix ABI handling for function
returning bool -- use st.param.b32 to return the value
and use ld.param.b32 in caller to load the return value.

llvm-svn: 185177
2013-06-28 17:58:10 +00:00
Justin Holewinski dc372df63b [NVPTX] Add support for cttz/ctlz/ctpop
llvm-svn: 185176
2013-06-28 17:58:07 +00:00
Justin Holewinski dc5e3b68f5 [NVPTX] Clean up comparison/select/convert patterns and factor out PTX instructions from their patterns
Test case is no breakage

llvm-svn: 185175
2013-06-28 17:58:04 +00:00
Justin Holewinski f8f7091722 [NVPTX] Remove i8 register class. PTX support for i8 (.b8, .u8, .s8) is rather poor and we're better off just ignoring it and letting LLVM expand all i8 ops out to i16.
llvm-svn: 185174
2013-06-28 17:57:59 +00:00
Justin Holewinski 120baee819 [NVPTX] Add support for vectorized function return values
llvm-svn: 185173
2013-06-28 17:57:55 +00:00
Justin Holewinski 44f5c60e58 [NVPTX] Clean up handling of formal arguments and enable generation of vector parameter loads
llvm-svn: 185172
2013-06-28 17:57:53 +00:00
Justin Holewinski fe44314f21 [NVPTX] Add infrastructure for vector loads/stores of parameters
llvm-svn: 185171
2013-06-28 17:57:51 +00:00
Weiming Zhao a3d87a1024 Bug 13662: Enable GPRPair for all i64 operands of inline asm on ARM
This patch assigns paired GPRs  for inline asm with
64-bit data on ARM. It's enabled for both ARM and Thumb to support modifiers
like %H, %Q, %R.

llvm-svn: 185169
2013-06-28 17:26:02 +00:00
Arnold Schwaighofer ce2c766f61 LoopVectorize: Pull dyn_cast into setDebugLocFromInst
llvm-svn: 185168
2013-06-28 17:14:48 +00:00
Hal Finkel e852add40e Fix bugpoint execution/reference output file name
sys::fs::unique_file will now loop infinitely if provided with a file name
without '%' characters and the input file already exists. As a result, bugpoint
cannot use a fixed file name for the execution output (including the reference
output).

llvm-svn: 185166
2013-06-28 16:37:52 +00:00
Arnold Schwaighofer 3b27b992ca LoopVectorize: Use static function instead of DebugLocSetter class
I used the class to safely reset the state of the builder's debug location.  I
think I have caught all places where we need to set the debug location to a new
one. Therefore, we can replace the class by a function that just sets the debug
location.

llvm-svn: 185165
2013-06-28 16:26:54 +00:00
Tom Stellard c026e8bc8e R600: Add local memory support via LDS
Reviewed-by: Vincent Lejeune<vljn at ovi.com>
llvm-svn: 185162
2013-06-28 15:47:08 +00:00
Tom Stellard ce540330df R600: Add support for GROUP_BARRIER instruction
Reviewed-by: Vincent Lejeune<vljn at ovi.com>
llvm-svn: 185161
2013-06-28 15:46:59 +00:00
Tom Stellard 5eb903d9c5 R600: Add ALUInst bit to tablegen definitions v2
v2:
  - Remove functions left over from a previous rebase.

Reviewed-by: Vincent Lejeune<vljn at ovi.com>
llvm-svn: 185160
2013-06-28 15:46:53 +00:00
Tim Northover 7cbc21529d ARM: ensure fixed-point conversions have sane types
We were generating intrinsics for NEON fixed-point conversions that didn't
exist (e.g. float -> i16). There are two cases to consider:
  + iN is smaller than float. In this case we can do the conversion but need an
    extend or truncate as well.
  + iN is larger than float. In this case using the NEON conversion would be
    incorrect so we don't perform any combining.

llvm-svn: 185158
2013-06-28 15:29:25 +00:00
Tilmann Scheller de09fae38d ARM: Fix pseudo-instructions for SRS (Store Return State).
The mapping between SRS pseudo-instructions and SRS native instructions was incorrect, the correct mapping is:

srsfa -> srsib
srsea -> srsia
srsfd -> srsdb
srsed -> srsda

This fixes <rdar://problem/14214734>.

llvm-svn: 185155
2013-06-28 15:09:46 +00:00
Alexey Samsonov fe3a5d9cf5 llvm-symbolizer: don't leave dangling pointers after flushing LLVMSymbolizer. Add a destructor.
llvm-svn: 185154
2013-06-28 15:08:29 +00:00
Alexey Samsonov 7323383bd7 llvm-symbolizer: skip leading underscore in Mach-O symbol table entries
llvm-svn: 185151
2013-06-28 14:25:52 +00:00
Alexey Samsonov 601beb7afd llvm-symbolizer: make name demangling a public static method of LLVMSymbolizer
llvm-svn: 185143
2013-06-28 12:06:25 +00:00
Rafael Espindola 31a2443317 Improve comment.
llvm-svn: 185141
2013-06-28 10:55:41 +00:00
Alexey Samsonov 64188f9f2b Make a switch in createBinary fully-covered. Add forgotten macho_dsym_companion case.
llvm-svn: 185139
2013-06-28 09:44:05 +00:00
Alexey Samsonov 2ca6536d7a llvm-symbolizer: add support for Mach-O universal binaries
llvm-svn: 185137
2013-06-28 08:15:40 +00:00
Patrik Hagglund dcc336bf8e Suppress GCC "control reaches end of non-void function" warning.
llvm-svn: 185136
2013-06-28 06:54:05 +00:00
Manman Ren 983a16c08a Debug Info: clean up usage of Verify.
No functionality change.
It should suffice to check the type of a debug info metadata, instead of
calling Verify. For cases where we know the type of a DI metadata, use
assert.

Also update testing cases to make them conform to the format of DI classes.

llvm-svn: 185135
2013-06-28 05:43:10 +00:00
David Blaikie c3ccdbe2bf Integrate Assembler: Support X86_64_DTPOFF64 relocations
llvm-svn: 185131
2013-06-28 04:24:32 +00:00
Rafael Espindola e79a87226a Improvements to unique_file and createUniqueDirectory.
* Don't try to create parent directories in unique_file. It had two problem:
   * It violates the contract that it is atomic. If the directory creation
     success and the file creation fails, we would return an error but the
     file system was modified.
   * When creating a temporary file clang would have to first check if the
     parent directory existed or not to avoid creating one when it was not
     supposed to.

* More efficient implementations of createUniqueDirectory and the unique_file
  that produces only the file name. Now all 3 just call into a static
  function passing what they want (name, file or directory).

Clang also has to be updated, so tests might fail if a bot picks up this commit
and not the corresponding clang one.

llvm-svn: 185126
2013-06-28 03:48:47 +00:00
Matt Arsenault fbfdced30f Convert tests to FileCheck
llvm-svn: 185124
2013-06-28 01:29:35 +00:00
Rafael Espindola 1842482359 Don't ask for a mode when we are not keeping the file.
llvm-svn: 185123
2013-06-28 01:05:47 +00:00
Arnold Schwaighofer 12ecb331af LoopVectorize: Preserve debug location info
radar://14169017

llvm-svn: 185122
2013-06-28 00:38:54 +00:00
Matt Arsenault 5d2e85f6d7 Fix using arg_end() - arg_begin() instead of arg_size()
llvm-svn: 185121
2013-06-28 00:25:40 +00:00
Matt Arsenault fd9ed8ab4e Fix typo
llvm-svn: 185120
2013-06-28 00:25:36 +00:00
Peter Collingbourne a4a47cb97b Rename DIBuilder::createNullPtrType to createUnspecifiedType and introduce
a zero-argument createNullPtrType function for creating the canonical
nullptr type.

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

llvm-svn: 185114
2013-06-27 22:50:59 +00:00
Michael Gottesman 296adb8b12 At the request of Richard Smith, swapped the order of cold/builtin so it is in alphabetical order.
llvm-svn: 185113
2013-06-27 22:48:08 +00:00
Michael Gottesman 79b0967548 Revert "Revert "[APFloat] Removed APFloat constructor which initialized to either zero/NaN but allowed you to arbitrarily set the category of the float.""
This reverts commit r185099.

Looks like both the ppc-64 and mips bots are still failing after I reverted this
change.

Since:

1. The mips bot always performs a clean build,
2. The ppc64-bot failed again after a clean build (I asked the ppc-64
maintainers to clean the bot which they did... Thanks Will!),

I think it is safe to assume that this change was not the cause of the failures
that said builders were seeing. Thus I am recomitting.

llvm-svn: 185111
2013-06-27 21:58:19 +00:00
Michael Gottesman ccaf3321f1 Revert "[APFloat] Removed APFloat constructor which initialized to either zero/NaN but allowed you to arbitrarily set the category of the float."
This reverts commit r185095. This is causing a FileCheck failure on
the 3dnow intrinsics on at least the mips/ppc bots but not on the x86
bots.

Reverting while I figure out what is going on.

llvm-svn: 185099
2013-06-27 20:40:11 +00:00
Arnold Schwaighofer 38de7cd464 LoopVectorize: Cache edge masks created during if-conversion
Otherwise, we end up with an exponential IR blowup.
Fixes PR16472.

llvm-svn: 185097
2013-06-27 20:31:06 +00:00
Chad Rosier ecff07c897 Remove unnecessary conditional checks.
llvm-svn: 185096
2013-06-27 20:19:13 +00:00
Michael Gottesman 03255a1675 [APFloat] Removed APFloat constructor which initialized to either zero/NaN but allowed you to arbitrarily set the category of the float.
The category which an APFloat belongs to should be dependent on the
actual value that the APFloat has, not be arbitrarily passed in by the
user. This will prevent inconsistency bugs where the category and the
actual value in APFloat differ.

I also fixed up all of the references to this constructor (which were
only in LLVM).

llvm-svn: 185095
2013-06-27 19:50:52 +00:00
Chad Rosier ccd0664393 Improve the compression of the tablegen DiffLists by introducing a new sort
algorithm when assigning EnumValues to the synthesized registers.

The current algorithm, LessRecord, uses the StringRef compare_numeric
function.  This function compares strings, while handling embedded numbers.
For example, the R600 backend registers are sorted as follows:

  T1
  T1_W
  T1_X
  T1_XYZW
  T1_Y
  T1_Z
  T2
  T2_W
  T2_X
  T2_XYZW
  T2_Y
  T2_Z

In this example, the 'scaling factor' is dEnum/dN = 6 because T0, T1, T2
have an EnumValue offset of 6 from one another.  However, in other parts
of the register bank, the scaling factors are different:

dEnum/dN = 5:
  KC0_128_W
  KC0_128_X
  KC0_128_XYZW
  KC0_128_Y
  KC0_128_Z
  KC0_129_W
  KC0_129_X
  KC0_129_XYZW
  KC0_129_Y
  KC0_129_Z

The diff lists do not work correctly because different kinds of registers have
different 'scaling factors'.  This new algorithm, LessRecordRegister, tries to
enforce a scaling factor of 1.  For example, the registers are now sorted as
follows:

  T1
  T2
  T3
  ...
  T0_W
  T1_W
  T2_W
  ...
  T0_X
  T1_X
  T2_X
  ...
  KC0_128_W
  KC0_129_W
  KC0_130_W
  ...

For the Mips and R600 I see a 19% and 6% reduction in size, respectively.  I
did see a few small regressions, but the differences were on the order of a
few bytes (e.g., AArch64 was 16 bytes).  I suspect there will be even
greater wins for targets with larger register files.

Patch reviewed by Jakob.
rdar://14006013

llvm-svn: 185094
2013-06-27 19:38:13 +00:00
Argyrios Kyrtzidis f183082dc6 [Support/Registry.h] Include llvm/Support/Compiler.h.
Because Registry.h is using the LLVM_DELETED_FUNCTION macro.

llvm-svn: 185087
2013-06-27 17:57:40 +00:00
Nadav Rotem 02dd93ec1a Get rid of the unused class member.
llvm-svn: 185086
2013-06-27 17:54:10 +00:00
Nadav Rotem f9ecbcb835 CostModel: improve the cost model for load/store of non power-of-two types such as <3 x float>, which are popular in graphics.
llvm-svn: 185085
2013-06-27 17:52:04 +00:00
Tom Stellard 1baa03aba6 R600: Remove alu-split.ll test
The purpose of this test was to check boundary conditions for the size
of an ALU clause.  This test is very sensitive to changes to the
optimizer or scheduler, because it requires an exact number of ALU
instructions in order to remain valid.  It's not good to have a test
this sensitive, because it is confusing to developers who implement
optimizations and then 'break' the test.

I'm not sure if there is a good way to test these limits using lit, but
if I can come up with replacement test that isn't as sensitive I'll add
it back to the tree.

llvm-svn: 185084
2013-06-27 17:00:38 +00:00
Arnold Schwaighofer a2dd195fb3 LoopVectorize: Use vectorized loop invariant gep index anchored in loop
Use vectorized instruction instead of original instruction anchored in the
original loop.

Fixes PR16452 and t2075.c of PR16455.

llvm-svn: 185081
2013-06-27 15:11:55 +00:00
Serge Pavlov 24a3ebb78d Use MCFillFragment for zero-initialized data.
It fixes PR16338 (ICE when compiling very large two-dimensional array).

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

llvm-svn: 185080
2013-06-27 14:35:03 +00:00
Joey Gouly b1b0dd8758 Add a Subtarget feature 'v8fp' to the ARM backend.
llvm-svn: 185073
2013-06-27 11:49:26 +00:00
Benjamin Kramer 8da6468a34 Remove unused variable.
llvm-svn: 185072
2013-06-27 11:26:41 +00:00
Benjamin Kramer 02ff1cd015 Don't cast away constness.
llvm-svn: 185071
2013-06-27 11:07:42 +00:00
Richard Sandiford ec8693d5f3 [SystemZ] Fix some embarrassing test typos
llvm-svn: 185070
2013-06-27 09:49:34 +00:00
Richard Sandiford 891a7e7454 [SystemZ] Allow LA and LARL to be rematerialized
llvm-svn: 185069
2013-06-27 09:42:10 +00:00
Richard Sandiford a57e13b670 [SystemZ] Allow immediate moves to be rematerialized
llvm-svn: 185068
2013-06-27 09:38:48 +00:00
Richard Sandiford b86a83488e [SystemZ] Add conditional store patterns
Add pseudo conditional store instructions, so that we use:

    branch foo:
    store
foo:

instead of:

    load
    branch foo:
    move
foo:
    store

z196 has real 32-bit and 64-bit conditional stores, but we don't use
any z196 instructions yet.

llvm-svn: 185065
2013-06-27 09:27:40 +00:00
Kostya Serebryany 157abe9b1d Add more owners to CODE_OWNERS.TXT (Kostya Serebryany: AddressSanitizer and ThreadSanitizer; Evgeniy Stepanov: MemorySanitizer)
llvm-svn: 185064
2013-06-27 08:47:12 +00:00
Manman Ren 31dee5bec9 Update testing case to make DI nodes have the correct format.
llvm-svn: 185061
2013-06-27 06:40:18 +00:00
Bob Wilson 7abe25834a Add CXXFLAGS back to the Link command.
This is essentially reverting one piece of 184793 to try to fix one of Apple's
buildbots.  I will check with Eric to see if this is OK or if we need to find
some other solution.

llvm-svn: 185060
2013-06-27 06:09:14 +00:00
Rafael Espindola 7ffacc4992 Add a convenience createUniqueDirectory function.
There are a few valid situation where we care about the structure inside a
directory, but not about the directory itself. A simple example is for unit
testing directory traversal.

PathV1 had a function like this, add one to V2 and port existing users of the
created temp file and delete it hack to using it.

llvm-svn: 185059
2013-06-27 03:45:31 +00:00
Arnold Schwaighofer 8db6347b9d Fix spelling.
llvm-svn: 185052
2013-06-27 01:01:11 +00:00
Arnold Schwaighofer ccd6c9929b LoopVectorize: Don't store a reversed value in the vectorized value map
When we store values for reversed induction stores we must not store the
reversed value in the vectorized value map. Another instruction might use this
value.

This fixes 3 test cases of PR16455.

llvm-svn: 185051
2013-06-27 00:45:41 +00:00
Michael Gottesman 3eacb58dc0 [APFloat] Added unittest for APFloat.divide that checks special cases, result categories, and result statuses.
llvm-svn: 185050
2013-06-27 00:42:00 +00:00
Michael Gottesman 41748d7c86 Added support for the Builtin attribute.
The Builtin attribute is an attribute that can be placed on function call site that signal that even though a function is declared as being a builtin,

rdar://problem/13727199

llvm-svn: 185049
2013-06-27 00:25:01 +00:00
Nadav Rotem 8edefb3665 No need to use a Set when a vector would do.
llvm-svn: 185047
2013-06-27 00:14:13 +00:00
Michael Gottesman ba2c0b9de1 Removed two logging printf statements from the APFloat tests... = /.
llvm-svn: 185045
2013-06-27 00:00:45 +00:00
Michael Gottesman 9debdfd8c9 [APFloat] Added unittest for APFloat.multiply that checks special cases, result categories, and result status.
llvm-svn: 185044
2013-06-26 23:55:26 +00:00
Michael Gottesman 9368a535c6 [APFloat] Added unittest for APFloat.subtract that checks special cases, result categories, and result status.
llvm-svn: 185043
2013-06-26 23:55:23 +00:00
Nadav Rotem 93f880fb77 SLP: When searching for vectorization opportunities scan the blocks in post-order because we grow chains upwards.
llvm-svn: 185041
2013-06-26 23:44:45 +00:00
Nadav Rotem 7f0d6d7975 SLP: Dont erase instructions during vectorization because it prevents the outerloops from iterating over the instructions.
llvm-svn: 185040
2013-06-26 23:43:23 +00:00
Michael Gottesman c2af8d6273 In InstCombine{AddSub,MulDivRem} convert APFloat.isFiniteNonZero() && !APFloat.isDenormal => APFloat.isNormal.
llvm-svn: 185037
2013-06-26 23:17:31 +00:00
Michael Gottesman 8136c384c5 [APFloat] Convert all references to fcNormal to references to isFiniteNonZero().
Currently inside APFloat fcNormal still implies the old definition of Normal
(i.e. isFiniteNonZero) instead of the proper IEEE-754R definition that the
external method isNormal() uses.

This patch prepares for the internal switch inside APFloat by converting all
references that check if a category is fcNormal directly with an indirect call
via isFiniteNonZero().

llvm-svn: 185036
2013-06-26 23:17:28 +00:00
Eric Christopher b8c608ea39 Revert "Debug Info: clean up usage of Verify." as it's breaking bots.
This reverts commit r185020

llvm-svn: 185032
2013-06-26 22:44:57 +00:00
Reid Kleckner 7b78d359fb Fix a crash bug in dumping options with groups
Option groups don't have prefixes.  Option dumping is basically dead
code unless there is something wrong with the option table, so this
isn't an important crasher.

llvm-svn: 185031
2013-06-26 22:43:37 +00:00
Stephen Lin fc5eb5e264 Clarify and doxygen-ify comments
llvm-svn: 185030
2013-06-26 22:27:50 +00:00
Chad Rosier 253777fdc3 [Mips Disassembler] Have the DecodeCCRRegisterClass function use the getReg
function to lookup the proper tablegen'ed register enumeration.  Previously,
it was using the encoded value directly.

llvm-svn: 185026
2013-06-26 22:23:32 +00:00
Stephen Lin ff7fceed7d ARM: Proactively ensure that the LowerCallResult hack for 'this'-returns is not used for incompatible calling conventions.
(Currently, ARM 'this'-returns are handled in the standard calling convention case by treating R0 as preserved and doing some extra magic in LowerCallResult; this may not apply to calling conventions added in the future so this patch provides and documents an interface for indicating such)

llvm-svn: 185024
2013-06-26 21:42:14 +00:00
Manman Ren aa00ce0e8f Debug Info: clean up usage of Verify.
No functionality change.
It should suffice to check the type of a debug info metadata, instead of
calling Verify.

llvm-svn: 185020
2013-06-26 21:26:10 +00:00
Stephen Lin 4ff0dbb615 Minor formatting fix to ARMBaseRegisterInfo::getCalleeSavedRegs
llvm-svn: 185016
2013-06-26 20:19:06 +00:00
Rafael Espindola f1fc3829a8 Rename PathV2 to just Path now that it is the only one.
llvm-svn: 185015
2013-06-26 19:33:03 +00:00
Akira Hatanaka c3114b3341 [mips] Do not emit ".option pic0" if target is mips64.
llvm-svn: 185012
2013-06-26 19:08:49 +00:00
Akira Hatanaka 5832fc607b [mips] Improve code generation for constant multiplication using shifts, adds and
subs.

llvm-svn: 185011
2013-06-26 18:48:17 +00:00
Michael Gottesman 734508d9e6 [APFloat] Removed debugging cruft that snuck in.
llvm-svn: 184974
2013-06-26 17:59:36 +00:00
Nadav Rotem 87856b50cf The SLP Vectorizer works across basic blocks. Update the docs.
llvm-svn: 184973
2013-06-26 17:59:35 +00:00
Rafael Espindola e7e4a449ce Use enums instead of raw octal values.
Patch by 罗勇刚(Yonggang Luo).

llvm-svn: 184971
2013-06-26 17:28:04 +00:00
Nadav Rotem 4c5b2d1de6 Erase all of the instructions that we RAUWed
llvm-svn: 184969
2013-06-26 17:16:09 +00:00
Joey Gouly b3f550e8cd Add a subtarget feature 'v8' to the ARM backend.
This allows for targeting the ARMv8 AArch32 variant.

llvm-svn: 184967
2013-06-26 16:58:26 +00:00
Nadav Rotem f4ca3994b8 Do not add cse-ed instructions into the visited map because we dont want to consider them as a candidate for replacement of instructions to be visited.
llvm-svn: 184966
2013-06-26 16:54:53 +00:00
Tim Northover 2c45a383a8 ARM: fix more cases where predication may or may not be allowed
Unfortunately this addresses two issues (by the time I'd disentangled the logic
it wasn't worth putting it back to half-broken):

+ Coprocessor instructions should all be predicable in Thumb mode.
+ BKPT should never be predicable.

llvm-svn: 184965
2013-06-26 16:52:40 +00:00
Tim Northover 52f77f5cda ARM: allow predicated barriers in Thumb mode
The barrier instructions are only "always-execute" in ARM mode, they can quite
happily sit inside an IT block in Thumb.

llvm-svn: 184964
2013-06-26 16:52:32 +00:00
Joey Gouly 05b04cf3a5 Remove the 'generic' CPU from the ARM eabi attributes printer.
Make v4 the default ARM architecture attribute, to match CodeGen.

llvm-svn: 184962
2013-06-26 16:39:06 +00:00
Rafael Espindola b0f2eba499 PathV1 is deprecated since the 18th of Dec 2010. Remove it.
llvm-svn: 184960
2013-06-26 16:24:35 +00:00
Rafael Espindola f530fd75b9 Add a convenience functions that don't return if the directory existed.
llvm-svn: 184955
2013-06-26 15:21:13 +00:00
Rafael Espindola 479a9bd0ba Remove unused includes.
llvm itself is now PathV1 clean.

llvm-svn: 184947
2013-06-26 13:54:34 +00:00
Ulrich Weigand 5a02a02b41 [PowerPC] Accept 17-bit signed immediates for addis
The assembler currently strictly verifies that immediates for
s16imm operands are in range (-32768 ... 32767).  This matches
the behaviour of the GNU assembler, with one exception: gas
allows, as a special case, operands in an extended range
(-65536 .. 65535) for the addis instruction only (and its
extended mnemonic lis).

The main reason for this seems to be to allow using unsigned
16-bit operands for lis, e.g. like lis %r1, 0xfedc.

Since this has been supported by gas for a long time, and
assembler source code seen "in the wild" actually exploits
this feature, this patch adds equivalent support to LLVM
for compatibility reasons.

llvm-svn: 184946
2013-06-26 13:49:53 +00:00
Ulrich Weigand fd3ad693e8 [PowerPC] Support symbolic u16imm operands
Currently, all instructions taking s16imm operands support symbolic
operands.  However, for u16imm operands, we only support actual
immediate integers.  This causes the assembler to reject code like

  ori %r5, %r5, symbol@l

This patch changes the u16imm operand definition to likewise
accept symbolic operands.  In fact, s16imm and u16imm can
share the same encoding routine, now renamed to getImm16Encoding.

llvm-svn: 184944
2013-06-26 13:49:15 +00:00
Amaury de la Vieuville a6f5542be4 ARM: operands should be explicit when disassembled
llvm-svn: 184943
2013-06-26 13:39:07 +00:00
Venkatraman Govindaraju 6f0b450530 [Sparc]: Add memory operands for the frame references in the storeRegToStackSlot
and loadRegFromStackSlot.

llvm-svn: 184935
2013-06-26 12:40:16 +00:00
Elena Demikhovsky fed077be03 Fixed a comment.
llvm-svn: 184933
2013-06-26 12:15:53 +00:00
NAKAMURA Takumi 1c9de1f078 Suppress llvm/test/Other/can-execute.txt on msys bash.
llvm-svn: 184932
2013-06-26 10:56:44 +00:00
Elena Demikhovsky 6769c50d9e Optimized integer vector multiplication operation by replacing it with shift/xor/sub when it is possible. Fixed a bug in SDIV, where the const operand is not a splat constant vector.
llvm-svn: 184931
2013-06-26 10:55:03 +00:00
Kostya Serebryany 5e276f9dbc [asan] workaround for PR16277: don't instrument AllocaInstr with alignment more than the redzone size
llvm-svn: 184928
2013-06-26 09:49:52 +00:00
Kostya Serebryany 9f5213f20f [asan] add option -asan-keep-uninstrumented-functions
llvm-svn: 184927
2013-06-26 09:18:17 +00:00
Andy Gibbs 3ef5ed1ec0 Provide bootstrap support to build only llvm+clang when using cmake.
Where a source tree is complete with lld, lldb and polly, it may not be possible to use cmake to configure build scripts if the host compiler it not capable of compiling these sub-projects.  This change makes it possible to first build a bootstrap clang compiler when can then be used to build a complete llvm toolchain.  An example bootstrap build sequence could be as follows:

$ mkdir bootstrap
$ cd bootstrap
$ cmake -G 'Unix Makefiles'
        -DCMAKE_BUILD_TYPE:STRING=Release
        -DCMAKE_PREFIX_PATH:STRING=$(pwd)
        -DLLVM_TARGETS_TO_BUILD:STRING=host
        -DLLVM_INCLUDE_TOOLS:STRING=bootstrap-only
        ../source
$ make clang  # build clang only for host

$ cd ..
$ export CC=$(realpath bootstrap/bin)/clang
$ export CXX=$(realpath bootstrap/bin)/clang++

$ mkdir final
$ cd final
$ cmake -G 'Unix Makefiles' ../source
$ make all check-all

llvm-svn: 184924
2013-06-26 08:05:08 +00:00
Andy Gibbs f5dede1beb Support using "host" as a target in LLVM_TARGETS_TO_BUILD when using cmake.
llvm-svn: 184923
2013-06-26 07:57:53 +00:00
Rafael Espindola 2c6f4fea82 Remove calls to Path in #ifdefs that don't seem to be used in any of the bots :-(
llvm-svn: 184920
2013-06-26 06:10:32 +00:00
Rafael Espindola d4aca65172 Add a simpler version of remove_all.
llvm-svn: 184919
2013-06-26 06:06:54 +00:00
Rafael Espindola 4601c462a7 Fix the build when __APPLE__ is defined.
llvm-svn: 184917
2013-06-26 05:25:44 +00:00
Rafael Espindola 4b304b0abf Remove sys::GetMainExecutable.
llvm-svn: 184916
2013-06-26 05:05:37 +00:00
Rafael Espindola e03dfd9b0a Port GetMainExecutable over to PathV2.
I will remove the V1 version as soon as I change clang in the next commit.

llvm-svn: 184914
2013-06-26 05:01:35 +00:00
Rafael Espindola 00efef2835 Remove PathWithStatus.
llvm-svn: 184910
2013-06-26 04:15:55 +00:00
Nick Lewycky 5cd9538b90 dbgs() << Instruction doesn't print a newline on the end any more. Update these
debug statements to add a missing newline. Also canonicalize to '\n' instead of
"\n"; the latter calls a function with a loop the former does not.

llvm-svn: 184897
2013-06-26 00:30:18 +00:00
Adrian Prantl cc077ad634 s/C++0x/C++11/
llvm-svn: 184892
2013-06-25 23:42:37 +00:00
Jakob Stoklund Olesen e22476a923 Merge isReachable into isBackedge.
Prefer using RPO.lookup() instead of RPO[] which can mutate the map.

llvm-svn: 184891
2013-06-25 23:32:10 +00:00
Nadav Rotem 0794acc1da SLPVectorizer: support slp-vectorization of PHINodes between basic blocks
llvm-svn: 184888
2013-06-25 23:04:09 +00:00
Jakob Stoklund Olesen 6e630d46d2 Print block frequencies in decimal form.
This is easier to read than the internal fixed-point representation.

If anybody knows the correct algorithm for converting fixed-point
numbers to base 10, feel free to fix it.

llvm-svn: 184881
2013-06-25 21:57:38 +00:00
Tom Stellard 02661d9605 R600: Use new getNamedOperandIdx function generated by TableGen
llvm-svn: 184880
2013-06-25 21:22:18 +00:00
Tom Stellard b162d94871 TableGen: Generate a function for getting operand indices based on their defined names
This patch modifies TableGen to generate a function in
${TARGET}GenInstrInfo.inc called getNamedOperandIdx(), which can be used
to look up indices for operands based on their names.

In order to activate this feature for an instruction, you must set the
UseNamedOperandTable bit.

For example, if you have an instruction like:

def ADD : TargetInstr <(outs GPR:$dst), (ins GPR:$src0, GPR:$src1)>;

You can look up the operand indices using the new function, like this:

Target::getNamedOperandIdx(Target::ADD, Target::OpName::dst)  => 0
Target::getNamedOperandIdx(Target::ADD, Target::OpName::src0) => 1
Target::getNamedOperandIdx(Target::ADD, Target::OpName::src1) => 2

The operand names are case sensitive, so $dst and $DST are considered
different operands.

This change is useful for R600 which has instructions with a large number
of operands, many of which model single bit instruction configuration
values.  These configuration bits are common across most instructions,
but may have a different operand index depending on the instruction type.
It is useful to have a convenient way to look up the operand indices,
so these bits can be generically set on any instruction.

llvm-svn: 184879
2013-06-25 21:22:09 +00:00
Arnold Schwaighofer a04b9ef1e8 X86 cost model: Vectorizing integer division is a bad idea
radar://14057959

llvm-svn: 184872
2013-06-25 19:14:09 +00:00
Bob Wilson acfc01dedf Fix SROA to avoid unnecessary scalar conversions for 1-element vectors.
When a 1-element vector alloca is promoted, a store instruction can often be
rewritten without converting the value to a scalar and using an insertelement
instruction to stuff it into the new alloca.  This patch just adds a check
to skip that conversion when it is unnecessary.  This turns out to be really
important for some ARM Neon operations where <1 x i64> is used to get around
the fact that i64 is not a legal type.

llvm-svn: 184870
2013-06-25 19:09:50 +00:00
Manman Ren aed30fa3de Remove unused code. No functionality change.
llvm-svn: 184866
2013-06-25 18:49:55 +00:00
Bill Wendling c43250338a The GCDA 402 format won't have a second checksum either.
llvm-svn: 184864
2013-06-25 18:13:52 +00:00
Ulrich Weigand 93372b4583 [PowerPC] Support @got modifier
Add VK_... values and relocation types necessary to support
the @got family of modifiers.  Used by the asm parser only.

llvm-svn: 184860
2013-06-25 16:49:50 +00:00
Rafael Espindola 242fcb846e Move GetEXESuffix to the one place it is used.
llvm-svn: 184853
2013-06-25 14:42:30 +00:00
Rafael Espindola db7c03f05e Remove sys::PathSeparator.
llvm-svn: 184852
2013-06-25 14:32:45 +00:00
Aaron Watry 0a794a4612 R600: Consolidate expansion of v2i32/v4i32 ops for EG/SI
By default, we expand these operations for both EG and SI. Move the
duplicated code into a common space for now. If the targets ever actually
implement these operations as instructions, we can override that in the relevant
target.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 184848
2013-06-25 13:55:57 +00:00
Aaron Watry 0517275a57 R600: Add v2i32 test for vselect
Note: Only adding test for evergreen, not SI yet.

When I attempted to expand vselect for SI, I got the following:
llc: /home/awatry/src/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:522:
llvm::SDValue llvm::DAGTypeLegalizer::PromoteIntRes_SETCC(llvm::SDNode*):
Assertion `SVT.isVector() == N->getOperand(0).getValueType().isVector() &&
"Vector compare must return a vector result!"' failed.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 184847
2013-06-25 13:55:54 +00:00
Aaron Watry daabb20e1b R600/SI: Expand xor v2i32/v4i32
Add test cases for both vector sizes on SI and also add v2i32 test for EG.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 184846
2013-06-25 13:55:52 +00:00
Aaron Watry 91d2886169 R600: Add v2i32 test for setcc on evergreen
No test/expansion for SI has been added yet. Attempts to expand this
operation for SI resulted in a stacktrace in (IIRC) LegalizeIntegerTypes
which was complaining about vector comparisons being required to return
a vector type.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 184845
2013-06-25 13:55:49 +00:00
Aaron Watry 83fa6006bc R600/SI: Expand urem of v2i32/v4i32 for SI
Also add lit test for both cases on SI, and v2i32 for evergreen.

Note: I followed the guidance of the v4i32 EG check... UREM produces really
complex code, so let's just check that the instruction was lowered
successfully.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 184844
2013-06-25 13:55:46 +00:00
Aaron Watry 5527b6c6b6 R600/SI: Expand udiv v[24]i32 for SI and v2i32 for EG
Also add lit test for both cases on SI, and v2i32 for evergreen.

Note: I followed the guidance of the v4i32 EG check... UDIV produces really
complex code, so let's just check that the instruction was lowered
successfully.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 184843
2013-06-25 13:55:43 +00:00
Aaron Watry 16d80c0529 R600/SI: Expand ashr of v2i32/v4i32 for SI
Also add lit test for both cases on SI, and v2i32 for evergreen.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 184842
2013-06-25 13:55:40 +00:00
Aaron Watry f63791e778 R600/SI: Expand srl of v2i32/v4i32 for SI
Also add lit test for both cases on SI, and v2i32 for evergreen.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 184841
2013-06-25 13:55:37 +00:00
Aaron Watry 5584553984 R600/SI: Expand shl of v2i32/v4i32 for SI
Also add lit test for both cases on SI, and v2i32 for evergreen.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 184840
2013-06-25 13:55:32 +00:00
Aaron Watry 2fa162e88e R600/SI: Expand or of v2i32/v4i32 for SI
Also add lit test for both cases on SI, and v2i32 for evergreen.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 184839
2013-06-25 13:55:29 +00:00
Aaron Watry 265eef5efe R600/SI: Expand mul of v2i32/v4i32 for SI
Also add lit test for both cases on SI, and v2i32 for evergreen.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 184838
2013-06-25 13:55:26 +00:00
Aaron Watry 00aeb119db R600/SI: Expand and of v2i32/v4i32 for SI
Also add lit test for both cases on SI, and v2i32 for evergreen.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 184837
2013-06-25 13:55:23 +00:00
Benjamin Kramer 866793109e BlockFrequency: Bump up the entry frequency a bit.
This is a band-aid to fix the most severe regressions we're seeing from basing
spill decisions on block frequencies, until we have a better solution.

llvm-svn: 184835
2013-06-25 13:34:40 +00:00
Ulrich Weigand ad873cdb2b [PowerPC] Add extended rotate/shift mnemonics
This adds all missing extended rotate/shift mnemonics to the asm parser.

llvm-svn: 184834
2013-06-25 13:17:41 +00:00
Ulrich Weigand 6c31c4aae8 [PowerPC] Add rldcr/rldic instructions
This adds pattern for the rldcr and rldic instructions (the last instruction
from the rotate/shift family that were missing).  They are currently used
only by the asm parser.

llvm-svn: 184833
2013-06-25 13:17:10 +00:00
Ulrich Weigand 4069e24bd3 [PowerPC] Add extended subtract mnemonics
This adds support for the extended subtract mnemonics to the asm parser:
   subi
   subis
   subic
   subic.
   sub
   sub.
   subc
   subc.
 

llvm-svn: 184832
2013-06-25 13:16:48 +00:00
Justin Holewinski aaaf28971d [NVPTX] Default pointer type doesn't make sense for getParamSymbol()
llvm-svn: 184831
2013-06-25 12:22:21 +00:00
Nadav Rotem 3de032a3b6 Fix a typo in the code that collected the costs recursively.
llvm-svn: 184827
2013-06-25 05:30:56 +00:00
Rafael Espindola 8c8117240c keep only the StringRef version of getFileOrSTDIN.
llvm-svn: 184826
2013-06-25 05:28:34 +00:00
Rafael Espindola 138e55aa5a Don't assume ResultPath is null terminated.
llvm-svn: 184824
2013-06-25 04:23:46 +00:00
Andrew Trick 121124acf8 Revert "Temporarily enable MI-Sched on X86."
This reverts commit 98a9b72e8c56dc13a2617de84503a3d78352789c.

llvm-svn: 184823
2013-06-25 02:48:58 +00:00
Tom Stellard 0125f2a6e4 R600/SI: Report unaligned memory accesses as legal for > 32-bit types
In reality, some unaligned memory accesses are legal for 32-bit types and
smaller too, but it all depends on the address space.  Allowing
unaligned loads/stores for > 32-bit types is mainly to prevent the
legalizer from splitting one load into multiple loads of smaller types.

https://bugs.freedesktop.org/show_bug.cgi?id=65873

llvm-svn: 184822
2013-06-25 02:39:35 +00:00
Tom Stellard 9810ec613c R600: Add support for i32 loads from the constant address space on Cayman
Tested-By: Aaron Watry <awatry@gmail.com>
llvm-svn: 184821
2013-06-25 02:39:30 +00:00
Tom Stellard b06f3fc1be R600/SI: Add support for v4i32 and v4f32 kernel args
Tested-By: Aaron Watry <awatry@gmail.com>
llvm-svn: 184820
2013-06-25 02:39:25 +00:00
Tom Stellard 9d2e1500b4 R600: Fix typo in R600Schedule.td
This should only make a difference in programs that use a lot of the
vector ALU instructions like BFI_INT and BIT_ALIGN.  There is a slight
improvement in the phatk bitcoin mining kernel with this patch on
Evergreen (vector size == 1):

Before:
1173 Instruction Groups / 9520 dwords

After:
1167 Instruction Groups / 9510 dwords

Reviewed-by: Reviewed-by: Vincent Lejeune<vljn at ovi.com>
llvm-svn: 184819
2013-06-25 02:39:20 +00:00
NAKAMURA Takumi 36c17ee5a1 PPCAsmParser.cpp: Quote "@l/@ha" in comments. [-Wdocumentation]
llvm-svn: 184809
2013-06-25 01:14:20 +00:00
Eric Christopher f1bd7702bf Add an autoconf option for turning on -gsplit-dwarf by default
when building llvm. This saves quite a bit of time and space when
linking. Please report any problems via bugzilla.

Caveats:

a) This will only work on linux
b) This requires a fairly new binutils
c) This requires a fairly new gdb

llvm-svn: 184808
2013-06-25 01:12:25 +00:00
Rafael Espindola 9c43963c62 Create a replacement for sys::Path::PathSeparator.
llvm-svn: 184806
2013-06-25 01:10:36 +00:00
Rafael Espindola 7c4d2da8e8 Cleanup in unique_file when we only want the name.
This is really ugly, but it is no worse than what we have in clang right now and
it is better to get it working first and clean/optimize it afterwards.

Will be tested from clang in the next patch.

llvm-svn: 184802
2013-06-25 00:49:40 +00:00
Eric Christopher 1f1578b7d3 As far as I know no linker needs or wants the -g flag.
llvm-svn: 184800
2013-06-25 00:40:03 +00:00
Eric Christopher 97e784a588 Remove all non-linker oriented compile options from the linker
command line. Change the darwin universal binary options to
be TargetCommonOpts so that they'll be passed to the linker since
-arch at least is still needed.

Someone on darwin with a buildit based build should probably verify
that this doesn't break anything there.

llvm-svn: 184793
2013-06-24 23:20:04 +00:00
Eric Christopher 5fdd68e596 80-column and tab character fixes.
llvm-svn: 184792
2013-06-24 23:20:02 +00:00
Eric Christopher 40b6bf6f46 Formatting.
llvm-svn: 184788
2013-06-24 21:34:55 +00:00
Adrian Prantl 21e8d4a6a1 typo.
llvm-svn: 184783
2013-06-24 21:19:43 +00:00
Eric Christopher bf2d23c0d7 Use const references instead of pointers to references that are
never modified. No functional change.

llvm-svn: 184781
2013-06-24 21:07:27 +00:00
Ulrich Weigand 6ca71579db [PowerPC] Support some miscellaneous mnemonics in the asm parser
This adds support for the following extended mnemonics:
  xnop
  mr.
  not
  not.
  la

llvm-svn: 184767
2013-06-24 18:08:03 +00:00
Rafael Espindola eb23add2ad Add a simpler version of is_regular_file.
llvm-svn: 184764
2013-06-24 17:54:24 +00:00
David Blaikie b761900a12 DebugInfo: DIBuilder changes to match DIEnumerator changes in r184694
Representing enumerators by int64 instead of uint64 for now. At some
point we need to address the underlying issue of representation
depending on the specific enumeration.

llvm-svn: 184761
2013-06-24 17:34:33 +00:00
Chad Rosier ae9ce8b688 Improve diagnostics when getSizeInBits is called on the Other type.
llvm-svn: 184760
2013-06-24 17:29:51 +00:00
Benjamin Kramer 3912d785e3 PPC: Remove default case from fully covered switch.
llvm-svn: 184758
2013-06-24 17:03:25 +00:00
Ulrich Weigand ba19f79655 [PowerPC] Add some FIXMEs
A bunch of extendend mnemomics ought to support '.' forms.
Add FIXMEs to the test case for those.

llvm-svn: 184757
2013-06-24 17:00:22 +00:00
Aaron Watry 52a72c926c R600: Fix spelling error in comment
our -> or

llvm-svn: 184756
2013-06-24 16:57:57 +00:00
Ulrich Weigand 86247b6e27 [PowerPC] Add predicted forms of branches
This adds support for the predicted forms of branches (+/-).
There are three cases to consider:
- Branches using a PPC::Predicate code
  For these, I've added new PPC::Predicate codes corresponding
  to the BO values for predicted branch forms, and updated insn
  printing to print them correctly.  I've also added new aliases
  for the asm parser matching the new forms.
- bt/bf
  I've added new aliases matching to gBC etc.
- bd(n)z variants
  I've added new instruction patterns for the predicted forms.

In all cases, the new patterns are used for the asm parser only.
(The new infrastructure ought to be sufficient to allow use by
the compiler too at some point.)

llvm-svn: 184754
2013-06-24 16:52:04 +00:00
NAKAMURA Takumi b64e776268 Move llvm/test/DebugInfo/arguments.ll to X86, for now. It is still Windows' PECOFF incompatible.
llvm-svn: 184750
2013-06-24 16:05:21 +00:00
Nadav Rotem 9c7c997a7e Rename the variable to fix a warning. Thanks Andy Gibbs.
llvm-svn: 184749
2013-06-24 15:59:47 +00:00
Reid Kleckner 63784ba5b9 Look for Python 2 before Python 3 in CMakeLists.txt
All of LLVM's Python scripts only support Python 2 for widely understood
reasons.

Patch by Yonggang Luo.

llvm-svn: 184732
2013-06-24 13:21:16 +00:00
NAKAMURA Takumi c316274d76 llvm/test/CodeGen/X86: Add explicit -mtriple=x86_64-unknown-unknown.
llvm-svn: 184731
2013-06-24 13:19:59 +00:00
NAKAMURA Takumi da9833f22c llvm/test/CodeGen/X86/legalize-shift-64.ll: Add explicit -mtriple=i686-unknown-unknown.
llvm-svn: 184730
2013-06-24 13:19:52 +00:00
NAKAMURA Takumi 1ea45844f5 llvm/test/DebugInfo/arguments.ll: Add explicit -mtriple=x86_64-unknown-unknown.
llvm-svn: 184729
2013-06-24 13:19:47 +00:00
NAKAMURA Takumi f7f5894d8d NVPTXTargetObjectFile.h: Initialize some pointers as NULL in the constructor of NVPTXTargetObjectFile. ~NVPTXTargetObjectFile() tries to delete them.
It caused crash on some hosts since r184595.

llvm-svn: 184728
2013-06-24 13:19:41 +00:00
Ulrich Weigand fedd5a756e [PowerPC] Add t/f branch mnemonics to asm parser
This adds the bt/bf/bd(n)zt/bd(n)zf mnemonics as aliases for the
asm parser, resolving to the generic conditional patterns.

llvm-svn: 184725
2013-06-24 12:49:20 +00:00
Arnold Schwaighofer b252c11ccc Reapply 184685 after the SetVector iteration order fix.
This should hopefully have fixed the stage2/stage3 miscompare on the dragonegg
testers.

"LoopVectorize: Use the dependence test utility class

We now no longer need alias analysis - the cases that alias analysis would
handle are now handled as accesses with a large dependence distance.

We can now vectorize loops with simple constant dependence distances.

  for (i = 8; i < 256; ++i) {
    a[i] = a[i+4] * a[i+8];
  }

  for (i = 8; i < 256; ++i) {
    a[i] = a[i-4] * a[i-8];
  }

We would be able to vectorize about 200 more loops (in many cases the cost model
instructs us no to) in the test suite now. Results on x86-64 are a wash.

I have seen one degradation in ammp. Interestingly, the function in which we
now vectorize a loop is never executed so we probably see some instruction
cache effects. There is a 2% improvement in h264ref. There is one or the other
TSCV loop kernel that speeds up.

radar://13681598"

llvm-svn: 184724
2013-06-24 12:09:15 +00:00
Arnold Schwaighofer 91472fa4fc LoopVectorize: Use SetVector for the access set
We are creating the runtime checks using this set so we need a deterministic
iteration order.

llvm-svn: 184723
2013-06-24 12:09:12 +00:00
Ulrich Weigand 824b7d8dfd [PowerPC] Support generic conditional branches in asm parser
This adds instruction patterns to cover the generic forms of
the conditional branch instructions.  This allows the assembler
to support the generic mnemonics.

The compiler will still generate the various specific forms
of the instruction that were already supported.

llvm-svn: 184722
2013-06-24 11:55:21 +00:00
Ulrich Weigand b6a30d159e [PowerPC] Support absolute branches
There is currently only limited support for the "absolute" variants
of branch instructions.  This patch adds support for the absolute
variants of all branches that are currently otherwise supported.

This requires adding new fixup types so that the correct variant
of relocation type can be selected by the object writer.

While the compiler will continue to usually choose the relative
branch variants, this will allow the asm parser to fully support
the absolute branches, with either immediate (numerical) or
symbolic target addresses.

No change in code generation intended.

llvm-svn: 184721
2013-06-24 11:03:33 +00:00
Ulrich Weigand 5b9d591ad1 [PowerPC] Support bd(n)zl and bd(n)zlrl
This adds support for the bd(n)zl and bd(n)zlrl instructions.
The patterns are currently used for the asm parser only.

llvm-svn: 184720
2013-06-24 11:02:38 +00:00
Ulrich Weigand d20e91edad [PowerPC] Support b(cond)l in the asm parser
This patch adds support for the conditional variants of bl.
The pattern is currently used by the asm parser only.

llvm-svn: 184719
2013-06-24 11:02:19 +00:00
Ulrich Weigand 1847bb811e [PowerPC] Support blrl and variants in the asm parser
This patch adds support for blrl and its conditional variants.
The patterns are (currently) used for the asm parser only.

llvm-svn: 184718
2013-06-24 11:01:55 +00:00
Vladimir Medic 233dd51b13 This patch introduces RegisterOperand class into Mips FPU instruction definitions and adds dedicated parser methods to MipsAsmParser. It is the first in a series of patches that should fix the problems with parsing Mips FPU instructions and optimize the code in MipsAsmParser.
llvm-svn: 184716
2013-06-24 10:05:34 +00:00
Michael Gottesman f989929cf0 [APFloat] Removed trailing whitespace from unittests.
llvm-svn: 184715
2013-06-24 09:58:09 +00:00
Michael Gottesman e45b108339 [APFloat] Added a large unittest for APFloat.add that checks that special values are computed correctly.
llvm-svn: 184714
2013-06-24 09:58:07 +00:00
Michael Gottesman 40e8a187f6 [APFloat] Added support for parsing float strings which contain {inf,-inf,NaN,-NaN}.
llvm-svn: 184713
2013-06-24 09:58:05 +00:00
Michael Gottesman c4facdf390 [APFloat] Added make{Zero,Inf} methods and implemented get{Zero,Inf} on top of them.
llvm-svn: 184712
2013-06-24 09:58:02 +00:00
Michael Gottesman f0e8cd1a7f [APFloat] Removed a assert from significandParts() which says that one can only access the significand of FiniteNonZero/NaN floats.
The method significandParts() is a helper method meant to ease access to
APFloat's significand by allowing the user to not need to be aware of whether or
not the APFloat is using memory allocated in the instance itself or in an
external array.

This assert says that one can only access the significand of FiniteNonZero/NaN
floats. This makes it cumbersome and more importantly dangerous when one wishes
to zero out the significand of a zero/infinity value since one will have to deal
with the aforementioned quandary related to how the memory in APFloat is
allocated.

llvm-svn: 184711
2013-06-24 09:57:59 +00:00
Michael Gottesman 9b877e18a3 [APFloat] Rename macro convolve => PackCategoriesIntoKey so that it is clear what APFloat is actually using said macro for.
In the context of APFloat, seeing a macro called convolve suggests that APFloat
is using said value in some sort of convolution somewhere in the source code.
This is misleading.

I also added a documentation comment to the macro.

llvm-svn: 184710
2013-06-24 09:57:57 +00:00
Andrew Trick c08bd450a3 Add -mcpu to some unit tests that only fail on certain hosts.
llvm-svn: 184709
2013-06-24 09:51:30 +00:00
Amaury de la Vieuville 8449c0d5ed ARM: check predicate bits for thumb instructions
When encoded to thumb, VFP instruction and VMOV/VDUP between scalar and
core registers, must have their predicate bit to 0b1110.

llvm-svn: 184707
2013-06-24 09:15:01 +00:00
Amaury de la Vieuville 8175bda3db ARM: rGPR is meant to be unpredictable, not undefined
llvm-svn: 184706
2013-06-24 09:14:54 +00:00
Andrew Trick 5a1e0af838 Temporarily enable MI-Sched on X86.
Sorry for the unit test churn. I'll try to make the change permanently
next time.

llvm-svn: 184705
2013-06-24 09:13:20 +00:00
Amaury de la Vieuville f2f00b4e28 ARM: fix thumb1 nop decoding
In thumb1, NOP is a pseudo-instruction equivalent to mov r8, r8.
However the disassembler should not use this alias.

llvm-svn: 184703
2013-06-24 09:11:53 +00:00
Amaury de la Vieuville 2f0ac8d961 ARM: fix IT decoding
mask == 0 -> UNPRED

llvm-svn: 184702
2013-06-24 09:11:45 +00:00
Amaury de la Vieuville 4b6c076da3 ARM: enable decoding of pc-relative PLD/PLI
llvm-svn: 184701
2013-06-24 09:11:38 +00:00
Chandler Carruth 08e1b8742b Add a flag to defer vectorization into a phase after the inliner and its
CGSCC pass manager. This should insulate the inlining decisions from the
vectorization decisions, however it may have both compile time and code
size problems so it is just an experimental option right now.

Adding this based on a discussion with Arnold and it seems at least
worth having this flag for us to both run some experiments to see if
this strategy is workable. It may solve some of the regressions seen
with the loop vectorizer.

llvm-svn: 184698
2013-06-24 07:21:47 +00:00
Chandler Carruth 99c46b980f Filter out dragonegg when checked out into a projects subdirectory.
There is some hope of eventually supporting a unified build with it, but
until then this lets me (and others) check it out in this location
without things breaking.

llvm-svn: 184697
2013-06-24 07:21:35 +00:00
David Blaikie 6225137470 DebugInfo: enumerator values returned as int64 as they are stored
llvm-svn: 184694
2013-06-24 07:11:08 +00:00
David Blaikie 3656123dfc DebugInfo: add some testing from an overly broad end-to-end test in Clang
llvm-svn: 184692
2013-06-24 06:47:22 +00:00
Arnold Schwaighofer 58ca945f38 Revert "LoopVectorize: Use the dependence test utility class"
This reverts commit cbfa1ca993363ca5c4dbf6c913abc957c584cbac.

We are seeing a stage2 and stage3 miscompare on some dragonegg bots.

llvm-svn: 184690
2013-06-24 06:10:41 +00:00
Michael Gottesman d851ea068c [APFloat] Removed out of date comment from isNormal().
I already finished the isIEEENormal => isNormal transition. So isNormal is now
IEEE-754R compliant.

llvm-svn: 184687
2013-06-24 04:19:37 +00:00
Michael Gottesman 9dc98338b8 [APFloat] Rename llvm::exponent_t => llvm::APFloat::ExponentType.
exponent_t is only used internally in APFloat and no exponent_t values are
exposed via the APFloat API. In light of such conditions it does not make any
sense to gum up the llvm namespace with said type. Plus it makes it clearer that
exponent_t is associated with APFloat.

llvm-svn: 184686
2013-06-24 04:06:23 +00:00
Arnold Schwaighofer b914a7e2ef LoopVectorize: Use the dependence test utility class
We now no longer need alias analysis - the cases that alias analysis would
handle are now handled as accesses with a large dependence distance.

We can now vectorize loops with simple constant dependence distances.

  for (i = 8; i < 256; ++i) {
    a[i] = a[i+4] * a[i+8];
  }

  for (i = 8; i < 256; ++i) {
    a[i] = a[i-4] * a[i-8];
  }

We would be able to vectorize about 200 more loops (in many cases the cost model
instructs us no to) in the test suite now. Results on x86-64 are a wash.

I have seen one degradation in ammp. Interestingly, the function in which we
now vectorize a loop is never executed so we probably see some instruction
cache effects. There is a 2% improvement in h264ref. There is one or the other
TSCV loop kernel that speeds up.

radar://13681598

llvm-svn: 184685
2013-06-24 03:55:48 +00:00
Arnold Schwaighofer d517976758 LoopVectorize: Add utility class for checking dependency among accesses
This class checks dependences by subtracting two Scalar Evolution access
functions allowing us to catch very simple linear dependences.

The checker assumes source order in determining whether vectorization is safe.
We currently don't reorder accesses.
Positive true dependencies need to be a multiple of VF otherwise we impede
store-load forwarding.

llvm-svn: 184684
2013-06-24 03:55:45 +00:00
Arnold Schwaighofer d57419696d LoopVectorize: Add utility class for building sets of dependent accesses
Sets of dependent accesses are built by unioning sets based on underlying
objects. This class will be used by the upcoming dependence checker.

llvm-svn: 184683
2013-06-24 03:55:44 +00:00
Nadav Rotem 210e86d7c4 SLP Vectorizer: Add support for vectorizing parts of the tree.
Untill now we detected the vectorizable tree and evaluated the cost of the
entire tree.  With this patch we can decide to trim-out branches of the tree
that are not profitable to vectorizer.

Also, increase the max depth from 6 to 12. In the worse possible case where all
of the code is made of diamond-shaped graph this can bring the cost to 2**10,
but diamonds are not very common.

llvm-svn: 184681
2013-06-24 02:52:43 +00:00
Andrew Trick 97a1d7c475 Fix tail merging to assign the (more) correct BasicBlock when splitting.
This makes it possible to write unit tests that are less susceptible
to minor code motion, particularly copy placement. block-placement.ll
covers this case with -pre-RA-sched=source which will soon be
default. One incorrectly named block is already fixed, but without
this fix, enabling new coalescing and scheduling would cause more
failures.

llvm-svn: 184680
2013-06-24 01:55:01 +00:00
Nadav Rotem 0323925d51 SLP Vectorizer: Fix a bug in the code that does CSE on the generated gather sequences.
Make sure that we don't replace and RAUW two sequences if one does not dominate the other.

llvm-svn: 184674
2013-06-23 21:57:27 +00:00
Nadav Rotem 78428401e9 SLP Vectorizer: Erase instructions outside the vectorizeTree method.
The RAII builder location guard is saving a reference to instructions, so we can't erase instructions during vectorization.

llvm-svn: 184671
2013-06-23 19:38:56 +00:00
David Blaikie 5acff7e691 DebugInfo: PR14404: Avoid truncating 64 bit values into 32 bits for ULEB128/SLEB128 generation
llvm-svn: 184669
2013-06-23 18:31:11 +00:00
Tim Northover 295f049d1f AArch64: fix overzealous NEXTing for Windows testing.
llvm-svn: 184667
2013-06-23 15:32:01 +00:00
Andrew Trick 47740deb26 Add MI-Sched support for x86 macro fusion.
This is an awful implementation of the target hook. But we don't have
abstractions yet for common machine ops, and I don't see any quick way
to make it table-driven.

llvm-svn: 184664
2013-06-23 09:00:28 +00:00
Nadav Rotem eb65e67eea SLP Vectorizer: Implement a simple CSE optimization for the gather sequences.
llvm-svn: 184660
2013-06-23 06:15:46 +00:00
Nadav Rotem 80de0a28f1 SLP Vectorizer: Implement multi-block slp-vectorization.
Rewrote the SLP-vectorization as a whole-function vectorization pass. It is now able to vectorize chains across multiple basic blocks.
It still does not vectorize PHIs, but this should be easy to do now that we scan the entire function.
I removed the support for extracting values from trees.
We are now able to vectorize more programs, but there are some serious regressions in many workloads (such as flops-6 and mandel-2).

llvm-svn: 184647
2013-06-22 21:34:10 +00:00
Reed Kotler de085b2afb Replace with a shorter test case produced by Doug Gillmore.
llvm-svn: 184645
2013-06-22 19:35:08 +00:00
David Blaikie 2b380232c3 DebugInfo: Support (using GNU extensions) for template template parameters and parameter packs
llvm-svn: 184643
2013-06-22 18:59:11 +00:00
Chad Rosier 295bd43adb The getRegForInlineAsmConstraint function should only accept MVT value types.
llvm-svn: 184642
2013-06-22 18:37:38 +00:00
Benjamin Kramer 40d7f354b5 Revert "FunctionAttrs: Merge attributes once instead of doing it for every argument."
It doesn't work as I intended it to.  This reverts commit r184638.

llvm-svn: 184641
2013-06-22 16:56:32 +00:00
Benjamin Kramer 76b7bd0e75 FunctionAttrs: Merge attributes once instead of doing it for every argument.
It has become an expensive operation. No functionality change.

llvm-svn: 184638
2013-06-22 15:51:19 +00:00
Benjamin Kramer b5ab360020 RelocVisitor: Add another PPC64 relocation that occurs in dwarf output.
Should bring the ppc64 buildbot back to life.

llvm-svn: 184633
2013-06-22 13:03:15 +00:00
Rafael Espindola b046eedb94 Create the file with the right permissions instead of setting it afterwards.
Removes the last use of PathV1.h in llvm-ar.

llvm-svn: 184630
2013-06-22 02:34:24 +00:00
Sean Silva 8217757379 [yaml2obj][ELF] Make symbol table top-level key.
Although in reality the symbol table in ELF resides in a section, the
standard requires that there be no more than one SHT_SYMTAB. To enforce
this constraint, it is cleaner to group all the symbols under a
top-level `Symbols` key on the object file.

llvm-svn: 184627
2013-06-22 01:38:00 +00:00
Sean Silva 7a0c3a6fc4 [yaml2obj][ELF] Narrow parameter.
The full ELFYAML::Section isn't needed.

llvm-svn: 184626
2013-06-22 01:37:55 +00:00
Sean Silva 7d61722259 [yaml2obj][ELF] Don't special case writing these.
Just add them to the vector of section headers like the rest of the
section headers.

llvm-svn: 184624
2013-06-22 01:06:12 +00:00
Sean Silva 11caebaa32 [yaml2obj][ELF] Make this "type switch" actually readable.
llvm-svn: 184623
2013-06-22 01:03:35 +00:00
Sean Silva d93323f51d [yaml2obj][ELF] Align section contents in the output.
The improperly aligned section content in the output was causing
buildbot failures. This should fix them.

Incidentally, this results in a simpler and more robust API for
ContiguousBlobAccumulator.

llvm-svn: 184621
2013-06-22 00:47:43 +00:00
Andrew Trick cbd7305d09 Prevent LiveRangeEdit from deleting bundled instructions.
We have no targets on trunk that bundle before regalloc. However, we
have been advertising regalloc as bundle safe for use with out-of-tree
targets. We need to at least contain the parts of the code that are
still unsafe.

llvm-svn: 184620
2013-06-22 00:33:48 +00:00
Benjamin Kramer f51f7186f6 Reapply documentation changes from r184584.
llvm-svn: 184609
2013-06-21 23:45:18 +00:00
Sean Silva e5c41896b3 This was a nifty test, but remove it.
It wouldn't really test anything that doesn't already have a more
targeted test:
`yaml2obj-elf-section-basic.yaml`:
  Already tests that section content is correctly passed though.
`yaml2obj-elf-symbol-basic.yaml` (this file):
  Tests that the st_value and st_size attributes of `main` are set
  correctly.
Between those two tests, disassembling the file doesn't really add
anything, so just remove mention of disassembling the file.

llvm-svn: 184607
2013-06-21 23:17:13 +00:00
Sean Silva 2d47ffd3da Revert "Put r184469 disassembler test back on X86"
This reverts commit r184602. In an upcoming commit, I will just remove
the disassembler part of the test; it was mostly just a "nifty" thing
marking a milestone but it doesn't test anything that isn't tested
elsewhere.

llvm-svn: 184606
2013-06-21 23:17:10 +00:00
David Blaikie 97c6c5bd98 DebugInfo: Don't lose unreferenced non-trivial by-value parameters
A FastISel optimization was causing us to emit no information for such
parameters & when they go missing we end up emitting a different
function type. By avoiding that shortcut we not only get types correct
(very important) but also location information (handy) - even if it's
only live at the start of a function & may be clobbered later.

Reviewed/discussion by Evan Cheng & Dan Gohman.

llvm-svn: 184604
2013-06-21 22:56:30 +00:00
Renato Golin fe941943a6 Put r184469 disassembler test back on X86
llvm-svn: 184602
2013-06-21 22:42:20 +00:00
Rafael Espindola e88d90ab93 Convert some uses of PathV1.h in ArchiveWriter.cpp.
llvm-svn: 184599
2013-06-21 22:11:36 +00:00
Sean Silva 8068ca72bc [yaml2obj][ELF] Don't do disassembly in this test.
This was causing buildbot failures when build without X86 support.

Is there a way to conditionalize the test on the X86 target being
present?

llvm-svn: 184597
2013-06-21 21:51:15 +00:00
Michael Gottesman 9799cf7fb3 [objc-arc-opts] Make IsTrackingImpreciseReleases a const method.
Thanks to Bill Wendling for pointing this out!

llvm-svn: 184593
2013-06-21 20:52:49 +00:00
Kevin Enderby 0fd064c1be Improve the time it takes to generating dwarf for assembly source files
that have been run through the 'C' pre-processor.

The implementation of SrcMgr.FindLineNumber() is slow but OK if
it uses its cache when called multiple times with an SMLoc that is
forward of the previous call.

In the case of generating dwarf for assembly source files that have
been run through the 'C' pre-processor we need to calculate the
logical line number based on the last parsed cpp hash file line
comment.  And the current code calls SrcMgr.FindLineNumber()
twice to do this causing its cache not to work and results in very
slow compile times:

% time /Volumes/SandBox/build-llvm/Debug+Asserts/bin/llvm-mc -triple thumbv7-apple-ios -filetype=obj -o /tmp/x.o mscorlib.dll.E -g
672.542u 0.299s 11:13.15 99.9%	0+0k 0+2io 2106pf+0w

So we save the info from the last parsed cpp hash file line comment
to avoid making the second call to SrcMgr.FindLineNumber() most times
and end up with compile times like:

% time /Volumes/SandBox/build-llvm/Debug+Asserts/bin/llvm-mc -triple thumbv7-apple-ios -filetype=obj -o /tmp/x.o mscorlib.dll.E -g
3.404u 0.104s 0:03.80 92.1%	0+0k 0+3io 2105pf+0w

rdar://14156934

llvm-svn: 184592
2013-06-21 20:51:39 +00:00
Michael Liao f6df64b662 Add '-mcpu=' to prevent breaking on ATOM due to different code schedule
llvm-svn: 184591
2013-06-21 20:22:45 +00:00
Benjamin Kramer bfb84d0bd6 Revert "BlockFrequency: Saturate at 1 instead of 0 when multiplying a frequency with a branch probability."
This reverts commit r184584. Breaks PPC selfhost.

llvm-svn: 184590
2013-06-21 20:20:27 +00:00
Michael Gottesman e3943d0554 [objc-arc-opts] Now that PtrState.RRI is encapsulated in PtrState, make PtrState.RRI private and delete the TODO.
llvm-svn: 184587
2013-06-21 19:44:30 +00:00
Michael Gottesman 4f6ef11763 [objc-arc-opts] Encapsulated PtrState.RRI.{Calls,ReverseInsertPts} into several methods on PtrState.
llvm-svn: 184586
2013-06-21 19:44:27 +00:00
Benjamin Kramer bd0f107929 BlockFrequency: Saturate at 1 instead of 0 when multiplying a frequency with a branch probability.
Zero is used by BlockFrequencyInfo as a special "don't know" value. It also
causes a sink for frequencies as you can't ever get off a zero frequency with
more multiplies.

This recovers a 10% regression on MultiSource/Benchmarks/7zip. A zero frequency
was propagated into an inner loop causing excessive spilling.

PR16402.

llvm-svn: 184584
2013-06-21 19:30:05 +00:00
Michael Gottesman f040118167 [objcarcopts] Encapsulated PtrState.RRI.IsTrackingImpreciseRelease() => PtrState.IsTrackingImpreciseRelease().
llvm-svn: 184583
2013-06-21 19:12:38 +00:00
Michael Gottesman 2f2945973a [objcarcopts] Encapsulate PtrState.RRI.CFGHazardAfflicted via methods PtrState.{IsCFGHazardAfflicted,SetCFGHazardAfflicted}.
llvm-svn: 184582
2013-06-21 19:12:36 +00:00