Commit Graph

90097 Commits

Author SHA1 Message Date
Christian Konig 3625055b8c R600/SI: remove shader type intrinsic
Just encode the type as target specific attribute.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176622
2013-03-07 09:03:46 +00:00
Christian Konig 2214f14ab9 R600/SI: switch types of SGPRs to v*i8
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176621
2013-03-07 09:03:38 +00:00
Christian Konig a0ed657293 R600/SI: fix unused variable warning
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176620
2013-03-07 09:03:30 +00:00
Nick Lewycky 492afe8127 Switch from a version 4.2/4.4 switch to a four-byte version string to be put
into the actual gcov file.

Instead of using the bottom 4 bytes as the function identifier, use a counter.
This makes the identifier numbers stable across multiple runs.

llvm-svn: 176616
2013-03-07 08:28:49 +00:00
Nadav Rotem 40cda80af8 No need to go through int64 and APInt when generating a new constant.
llvm-svn: 176615
2013-03-07 06:34:49 +00:00
Jim Grosbach 48a91abc10 SDAG: Handle scalarizing an extend of a <1 x iN> vector.
Just scalarize the element and rebuild a vector of the result type
from that.

rdar://13281568

llvm-svn: 176614
2013-03-07 05:47:54 +00:00
Nick Lewycky d50cff6dc9 Remove GCDAProfiling.c. This copy is old, the copy in compiler-rt is newer and
is the one that should be used.

llvm-svn: 176608
2013-03-07 02:03:08 +00:00
Manman Ren 1e4272085d Debug Info: store the files and directories for each compile unit.
We now emit a line table for each compile unit. To reduce the prologue size
of each line table, the files and directories used by each compile unit are
stored in std::map<unsigned, std::vector< > > instead of std::vector< >.

The prologue for a lto'ed image can be as big as 93K. Duplicating 93K for each
compile unit causes a huge increase of debug info. With this patch, each
prologue will only emit the files required by the compile unit.

rdar://problem/13342023

llvm-svn: 176605
2013-03-07 01:42:00 +00:00
Nadav Rotem 96a4aa678c ArrayRef has a OneElt constructor. Beautify the code.
llvm-svn: 176604
2013-03-07 01:38:04 +00:00
Nadav Rotem 883304333d Switch from std::vector to ArrayRef. Speedup FoldBitCast by 5x.
llvm-svn: 176602
2013-03-07 01:30:40 +00:00
Andrew Trick a0a5ca06b9 SimplifyCFG fix for volatile load/store.
Fixes rdar:13349374.

Volatile loads and stores need to be preserved even if the language
standard says they are undefined. "volatile" in this context means "get
out of the way compiler, let my platform handle it".

Additionally, this is the only way I know of with llvm to write to the
first page (when hardware allows) without dropping to assembly.

llvm-svn: 176599
2013-03-07 01:03:35 +00:00
Michael Liao d5cac37dc5 Fix two remaining issue after fixing PR15355 when CMOV is not available
- Phi nodes should be replaced/updated after lowering CMOV into branch
  because 'mainMBB' updating operand in Phi node is changed.
- Add EFLAGS in livein before lowering the 2nd CMOV. It's necessary as
  we will reuse the EFLAGS generated before the 1st lowered CMOV, which
  won't clobber EFLAGS. However, we need explicitly specify that.
- '-attr=-cmov' test case are added.

llvm-svn: 176598
2013-03-07 01:01:29 +00:00
Akira Hatanaka 0f693a8a77 [mips] Custom-legalize BR_JT.
In N64-static, GOT address is needed to compute the branch address.

llvm-svn: 176580
2013-03-06 21:32:03 +00:00
Andrew Trick fcb37243f9 Generalize my previous fix for -print-options.
Always print options that differ from their implicit default. At least
for simple option types.

llvm-svn: 176572
2013-03-06 19:04:56 +00:00
Michael Liao a7699084b9 Remove tailing whitespaces
llvm-svn: 176570
2013-03-06 18:24:34 +00:00
Andrew Trick 946c2b32e6 Give -loop-vectorize an explicit default.
This way, clang -mllvm -print-options shows that the driver is overriding it.

llvm-svn: 176569
2013-03-06 18:22:22 +00:00
Shuxin Yang 408bdad5b4 Memory Dependence Analysis (not mem-dep test) take advantage of "invariant.load" metadata.
The "invariant.load" metadata indicates the memory unit being accessed is immutable.
A load annotated with this metadata can be moved across any store.

As I am not sure if it is legal to move such loads across barrier/fence, this
change dose not allow such transformation.

rdar://11311484

Thank Arnold for code review.

llvm-svn: 176562
2013-03-06 17:48:48 +00:00
Jim Grosbach 95d2eb95c3 InstCombine: Don't shrink allocas when combining with a bitcast.
When considering folding a bitcast of an alloca into the alloca itself,
make sure we don't shrink the amount of memory being allocated, or
things rapidly go sideways.

rdar://13324424

