oota-llvm.git
11 years agoHexagon: Use MO operand flags to mark constant extended instructions.
Jyotsna Verma [Tue, 5 Mar 2013 18:51:42 +0000 (18:51 +0000)]
Hexagon: Use MO operand flags to mark constant extended instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176500 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoHexagon: Add encoding bits to the TFR64 instructions.
Jyotsna Verma [Tue, 5 Mar 2013 18:42:28 +0000 (18:42 +0000)]
Hexagon: Add encoding bits to the TFR64 instructions.
Set imMoveImm, isAsCheapAsAMove flags for TFRI instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176499 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: initial scheduler code
Vincent Lejeune [Tue, 5 Mar 2013 18:41:32 +0000 (18:41 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176498 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoClarify comment for function getObjectSize
Arnold Schwaighofer [Tue, 5 Mar 2013 16:53:24 +0000 (16:53 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176491 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a test that .align directives on capable processors use long NOPs.
David Sehr [Tue, 5 Mar 2013 16:46:54 +0000 (16:46 +0000)]
Add a test that .align directives on capable processors use long NOPs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176490 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Remove LowerConstCopyPass and lower CONST_COPY right after ISel.
Vincent Lejeune [Tue, 5 Mar 2013 15:04:55 +0000 (15:04 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176488 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Turn BUILD_VECTOR into Reg_Sequence
Vincent Lejeune [Tue, 5 Mar 2013 15:04:49 +0000 (15:04 +0000)]
R600: Turn BUILD_VECTOR into Reg_Sequence

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176487 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: CONST_ADDRESS node is not marked as mayLoad anymore
Vincent Lejeune [Tue, 5 Mar 2013 15:04:42 +0000 (15:04 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176486 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Use MUL_IEEE for trig/fdiv intrinsic
Vincent Lejeune [Tue, 5 Mar 2013 15:04:37 +0000 (15:04 +0000)]
R600: Use MUL_IEEE for trig/fdiv intrinsic

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176485 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Add support for indirect addressing of non default const buffer
Vincent Lejeune [Tue, 5 Mar 2013 15:04:29 +0000 (15:04 +0000)]
R600: Add support for indirect addressing of non default const buffer

NOTE: This is a candidate for the Mesa stable branch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176484 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPrint a warning message if compiler-rt can't be built because of old CMake version...
Alexey Samsonov [Tue, 5 Mar 2013 14:43:07 +0000 (14:43 +0000)]
Print a warning message if compiler-rt can't be built because of old CMake version to make this requirement more visible to users

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176481 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm/test/CodeGen/Mips/mips64-f128.ll: Add explicit -mtriple=mips64el-unknown-unknown...
NAKAMURA Takumi [Tue, 5 Mar 2013 02:18:59 +0000 (02:18 +0000)]
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?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176471 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm/test/CodeGen/Thumb/iabs.ll: Add explicit -mtriple=thumb-unknown-unknown to appea...
NAKAMURA Takumi [Tue, 5 Mar 2013 02:18:52 +0000 (02:18 +0000)]
llvm/test/CodeGen/Thumb/iabs.ll: Add explicit -mtriple=thumb-unknown-unknown to appease win32 hosts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176470 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unused #includes.
Bill Wendling [Tue, 5 Mar 2013 01:00:45 +0000 (01:00 +0000)]
Remove unused #includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176467 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThe current X86 NOP padding uses one long NOP followed by the remainder in
David Sehr [Tue, 5 Mar 2013 00:02:23 +0000 (00:02 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176464 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCheck isDiscardableIfUnused, rather than hasLocalLinkage, when bumping
Lang Hames [Mon, 4 Mar 2013 22:40:44 +0000 (22:40 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176459 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Print move instructions.
Akira Hatanaka [Mon, 4 Mar 2013 22:25:01 +0000 (22:25 +0000)]
[mips] Print move instructions.

"move $4, $5" is printed instead of "or $4, $5, $zero".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176455 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMips specific inline assembler constraint 'R'
Jack Carter [Mon, 4 Mar 2013 21:33:15 +0000 (21:33 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176452 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReapply r176381, writing the CHECKs in a more forgiving manner to account for
Eli Bendersky [Mon, 4 Mar 2013 18:20:31 +0000 (18:20 +0000)]
Reapply r176381, writing the CHECKs in a more forgiving manner to account for
running llvm-objdump on Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176443 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoBypass Slow Divides
Preston Gurd [Mon, 4 Mar 2013 18:13:57 +0000 (18:13 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176442 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Clean up datalayout strings so they better match hardware capabilities
Tom Stellard [Mon, 4 Mar 2013 17:40:28 +0000 (17:40 +0000)]
R600: Clean up datalayout strings so they better match hardware capabilities

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176439 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMips ISD typo
Jia Liu [Mon, 4 Mar 2013 01:06:54 +0000 (01:06 +0000)]
Mips ISD typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176426 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: Creating a vector from a lane of another.
Jim Grosbach [Sat, 2 Mar 2013 20:16:24 +0000 (20:16 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176413 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoClean up code format a bit.
Jim Grosbach [Sat, 2 Mar 2013 20:16:19 +0000 (20:16 +0000)]
Clean up code format a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176412 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTidy up. Trailing whitespace.
Jim Grosbach [Sat, 2 Mar 2013 20:16:15 +0000 (20:16 +0000)]
Tidy up. Trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176411 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM NEON: Fix v2f32 float intrinsics
Arnold Schwaighofer [Sat, 2 Mar 2013 19:38:33 +0000 (19:38 +0000)]
ARM NEON: Fix v2f32 float intrinsics

Mark them as expand, they are not legal as our backend does not match them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176410 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agorecommit r172363 & r171325 (reverted in r172756)
Nuno Lopes [Sat, 2 Mar 2013 11:36:24 +0000 (11:36 +0000)]
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..

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176408 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoadd getUnderlyingObjectSize()
Nuno Lopes [Sat, 2 Mar 2013 11:23:34 +0000 (11:23 +0000)]
add getUnderlyingObjectSize()
this is similar to getObjectSize(), but doesnt subtract the offset
tweak the BasicAA code accordingly (per PR14988)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176407 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoX86 cost model: Adjust cost for custom lowered vector multiplies
Arnold Schwaighofer [Sat, 2 Mar 2013 04:02:52 +0000 (04:02 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176403 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdded FIXME for future Hexagon cleanup.
Andrew Trick [Sat, 2 Mar 2013 01:43:08 +0000 (01:43 +0000)]
Added FIXME for future Hexagon cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176400 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPR14448 - prevent the loop vectorizer from vectorizing the same loop twice.
Nadav Rotem [Sat, 2 Mar 2013 01:33:49 +0000 (01:33 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176399 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoModify {Call,Invoke}Inst::addAttribute to take an AttrKind.
Peter Collingbourne [Sat, 2 Mar 2013 01:20:18 +0000 (01:20 +0000)]
Modify {Call,Invoke}Inst::addAttribute to take an AttrKind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176397 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCMake: Always include the CheckCXXCompilerFlag in HandleLLVMOptions.cmake.
Jordan Rose [Sat, 2 Mar 2013 01:00:40 +0000 (01:00 +0000)]
CMake: Always include the CheckCXXCompilerFlag in HandleLLVMOptions.cmake.

Previously we relied on it being included by config-ix.cmake.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176396 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert "Rewrite a test to count emitted instructions without using -stats"
Michael Gottesman [Sat, 2 Mar 2013 00:53:20 +0000 (00:53 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176394 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove duplicate line and move another closer to its actual use
Eli Bendersky [Fri, 1 Mar 2013 23:32:40 +0000 (23:32 +0000)]
Remove duplicate line and move another closer to its actual use

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176391 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMIsched machine model: tablegen subtarget emitter improvement.
Andrew Trick [Fri, 1 Mar 2013 23:31:26 +0000 (23:31 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176390 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoIn llvm::MemoryBuffer::getFile() remove an unnecessary stat call check.
Argyrios Kyrtzidis [Fri, 1 Mar 2013 22:48:51 +0000 (22:48 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176386 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix my email address in CREDITS.TXT.
Stefanus Du Toit [Fri, 1 Mar 2013 22:20:03 +0000 (22:20 +0000)]
Fix my email address in CREDITS.TXT.

Checking to see if svn notifications also use correct address now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176385 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Fix inefficient code generation.
Akira Hatanaka [Fri, 1 Mar 2013 21:52:08 +0000 (21:52 +0000)]
[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)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176384 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemoved extraneous #include "LLVMContextImpl.h" from lib/IR/Module.cpp
Jean-Luc Duprat [Fri, 1 Mar 2013 21:37:24 +0000 (21:37 +0000)]
Removed extraneous #include "LLVMContextImpl.h" from lib/IR/Module.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176382 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRewrite a test to count emitted instructions without using -stats
Eli Bendersky [Fri, 1 Mar 2013 21:34:37 +0000 (21:34 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176381 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix indentation.
Akira Hatanaka [Fri, 1 Mar 2013 21:22:21 +0000 (21:22 +0000)]
Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176380 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSet properties for f128 type.
Akira Hatanaka [Fri, 1 Mar 2013 21:11:44 +0000 (21:11 +0000)]
Set properties for f128 type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176378 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRewrite a test to check actual output rather than intermediate implementation
Eli Bendersky [Fri, 1 Mar 2013 20:54:00 +0000 (20:54 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176377 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoNo need to force-create clang-tools-extra lit.site.cfg
Edwin Vane [Fri, 1 Mar 2013 19:58:58 +0000 (19:58 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176374 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd regression tests (WORKSFORME)
Michael Liao [Fri, 1 Mar 2013 19:23:37 +0000 (19:23 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176369 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoGenerate an error message instead of asserting or segfaulting when we can't
Chad Rosier [Fri, 1 Mar 2013 19:12:05 +0000 (19:12 +0000)]
Generate an error message instead of asserting or segfaulting when we can't
handle indirect register inputs.
rdar://13322011

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176367 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLoopVectorize: Don't hang forever if a PHI only has skipped PHI uses.
Benjamin Kramer [Fri, 1 Mar 2013 19:07:31 +0000 (19:07 +0000)]
LoopVectorize: Don't hang forever if a PHI only has skipped PHI uses.

Fixes PR15384.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176366 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCache the result of Function::getIntrinsicID() in a DenseMap attached to the LLVMContext.
Michael Ilseman [Fri, 1 Mar 2013 18:48:54 +0000 (18:48 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176365 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix PR10475
Michael Liao [Fri, 1 Mar 2013 18:40:30 +0000 (18:40 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176364 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support for using non-pic code for arm and thumb1 when emitting the sjlj
Chad Rosier [Fri, 1 Mar 2013 18:30:38 +0000 (18:30 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176363 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: fix sampler tests after fixing wait insertions
Christian Konig [Fri, 1 Mar 2013 17:39:05 +0000 (17:39 +0000)]
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>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176359 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoHexagon: Add constant extender support framework.
Jyotsna Verma [Fri, 1 Mar 2013 17:37:13 +0000 (17:37 +0000)]
Hexagon: Add constant extender support framework.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176358 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agotest commit to use consistent comment notation.
Peng Cheng [Fri, 1 Mar 2013 16:49:35 +0000 (16:49 +0000)]
test commit to use consistent comment notation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176353 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoGCInfoDeleter code cleanup after r175528
Yiannis Tsiouris [Fri, 1 Mar 2013 11:40:32 +0000 (11:40 +0000)]
GCInfoDeleter code cleanup after r175528

Remove GCInfoDeleter from passes and comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176347 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: handle all registers in copyPhysReg v2
Christian Konig [Fri, 1 Mar 2013 09:46:27 +0000 (09:46 +0000)]
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>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176346 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: remove S_MOV immediate patterns
Christian Konig [Fri, 1 Mar 2013 09:46:22 +0000 (09:46 +0000)]
R600/SI: remove S_MOV immediate patterns

They won't match anyway.

Signed-off-by: Christian König <christian.koenig@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176345 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: remove GPR*AlignEncode
Christian Konig [Fri, 1 Mar 2013 09:46:17 +0000 (09:46 +0000)]
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>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176344 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: fix warning about overloaded virtual
Christian Konig [Fri, 1 Mar 2013 09:46:11 +0000 (09:46 +0000)]
R600/SI: fix warning about overloaded virtual

Signed-off-by: Christian König <christian.koenig@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176343 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: fix inserting waits for unordered defines
Christian Konig [Fri, 1 Mar 2013 09:46:04 +0000 (09:46 +0000)]
R600/SI: fix inserting waits for unordered defines

Signed-off-by: Christian König <christian.koenig@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176342 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoGCC thinks that this variable might be used uninitialized (it isn't).
Duncan Sands [Fri, 1 Mar 2013 09:46:03 +0000 (09:46 +0000)]
GCC thinks that this variable might be used uninitialized (it isn't).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176341 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDocs for llvm-symbolizer command-line tool
Alexey Samsonov [Fri, 1 Mar 2013 07:58:27 +0000 (07:58 +0000)]
Docs for llvm-symbolizer command-line tool

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176337 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMinor coding style fix
Michael Liao [Fri, 1 Mar 2013 04:19:34 +0000 (04:19 +0000)]
Minor coding style fix

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176334 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Remove unused option. Fix 80-column violations.
Akira Hatanaka [Fri, 1 Mar 2013 02:17:02 +0000 (02:17 +0000)]
[mips] Remove unused option. Fix 80-column violations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176330 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Add the capability to search delay slot filling instructions in
Akira Hatanaka [Fri, 1 Mar 2013 02:03:51 +0000 (02:03 +0000)]
[mips] Add the capability to search delay slot filling instructions in
successor basic blocks.

Currently this is off by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176329 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Do not add SecondLastInst to list BranchInstrs if there is only one
Akira Hatanaka [Fri, 1 Mar 2013 01:22:26 +0000 (01:22 +0000)]
[mips] Do not add SecondLastInst to list BranchInstrs if there is only one
terminator.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176326 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Define an overloaded version of function MipsInstrInfo::AnalyzeBranchAdd.
Akira Hatanaka [Fri, 1 Mar 2013 01:10:17 +0000 (01:10 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176325 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Add options to disable searching backward and in successor blocks.
Akira Hatanaka [Fri, 1 Mar 2013 01:02:36 +0000 (01:02 +0000)]
[mips] Add options to disable searching backward and in successor blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176321 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Add capability to search in the forward direction for instructions that
Akira Hatanaka [Fri, 1 Mar 2013 00:50:52 +0000 (00:50 +0000)]
[mips] Add capability to search in the forward direction for instructions that
can fill the delay slot.

Currently, this is off by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176320 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Define helper function searchRange
Akira Hatanaka [Fri, 1 Mar 2013 00:26:14 +0000 (00:26 +0000)]
[mips] Define helper function searchRange

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176318 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Rename function findDelayInstr to searchBackward.
Akira Hatanaka [Fri, 1 Mar 2013 00:20:16 +0000 (00:20 +0000)]
[mips] Rename function findDelayInstr to searchBackward.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176317 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoScheduler diagnostics. Print the register name.
Andrew Trick [Fri, 1 Mar 2013 00:19:14 +0000 (00:19 +0000)]
Scheduler diagnostics. Print the register name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176316 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix incorrect ScheduleDAG comment and formalize Weak edges.
Andrew Trick [Fri, 1 Mar 2013 00:19:12 +0000 (00:19 +0000)]
Fix incorrect ScheduleDAG comment and formalize Weak edges.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176315 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoInstructions schedulers should report correct height/depth.
Andrew Trick [Fri, 1 Mar 2013 00:19:09 +0000 (00:19 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176314 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Define class MemDefsUses.
Akira Hatanaka [Fri, 1 Mar 2013 00:16:31 +0000 (00:16 +0000)]
[mips] Define class MemDefsUses.

This class tracks dependence between memory instructions using underlying
objects of memory operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176313 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConnect LLVM CMake build scripts to LLDB's CMake scripts:
Daniel Malea [Thu, 28 Feb 2013 23:15:15 +0000 (23:15 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176307 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoA small refactoring + adding comments.
Eli Bendersky [Thu, 28 Feb 2013 23:09:18 +0000 (23:09 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176305 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't add the 'Value' string if there isn't one.
Bill Wendling [Thu, 28 Feb 2013 21:17:03 +0000 (21:17 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176301 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a bug in instcombine for fmul in fast math mode.
Quentin Colombet [Thu, 28 Feb 2013 21:12:40 +0000 (21:12 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176300 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove an assert earlier in a file and check that the result of
Eric Christopher [Thu, 28 Feb 2013 20:26:17 +0000 (20:26 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176296 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoBrag about function call vectorization in the docs.
Benjamin Kramer [Thu, 28 Feb 2013 19:33:46 +0000 (19:33 +0000)]
Brag about function call vectorization in the docs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176292 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't add an attribute that already exists and don't remove an attribute that doesn...
Bill Wendling [Thu, 28 Feb 2013 19:17:40 +0000 (19:17 +0000)]
Don't add an attribute that already exists and don't remove an attribute that doesn't exist.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176289 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTidy up; no functional change.
Chad Rosier [Thu, 28 Feb 2013 19:16:42 +0000 (19:16 +0000)]
Tidy up; no functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176288 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCost model support for lowered math builtins.
Benjamin Kramer [Thu, 28 Feb 2013 19:09:33 +0000 (19:09 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176287 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoStyle; no functional change.
Chad Rosier [Thu, 28 Feb 2013 18:54:27 +0000 (18:54 +0000)]
Style; no functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176285 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPut some per-instruction statistics of fast isel under NDEBUG, together with
Eli Bendersky [Thu, 28 Feb 2013 18:05:12 +0000 (18:05 +0000)]
Put some per-instruction statistics of fast isel under NDEBUG, together with
other per-instruction statistics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176273 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRe-format comments (and check commit access)
Yiannis Tsiouris [Thu, 28 Feb 2013 16:59:10 +0000 (16:59 +0000)]
Re-format comments (and check commit access)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176270 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAArch64: remove post-encoder method from FCMP (immediate) instructions.
Tim Northover [Thu, 28 Feb 2013 14:46:14 +0000 (14:46 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176261 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAArch64: be more careful resorting to inefficient addressing for weak vars.
Tim Northover [Thu, 28 Feb 2013 14:36:31 +0000 (14:36 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176259 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAArch64: don't drop GlobalAddress offset when handling extern_weak decls.
Tim Northover [Thu, 28 Feb 2013 14:36:24 +0000 (14:36 +0000)]
AArch64: don't drop GlobalAddress offset when handling extern_weak decls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176258 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd the -disable-opt option to LTO. This adds:
Bill Wendling [Thu, 28 Feb 2013 14:11:10 +0000 (14:11 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176257 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAArch64: Use cbnz instead of cmp/b.ne pair for atomic operations.
Tim Northover [Thu, 28 Feb 2013 13:52:07 +0000 (13:52 +0000)]
AArch64: Use cbnz instead of cmp/b.ne pair for atomic operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176253 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[msan] Implement sanitize_memory attribute.
Evgeniy Stepanov [Thu, 28 Feb 2013 11:25:14 +0000 (11:25 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176247 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCorrections for XFAIL armv5 tests
Renato Golin [Thu, 28 Feb 2013 10:05:10 +0000 (10:05 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176243 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unused leftover declarations.
Evgeniy Stepanov [Thu, 28 Feb 2013 08:42:11 +0000 (08:42 +0000)]
Remove unused leftover declarations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176240 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEnable syntax highlighting for reStructuredText files.
Bill Wendling [Thu, 28 Feb 2013 06:43:24 +0000 (06:43 +0000)]
Enable syntax highlighting for reStructuredText files.
Patch by Journeyer J. Joh!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176235 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Support][ErrorOr] Add support for implicit conversion from error code/condition...
Michael J. Spencer [Thu, 28 Feb 2013 01:44:26 +0000 (01:44 +0000)]
[Support][ErrorOr] Add support for implicit conversion from error code/condition enums.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176228 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[PathV2] In llvm::sys::fs::unique_file, make sure it doesn't fall into an infinite...
Argyrios Kyrtzidis [Thu, 28 Feb 2013 00:38:19 +0000 (00:38 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176226 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a problem in alias analysis. It is about the misinterpretation of "Object".
Shuxin Yang [Thu, 28 Feb 2013 00:24:45 +0000 (00:24 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176225 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unnecessary check against isGlobalVariable. We check it
Eric Christopher [Wed, 27 Feb 2013 23:49:50 +0000 (23:49 +0000)]
Remove unnecessary check against isGlobalVariable. We check it
a few lines above.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176224 91177308-0d34-0410-b5e6-96231b3b80d8