llvm-svn: 176547
2013-03-06 05:44:53 +00:00
Akira Hatanaka a9cf03fbd7 [mips] Add a line which checks function name. Rename file.
llvm-svn: 176543
2013-03-06 01:58:03 +00:00
Michael Liao da22b30be5 Fix PR15355
- Clear 'mayStore' flag when loading from the atomic variable before the
  spin loop
- Clear kill flag from one use to multiple use in registers forming the
  address to that atomic variable
- don't use a physical register as live-in register in BB (neither entry
  nor landing pad.) by copying it into virtual register

(patch by Cameron Zwarich)

llvm-svn: 176538
2013-03-06 00:17:04 +00:00
Jakub Staszak b7129f2148 Use dyn_cast instead of isa && cast. No functionality change.
llvm-svn: 176537
2013-03-06 00:16:16 +00:00
Jakub Staszak 32bc031368 Remove duplicated forward declaration.
llvm-svn: 176536
2013-03-06 00:04:32 +00:00
Akira Hatanaka 1454ed8ad3 [mips] Remove android calling convention.
This calling convention was added just to handle functions which return vector
of floats. The fix committed in r165585 solves the problem.

llvm-svn: 176530
2013-03-05 23:22:30 +00:00
Akira Hatanaka e092f72956 [mips] Fix MipsCC::analyzeReturn so that, in soft-float mode, fp128 gets
returned in registers $2 and $4.

llvm-svn: 176527
2013-03-05 22:54:59 +00:00
Akira Hatanaka 5f3ba9e595 [mips] Fix MipsTargetLowering::LowerCallResult and LowerReturn to correctly
handle fp128 returns.

llvm-svn: 176523
2013-03-05 22:41:55 +00:00
Akira Hatanaka 3b7391d140 [mips] Fix MipsTargetLowering::LowerCall to pass fp128 arguments in floating
point registers.

llvm-svn: 176521
2013-03-05 22:20:28 +00:00
Akira Hatanaka 4b634fa3b3 [mips] Correct handling of fp128 (long double) formals and read long double
parameters from floating point registers if target is mips64 hard float.

llvm-svn: 176520
2013-03-05 22:13:04 +00:00
Jakub Staszak f18c92b0d7 Fix a few typos in comments.
llvm-svn: 176519
2013-03-05 22:05:16 +00:00
Jakub Staszak 87c5af309c Add some constantness.
llvm-svn: 176518
2013-03-05 22:01:15 +00:00
Jakub Staszak 83396ba4c9 std::distance() == 0 means that iterators are equal. No functionality change.
llvm-svn: 176516
2013-03-05 21:53:57 +00:00
Meador Inge b904e6e467 Add more functions to the TLI.
This patch adds many more functions to the target library information.
All of the functions being added were discovered while doing the migration
of the simplify-libcalls attribute annotation functionality to the
functionattrs pass.  As a part of that work the attribute annotation logic
will query TLI to determine if a function should be annotated or not.

Signed-off-by: Meador Inge <meadori@codesourcery.com>
llvm-svn: 176514
2013-03-05 21:47:40 +00:00
Jyotsna Verma 457801f7ab reverting patch 176508.
llvm-svn: 176513
2013-03-05 20:29:23 +00:00
Jyotsna Verma 7179e712dd Hexagon: Add support for lowering block address.
llvm-svn: 176508
2013-03-05 19:37:46 +00:00
Vincent Lejeune fe32bd87c2 R600: Do not predicate vector op
llvm-svn: 176507
2013-03-05 19:12:06 +00:00
Jyotsna Verma 0eeea14e3e Hexagon: Expand addc, adde, subc and sube.
llvm-svn: 176505
2013-03-05 19:04:47 +00:00
Arnold Schwaighofer a96569c640 Use the right number of slashes in comment string
llvm-svn: 176504
2013-03-05 19:04:12 +00:00
Eli Bendersky 59d7cb2386 Fixes a test by replacing .align by .p2align and setting triples explicitly.
Patch by David Sehr

llvm-svn: 176502
2013-03-05 18:56:14 +00:00
Benjamin Kramer 5dc831801a Update cmake build.
llvm-svn: 176501
2013-03-05 18:54:05 +00:00
Jyotsna Verma f1214a8ab7 Hexagon: Use MO operand flags to mark constant extended instructions.
llvm-svn: 176500
2013-03-05 18:51:42 +00:00
Jyotsna Verma f4e324f4fb Hexagon: Add encoding bits to the TFR64 instructions.
Set imMoveImm, isAsCheapAsAMove flags for TFRI instructions.

llvm-svn: 176499
2013-03-05 18:42:28 +00:00
Vincent Lejeune 68b6b6ddfb R600: initial scheduler code
This is a skeleton for a pre-RA MachineInstr scheduler strategy. Currently
it only tries to expose more parallelism for ALU instructions (this also
makes the distribution of GPR channels more uniform and increases the
chances of ALU instructions to be packed together in a single VLIW group).
Also it tries to reduce clause switching by grouping instruction of the
same kind (ALU/FETCH/CF) together.

Vincent Lejeune:
 - Support for VLIW4 Slot assignement
 - Recomputation of ScheduleDAG to get more parallelism opportunities

Tom Stellard:
 - Fix assertion failure when trying to determine an instruction's slot
   based on its destination register's class
 - Fix some compiler warnings

Vincent Lejeune: [v2]
 - Remove recomputation of ScheduleDAG (will be provided in a later patch)
 - Improve estimation of an ALU clause size so that heuristic does not emit cf
 instructions at the wrong position.
 - Make schedule heuristic smarter using SUnit Depth
 - Take constant read limitations into account

Vincent Lejeune: [v3]
 - Fix some uninitialized values in ConstPair
 - Add asserts to ensure an ALU slot is always populated

llvm-svn: 176498
2013-03-05 18:41:32 +00:00
Arnold Schwaighofer af269a8b44 Clarify comment for function getObjectSize
Clarify that we mean the object starting at the pointer to the end of the
underlying object and not the size of the whole allocated object.

llvm-svn: 176491
2013-03-05 16:53:24 +00:00
David Sehr af76f18fc3 Add a test that .align directives on capable processors use long NOPs.
llvm-svn: 176490
2013-03-05 16:46:54 +00:00
Vincent Lejeune 0b72f1021d R600: Remove LowerConstCopyPass and lower CONST_COPY right after ISel.
Maintaining CONST_COPY Instructions until Pre Emit may prevent some ifcvt case
and taking them in account for scheduling is difficult for no real benefit.

llvm-svn: 176488
2013-03-05 15:04:55 +00:00
Vincent Lejeune 3b6f20e944 R600: Turn BUILD_VECTOR into Reg_Sequence
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
llvm-svn: 176487
2013-03-05 15:04:49 +00:00
Vincent Lejeune 10a5e4773e R600: CONST_ADDRESS node is not marked as mayLoad anymore
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>

mayLoad complexify scheduling and does not bring any usefull info
as the location is not writeable at all.

llvm-svn: 176486
2013-03-05 15:04:42 +00:00
Vincent Lejeune a199d01e4d R600: Use MUL_IEEE for trig/fdiv intrinsic
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
llvm-svn: 176485
2013-03-05 15:04:37 +00:00
Vincent Lejeune 743dca0446 R600: Add support for indirect addressing of non default const buffer
NOTE: This is a candidate for the Mesa stable branch.
llvm-svn: 176484
2013-03-05 15:04:29 +00:00
Alexey Samsonov db171ea95f Print a warning message if compiler-rt can't be built because of old CMake version to make this requirement more visible to users
llvm-svn: 176481
2013-03-05 14:43:07 +00:00
NAKAMURA Takumi 3ae057c6ab llvm/test/CodeGen/Mips/mips64-f128.ll: Add explicit -mtriple=mips64el-unknown-unknown to appease win32.
FIXME: Is it expected for win32 to affect mips targets?
llvm-svn: 176471
2013-03-05 02:18:59 +00:00
NAKAMURA Takumi cc91d50289 llvm/test/CodeGen/Thumb/iabs.ll: Add explicit -mtriple=thumb-unknown-unknown to appease win32 hosts.
llvm-svn: 176470
2013-03-05 02:18:52 +00:00
Bill Wendling a69d0aaa71 Remove unused #includes.
llvm-svn: 176467
2013-03-05 01:00:45 +00:00
David Sehr 4c8979cd4d The current X86 NOP padding uses one long NOP followed by the remainder in
one-byte NOPs.  If the processor actually executes those NOPs, as it sometimes
does with aligned bundling, this can have a performance impact.  From my
micro-benchmarks run on my one machine, a 15-byte NOP followed by twelve
one-byte NOPs is about 20% worse than a 15 followed by a 12.  This patch
changes NOP emission to emit as many 15-byte (the maximum) as possible followed
by at most one shorter NOP.

llvm-svn: 176464
2013-03-05 00:02:23 +00:00
Lang Hames 30be8a30cc Check isDiscardableIfUnused, rather than hasLocalLinkage, when bumping
GlobalValue linkage up to ExternalLinkage in the ExtractGV pass. This
prevents linkonce and linkonce_odr symbols from being DCE'd.

llvm-svn: 176459
2013-03-04 22:40:44 +00:00
Akira Hatanaka c7828356aa [mips] Print move instructions.
"move $4, $5" is printed instead of "or $4, $5, $zero".

llvm-svn: 176455
2013-03-04 22:25:01 +00:00
Jack Carter 0e149b04f6 Mips specific inline assembler constraint 'R'
'R' An address that can be sued in a non-macro load or store.
This patch includes a positive test case.

llvm-svn: 176452
2013-03-04 21:33:15 +00:00
Eli Bendersky 4e1db8d7f7 Reapply r176381, writing the CHECKs in a more forgiving manner to account for
running llvm-objdump on Darwin.

llvm-svn: 176443
2013-03-04 18:20:31 +00:00
Preston Gurd 485296d1e8 Bypass Slow Divides
* Only apply divide bypass optimization when not optimizing for size. 
* Fixed bug caused by constant for 0 value of type Int32,
  used dividend type to generate the constant instead.
* For atom x86-64 apply the divide bypass to use 16-bit divides instead of
  64-bit divides when operand values are small enough.
* Added lit tests for 64-bit divide bypass.

Patch by Tyler Nowicki!

llvm-svn: 176442
2013-03-04 18:13:57 +00:00
Tom Stellard b2f2f960ce R600: Clean up datalayout strings so they better match hardware capabilities
llvm-svn: 176439
2013-03-04 17:40:28 +00:00
Jia Liu 434874db6f Mips ISD typo
llvm-svn: 176426
2013-03-04 01:06:54 +00:00
Jim Grosbach a3c5c769d6 ARM: Creating a vector from a lane of another.
The VDUP instruction source register doesn't allow a non-constant lane
index, so make sure we don't construct a ARM::VDUPLANE node asking it to
do so.

rdar://13328063
http://llvm.org/bugs/show_bug.cgi?id=13963

llvm-svn: 176413
2013-03-02 20:16:24 +00:00
Jim Grosbach c6f1914ef0 Clean up code format a bit.
llvm-svn: 176412
2013-03-02 20:16:19 +00:00
Jim Grosbach 54efea0a7a Tidy up. Trailing whitespace.
llvm-svn: 176411
2013-03-02 20:16:15 +00:00
Arnold Schwaighofer 99cba9697a ARM NEON: Fix v2f32 float intrinsics
Mark them as expand, they are not legal as our backend does not match them.

llvm-svn: 176410
2013-03-02 19:38:33 +00:00
Nuno Lopes 589443bd93 recommit r172363 & r171325 (reverted in r172756)
This adds minimalistic support for PHI nodes to llvm.objectsize() evaluation

fingers crossed so that it does break clang boostrap again..

llvm-svn: 176408
2013-03-02 11:36:24 +00:00
Nuno Lopes 6e3d46014d add getUnderlyingObjectSize()
this is similar to getObjectSize(), but doesnt subtract the offset
tweak the BasicAA code accordingly (per PR14988)

llvm-svn: 176407
2013-03-02 11:23:34 +00:00
Arnold Schwaighofer 20ef54f4c1 X86 cost model: Adjust cost for custom lowered vector multiplies
This matters for example in following matrix multiply:

int **mmult(int rows, int cols, int **m1, int **m2, int **m3) {
  int i, j, k, val;
  for (i=0; i<rows; i++) {
    for (j=0; j<cols; j++) {
      val = 0;
      for (k=0; k<cols; k++) {
        val += m1[i][k] * m2[k][j];
      }
      m3[i][j] = val;
    }
  }
  return(m3);
}

Taken from the test-suite benchmark Shootout.

We estimate the cost of the multiply to be 2 while we generate 9 instructions
for it and end up being quite a bit slower than the scalar version (48% on my
machine).

Also, properly differentiate between avx1 and avx2. On avx-1 we still split the
vector into 2 128bits and handle the subvector muls like above with 9
instructions.
Only on avx-2 will we have a cost of 9 for v4i64.

I changed the test case in test/Transforms/LoopVectorize/X86/avx1.ll to use an
add instead of a mul because with a mul we now no longer vectorize. I did
verify that the mul would be indeed more expensive when vectorized with 3
kernels:

for (i ...)
   r += a[i] * 3;
for (i ...)
  m1[i] = m1[i] * 3; // This matches the test case in avx1.ll
and a matrix multiply.

In each case the vectorized version was considerably slower.

radar://13304919

llvm-svn: 176403
2013-03-02 04:02:52 +00:00
Andrew Trick 63474629e8 Added FIXME for future Hexagon cleanup.
llvm-svn: 176400
2013-03-02 01:43:08 +00:00
Nadav Rotem 739e37a0d2 PR14448 - prevent the loop vectorizer from vectorizing the same loop twice.
The LoopVectorizer often runs multiple times on the same function due to inlining.
When this happens the loop vectorizer often vectorizes the same loops multiple times, increasing code size and adding unneeded branches.
With this patch, the vectorizer during vectorization puts metadata on scalar loops and marks them as 'already vectorized' so that it knows to ignore them when it sees them a second time.

PR14448.

llvm-svn: 176399
2013-03-02 01:33:49 +00:00
Peter Collingbourne 1b97a9c82a Modify {Call,Invoke}Inst::addAttribute to take an AttrKind.
llvm-svn: 176397
2013-03-02 01:20:18 +00:00
Jordan Rose 643aa0e0dc CMake: Always include the CheckCXXCompilerFlag in HandleLLVMOptions.cmake.
Previously we relied on it being included by config-ix.cmake.

llvm-svn: 176396
2013-03-02 01:00:40 +00:00
Michael Gottesman ee45c03fec Revert "Rewrite a test to count emitted instructions without using -stats"
This reverts commit aac7922b8fe7ae733d3fe6697e6789fd730315dc. I am reverting the
commit since it broke the phase 1 public buildbot for a few hours.

http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RA/builds/2137

llvm-svn: 176394
2013-03-02 00:53:20 +00:00
Eli Bendersky b1caf3c30e Remove duplicate line and move another closer to its actual use
llvm-svn: 176391
2013-03-01 23:32:40 +00:00
Andrew Trick 3821d9d028 MIsched machine model: tablegen subtarget emitter improvement.
Fix the way resources are counted. I'm taking some time to cleanup the
way MachineScheduler handles in-order machine resources. Eventually
we'll need more PPC/Atom test cases in tree.

llvm-svn: 176390
2013-03-01 23:31:26 +00:00
Argyrios Kyrtzidis db4443f7af In llvm::MemoryBuffer::getFile() remove an unnecessary stat call check.
The sys::fs::is_directory() check is unnecessary because, if the filename is
a directory, the function will fail anyway with the same error code returned.
Remove the check to avoid an unnecessary stat call.

Someone needs to review on windows and see if the check is necessary there or not.

llvm-svn: 176386
2013-03-01 22:48:51 +00:00
Stefanus Du Toit 1ed1694643 Fix my email address in CREDITS.TXT.
Checking to see if svn notifications also use correct address now.

llvm-svn: 176385
2013-03-01 22:20:03 +00:00
Akira Hatanaka ece459bb66 [mips] Fix inefficient code generation.
This patch eliminates the need to emit a constant move instruction when this
pattern is matched:

(select (setgt a, Constant), T, F)

The pattern above effectively turns into this:

(conditional-move (setlt a, Constant + 1), F, T)

llvm-svn: 176384
2013-03-01 21:52:08 +00:00
Jean-Luc Duprat 3cec010805 Removed extraneous #include "LLVMContextImpl.h" from lib/IR/Module.cpp
llvm-svn: 176382
2013-03-01 21:37:24 +00:00
Eli Bendersky 0091e2ff00 Rewrite a test to count emitted instructions without using -stats
Also removed the comments of "should produce..." because they completely
don't match the actually produced output.

llvm-svn: 176381
2013-03-01 21:34:37 +00:00
Akira Hatanaka a4c0341514 Fix indentation.
llvm-svn: 176380
2013-03-01 21:22:21 +00:00
Akira Hatanaka 3d055580a9 Set properties for f128 type.
llvm-svn: 176378
2013-03-01 21:11:44 +00:00
Eli Bendersky 10ab5e72e1 Rewrite a test to check actual output rather than intermediate implementation
detail.

The was this test was written, it was relying on an implementation detail
(fixups) and hence was very brittle (relying, among other things, on the
exact ordering of statistics printed by MC).

The test was rewritten to check a more observable output difference. While it
doesn't cover 100% of the things the original test covered, it's a good
practice to write regression tests this way. If we want to check that
internal details and invariants hold, such tests should be expressed as unit
tests.

llvm-svn: 176377
2013-03-01 20:54:00 +00:00
Edwin Vane 510c341517 No need to force-create clang-tools-extra lit.site.cfg
The make (all) target takes care of creating lit configs and auto-generating
tests. The problem with the original 'lit.site.cfg' target is it's not
recursive and doesn't fully create everything necessary for testing
clang-tools-extra.

llvm-svn: 176374
2013-03-01 19:58:58 +00:00
Michael Liao d10584e38b Add regression tests (WORKSFORME)
- These tests wont't crash on trunk but would be better to add them so that
  they don't break again in the future.

llvm-svn: 176369
2013-03-01 19:23:37 +00:00
Chad Rosier b3864609cf Generate an error message instead of asserting or segfaulting when we can't
handle indirect register inputs.
rdar://13322011

llvm-svn: 176367
2013-03-01 19:12:05 +00:00
Benjamin Kramer 12f98fae98 LoopVectorize: Don't hang forever if a PHI only has skipped PHI uses.
Fixes PR15384.

llvm-svn: 176366
2013-03-01 19:07:31 +00:00
Michael Ilseman 516d70399e Cache the result of Function::getIntrinsicID() in a DenseMap attached to the LLVMContext.
This reduces the time actually spent doing string to ID conversion and shows a 10% improvement in compile time for a particularly bad case that involves ARM Neon intrinsics (these have many overloads).

Patch by Jean-Luc Duprat!

llvm-svn: 176365
2013-03-01 18:48:54 +00:00
Michael Liao 6af16fc3b7 Fix PR10475
- ISD::SHL/SRL/SRA must have either both scalar or both vector operands
  but TLI.getShiftAmountTy() so far only return scalar type. As a
  result, backend logic assuming that breaks.
- Rename the original TLI.getShiftAmountTy() to
  TLI.getScalarShiftAmountTy() and re-define TLI.getShiftAmountTy() to
  return target-specificed scalar type or the same vector type as the
  1st operand.
- Fix most TICG logic assuming TLI.getShiftAmountTy() a simple scalar
  type.

llvm-svn: 176364
2013-03-01 18:40:30 +00:00
Chad Rosier 9660343b42 Add support for using non-pic code for arm and thumb1 when emitting the sjlj
dispatch code.  As far as I can tell the thumb2 code is behaving as expected.
I was able to compile and run the associated test case for both arm and thumb1.
rdar://13066352

llvm-svn: 176363
2013-03-01 18:30:38 +00:00
Christian Konig 3c54770365 R600/SI: fix sampler tests after fixing wait insertions
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176359
2013-03-01 17:39:05 +00:00
Jyotsna Verma 8425643728 Hexagon: Add constant extender support framework.
llvm-svn: 176358
2013-03-01 17:37:13 +00:00
Peng Cheng e021c4e7cc test commit to use consistent comment notation.
llvm-svn: 176353
2013-03-01 16:49:35 +00:00
Yiannis Tsiouris 70dd0caa46 GCInfoDeleter code cleanup after r175528
Remove GCInfoDeleter from passes and comments.

llvm-svn: 176347
2013-03-01 11:40:32 +00:00
Christian Konig d0e3da1818 R600/SI: handle all registers in copyPhysReg v2
v2: based on Michels patch, but now allows copying of all registers sizes.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
llvm-svn: 176346
2013-03-01 09:46:27 +00:00
Christian Konig 1f344cda53 R600/SI: remove S_MOV immediate patterns
They won't match anyway.

Signed-off-by: Christian König <christian.koenig@amd.com>
llvm-svn: 176345
2013-03-01 09:46:22 +00:00
Christian Konig 8465296420 R600/SI: remove GPR*AlignEncode
It's much easier to specify the encoding with tablegen directly.

Signed-off-by: Christian König <christian.koenig@amd.com>
llvm-svn: 176344
2013-03-01 09:46:17 +00:00
Christian Konig 01fd1f6b36 R600/SI: fix warning about overloaded virtual
Signed-off-by: Christian König <christian.koenig@amd.com>
llvm-svn: 176343
2013-03-01 09:46:11 +00:00
Christian Konig 862fd9fa2c R600/SI: fix inserting waits for unordered defines
Signed-off-by: Christian König <christian.koenig@amd.com>
llvm-svn: 176342
2013-03-01 09:46:04 +00:00
Duncan Sands 2cb41d372c GCC thinks that this variable might be used uninitialized (it isn't).
llvm-svn: 176341
2013-03-01 09:46:03 +00:00
Alexey Samsonov 2bc1012561 Docs for llvm-symbolizer command-line tool
llvm-svn: 176337
2013-03-01 07:58:27 +00:00
Michael Liao 53e7ef35b5 Minor coding style fix
llvm-svn: 176334
2013-03-01 04:19:34 +00:00
Akira Hatanaka e9e588dd72 [mips] Remove unused option. Fix 80-column violations.
llvm-svn: 176330
2013-03-01 02:17:02 +00:00
Akira Hatanaka 8f7bfb39be [mips] Add the capability to search delay slot filling instructions in
successor basic blocks.

Currently this is off by default.

llvm-svn: 176329
2013-03-01 02:03:51 +00:00
Akira Hatanaka 28dc83ceb3 [mips] Do not add SecondLastInst to list BranchInstrs if there is only one
terminator.

No functionality change.

llvm-svn: 176326
2013-03-01 01:22:26 +00:00
Akira Hatanaka 7320b2364d [mips] Define an overloaded version of function MipsInstrInfo::AnalyzeBranchAdd.
This function will be used later when the capability to search delay slot
filling instructions in successor blocks is added. No intended functionality
changes.

llvm-svn: 176325
2013-03-01 01:10:17 +00:00
Akira Hatanaka e44e30ca5a [mips] Add options to disable searching backward and in successor blocks.
llvm-svn: 176321
2013-03-01 01:02:36 +00:00
Akira Hatanaka e01ff9dc60 [mips] Add capability to search in the forward direction for instructions that
can fill the delay slot.

Currently, this is off by default.

llvm-svn: 176320
2013-03-01 00:50:52 +00:00
Akira Hatanaka f815db5bcb [mips] Define helper function searchRange
No functionality change.

llvm-svn: 176318
2013-03-01 00:26:14 +00:00
Akira Hatanaka 50e174d95d [mips] Rename function findDelayInstr to searchBackward.
llvm-svn: 176317
2013-03-01 00:20:16 +00:00
Andrew Trick f9669beacd Scheduler diagnostics. Print the register name.
llvm-svn: 176316
2013-03-01 00:19:14 +00:00
Andrew Trick 8e897ca393 Fix incorrect ScheduleDAG comment and formalize Weak edges.
llvm-svn: 176315
2013-03-01 00:19:12 +00:00
Andrew Trick 2a8edef70b Instructions schedulers should report correct height/depth.
We avoided computing DAG height/depth during Node printing because it
shouldn't depend on an otherwise valid DAG. But this has become far
too annoying for the common case of a valid DAG where we want to see
valid values. If doing the computation on-the-fly turns out to be a
problem in practice, then I'll add a mode to the diagnostics to only
force it when we're likely to have a valid DAG, otherwise explicitly
print INVALID instead of bogus numbers. For now, just go for it all
the time.

llvm-svn: 176314
2013-03-01 00:19:09 +00:00
Akira Hatanaka eb33ced08f [mips] Define class MemDefsUses.
This class tracks dependence between memory instructions using underlying
objects of memory operands. 

llvm-svn: 176313
2013-03-01 00:16:31 +00:00
Daniel Malea 6e9b040649 Connect LLVM CMake build scripts to LLDB's CMake scripts:
- if you have LLDB checked out in $llvm/tools, CMake will build it now!
- LLDB is known to build on Linux with libstdc++ and GCC 4.6/4.7 or Clang 3.3
- to run lldb tests, do "make check-lldb" after a build

llvm-svn: 176307
2013-02-28 23:15:15 +00:00
Eli Bendersky 33ebf836bc A small refactoring + adding comments.
SelectionDAGIsel::LowerArguments needs a function, not a basic block. So it
makes sense to pass it the function instead of extracting a basic-block from
the function and then tossing it. This is also more self-documenting (functions
have arguments, BBs don't).

In addition, added comments to a couple of Select* methods.

llvm-svn: 176305
2013-02-28 23:09:18 +00:00
Bill Wendling 8a0e0841f3 Don't add the 'Value' string if there isn't one.
This was causing the folding set to fail to fold attributes, because it was
being calculated in one spot without an empty values string but here with an
empty values string.

llvm-svn: 176301
2013-02-28 21:17:03 +00:00
Quentin Colombet e684a6d4aa Fix a bug in instcombine for fmul in fast math mode.
The instcombine recognized pattern looks like:
a = b * c
d = a +/- Cst
or
a = b * c
d = Cst +/- a

When creating the new operands for fadd or fsub instruction following the related fmul, the first operand was created with the second original operand (M0 was created with C1) and the second with the first (M1 with Opnd0).

The fix consists in creating the new operands with the appropriate original operand, i.e., M0 with Opnd0 and M1 with C1.

llvm-svn: 176300
2013-02-28 21:12:40 +00:00
Eric Christopher 0ac16d539c Move an assert earlier in a file and check that the result of
our bitwise compare is equal to the field we're looking for.

Noticed on inspection.

llvm-svn: 176296
2013-02-28 20:26:17 +00:00
Benjamin Kramer a87d5128dd Brag about function call vectorization in the docs.
llvm-svn: 176292
2013-02-28 19:33:46 +00:00
Bill Wendling 8c8f9871c3 Don't add an attribute that already exists and don't remove an attribute that doesn't exist.
llvm-svn: 176289
2013-02-28 19:17:40 +00:00
Chad Rosier 537ff50b5d Tidy up; no functional change.
llvm-svn: 176288
2013-02-28 19:16:42 +00:00
Benjamin Kramer f7cfac7a14 Cost model support for lowered math builtins.
We make the cost for calling libm functions extremely high as emitting the
calls is expensive and causes spills (on x86) so performance suffers. We still
vectorize important calls like ceilf and friends on SSE4.1. and fabs.

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

llvm-svn: 176287
2013-02-28 19:09:33 +00:00
Chad Rosier 11a9828745 Style; no functional change.
llvm-svn: 176285
2013-02-28 18:54:27 +00:00
Eli Bendersky d0c6e7b038 Put some per-instruction statistics of fast isel under NDEBUG, together with
other per-instruction statistics.

llvm-svn: 176273
2013-02-28 18:05:12 +00:00
Yiannis Tsiouris d4842e5ee9 Re-format comments (and check commit access)
llvm-svn: 176270
2013-02-28 16:59:10 +00:00
Tim Northover ce17020c97 AArch64: remove post-encoder method from FCMP (immediate) instructions.
The work done by the post-encoder (setting architecturally unused bits to 0 as
required) can be done by the existing operand that covers the "#0.0". This
removes at least one use of the discouraged PostEncoderMethod uses.

llvm-svn: 176261
2013-02-28 14:46:14 +00:00
Tim Northover c3c5c0971d AArch64: be more careful resorting to inefficient addressing for weak vars.
If an otherwise weak var is actually defined in this unit, it can't be
undefined at runtime so we can use normal global variable sequences (ADRP/ADD)
to access it.

llvm-svn: 176259
2013-02-28 14:36:31 +00:00
Tim Northover b9d4fd210b AArch64: don't drop GlobalAddress offset when handling extern_weak decls.
llvm-svn: 176258
2013-02-28 14:36:24 +00:00
Bill Wendling c7e0a04433 Add the -disable-opt option to LTO. This adds:
- Consistency with opt (which supports the same option with the same meaning and
  description).
- Debugging gold plugin-based linking without optimizations getting in the way.
- Debugging programs linked with the gold plugin while preserving the original
  debug info.
- Fine-grained control over LTO passes using the gold plugin in combination with
  opt (or clang/dragonegg).

Patch by Cristiano Giuffrida!

llvm-svn: 176257
2013-02-28 14:11:10 +00:00
Tim Northover 9fafdf6d5a AArch64: Use cbnz instead of cmp/b.ne pair for atomic operations.
llvm-svn: 176253
2013-02-28 13:52:07 +00:00
Evgeniy Stepanov 00062b4498 [msan] Implement sanitize_memory attribute.
Shadow checks are disabled and memory loads always produce fully initialized
values in functions that don't have a sanitize_memory attribute. Value and
argument shadow is propagated as usual.

This change also updates blacklist behaviour to match the above.

llvm-svn: 176247
2013-02-28 11:25:14 +00:00
Renato Golin 0d89178ba3 Corrections for XFAIL armv5 tests
Most of the tests that behave differently on llvm-arm-linux buildbot
did so becase the triple wasn't set correctly to armv5, so we can
revert most of the special behaviour added previously. Some tests
still need the special treatment, though.

llvm-svn: 176243
2013-02-28 10:05:10 +00:00
Evgeniy Stepanov 4c9300e630 Remove unused leftover declarations.
llvm-svn: 176240
2013-02-28 08:42:11 +00:00
Bill Wendling 0615dbe44c Enable syntax highlighting for reStructuredText files.
Patch by Journeyer J. Joh!

llvm-svn: 176235
2013-02-28 06:43:24 +00:00
Michael J. Spencer 12e3dfc58e [Support][ErrorOr] Add support for implicit conversion from error code/condition enums.
llvm-svn: 176228
2013-02-28 01:44:26 +00:00
Argyrios Kyrtzidis eed2dc5769 [PathV2] In llvm::sys::fs::unique_file, make sure it doesn't fall into an infinite loop by constantly trying
to create the parent path.

This can happen if the path is a relative filename and the current directory was removed.
Thanks to Daniel D. for the hint in fixing it.

llvm-svn: 176226
2013-02-28 00:38:19 +00:00
Shuxin Yang 1e55d8c663 Fix a problem in alias analysis. It is about the misinterpretation of "Object".
This problem is exposed by r171325 which is already reverted. It is rather
hard to fabricate a testing case without it.

r171325 should *NOT* be resurrected as it has a potential problem although 
this problem dosen't directly contribute to PR14988.

The bug is tracked by:
  - rdar://13063553, and
  - http://llvm.org/bugs/show_bug.cgi?id=14988

Thank Arnold for coming up a better solution to this problem. After
comparing this solution and my original proposal, I decided to ditch mine.

llvm-svn: 176225
2013-02-28 00:24:45 +00:00
Eric Christopher 5958b46053 Remove unnecessary check against isGlobalVariable. We check it
a few lines above.

llvm-svn: 176224
2013-02-27 23:49:50 +00:00
Eric Christopher 3f79b8c374 Rework comment slightly and fix a few typos.
llvm-svn: 176223
2013-02-27 23:49:47 +00:00
Eric Christopher 10d35e9065 Remove unnecessary cast to void.
llvm-svn: 176222
2013-02-27 23:49:45 +00:00
Manman Ren 584e4c0eda Debug Info: for static member variables, always put AT_MIPS_linkage_name to the
definition DIE (TAG_variable), and put AT_MIPS_linkage_name to TAG_member when
DarwinGDBCompat is true.

Darwin GDB needs AT_MIPS_linkage_name at both places to work.

Follow-up patch to r176143.
rdar://problem/13291234

llvm-svn: 176220
2013-02-27 23:21:02 +00:00
Nadav Rotem c29095fb50 Silence the unused variable warning.
llvm-svn: 176218
2013-02-27 22:52:54 +00:00
Nadav Rotem 00b75dd3c4 The FastISEL should be fast. But when we record statistics we use atomic operations to increment the counters.
This patch disables the counters on non-debug builds. This reduces the runtime of SelectionDAGISel::SelectCodeCommon by ~5%.

llvm-svn: 176214
2013-02-27 21:59:43 +00:00
David Blaikie 9aa8e0b30a Copy missing member in DataLayout copy ctor.
Test case is missing due to it not being reachable through the current tools
but out of tree code such as the sample at
http://llvm.org/docs/tutorial/LangImpl4.html

Patch by Peng Cheng <gm4cheng@gmail.com>

llvm-svn: 176213
2013-02-27 21:44:59 +00:00
Jim Grosbach 5f21587648 ARM: FMA is legal only if VFP4 is available.
rdar://13306723

llvm-svn: 176212
2013-02-27 21:31:12 +00:00
Chad Rosier d3e47ca423 Remove this instance of dl as it's defined in a previous scope.
llvm-svn: 176208
2013-02-27 20:34:14 +00:00
Michael Ilseman ba8446c80e Reverted: r176136 - Have a way for a target to opt-out of target-independent fast isel
llvm-svn: 176204
2013-02-27 19:54:00 +00:00
Sean Silva f8e58016f6 [docs] Discuss manpage output.
llvm-svn: 176199
2013-02-27 18:48:42 +00:00
Aaron Ballman a2b75bcb52 Switching -1ULL to UINT64_MAX to fix MSVC warnings. Patch thanks to Peng Cheng!
llvm-svn: 176197
2013-02-27 18:38:33 +00:00
Sean Silva 1b46534445 [docs] Provide pointer for building Sphinx docs.
llvm-svn: 176195
2013-02-27 18:33:21 +00:00