oota-llvm.git
11 years agoThe Mips standalone assembler intial directive support.
Jack Carter [Fri, 7 Sep 2012 00:48:02 +0000 (00:48 +0000)]
The Mips standalone assembler intial directive support.

Actually these are just stubs for parsing the directives.
Semantic support will come later.

Test cases included

Contributer: Vladimir Medic

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

11 years agoThe Mips standalone assembler fpu instruction support.
Jack Carter [Fri, 7 Sep 2012 00:23:42 +0000 (00:23 +0000)]
The Mips standalone assembler fpu instruction support.

Test cases included

Contributer: Vladimir Medic

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

11 years agoRe-work bit/bits value resolving in tblgen
Michael Liao [Thu, 6 Sep 2012 23:32:48 +0000 (23:32 +0000)]
Re-work bit/bits value resolving in tblgen

- This patch is inspired by the failure of the following code snippet
  which is used to convert enumerable values into encoding bits to
  improve the readability of td files.

  class S<int s> {
    bits<2> V = !if(!eq(s, 8),  {0, 0},
                !if(!eq(s, 16), {0, 1},
                !if(!eq(s, 32), {1, 0},
                !if(!eq(s, 64), {1, 1}, {?, ?}))));
  }

  Later, PR8330 is found to report not exactly the same bug relevant
  issue to bit/bits values.

- Instead of resolving bit/bits values separately through
  resolveBitReference(), this patch adds getBit() for all Inits and
  resolves bit value by resolving plus getting the specified bit. This
  unifies the resolving of bit with other values and removes redundant
  logic for resolving bit only. In addition,
  BitsInit::resolveReferences() is optimized to take advantage of this
  origanization by resolving VarBitInit's variable reference first and
  then getting bits from it.

- The type interference in '!if' operator is revised to support possible
  combinations of int and bits/bit in MHS and RHS.

- As there may be illegal assignments from integer value to bit, says
  assign 2 to a bit, but we only check this during instantiation in some
  cases, e.g.

  bit V = !if(!eq(x, 17), 0, 2);

  Verbose diagnostic message is generated when invalid value is
  resolveed to help locating the error.

- PR8330 is fixed as well.

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

11 years agoRemove unused variable introduced by r163346.
David Blaikie [Thu, 6 Sep 2012 23:31:29 +0000 (23:31 +0000)]
Remove unused variable introduced by r163346.

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

11 years agoDon't include stdint.h directly.
Eli Friedman [Thu, 6 Sep 2012 22:55:11 +0000 (22:55 +0000)]
Don't include stdint.h directly.

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

11 years agoExplicitly erase the file from disk if something bad happened. <rdar://problem/12184899>
Bill Wendling [Thu, 6 Sep 2012 21:07:57 +0000 (21:07 +0000)]
Explicitly erase the file from disk if something bad happened. <rdar://problem/12184899>

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

11 years agoThe Mips standalone assembler memory instruction support.
Jack Carter [Thu, 6 Sep 2012 20:00:02 +0000 (20:00 +0000)]
The Mips standalone assembler memory instruction support.

This includes sb,sc,sh,sw,lb,lw,lbu,lh,lhu,ll,lw

Test case included

Contributer: Vladimir Medic

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

11 years agoRelease build: guard dump functions with "ifndef NDEBUG"
Manman Ren [Thu, 6 Sep 2012 19:55:56 +0000 (19:55 +0000)]
Release build: guard dump functions with "ifndef NDEBUG"

No functional change.

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

11 years agoTiedTo is an integer, not a bool.
Jakob Stoklund Olesen [Thu, 6 Sep 2012 19:51:21 +0000 (19:51 +0000)]
TiedTo is an integer, not a bool.

Thanks, Andy.

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

11 years agoRelease build: guard dump functions with "ifndef NDEBUG"
Manman Ren [Thu, 6 Sep 2012 19:06:06 +0000 (19:06 +0000)]
Release build: guard dump functions with "ifndef NDEBUG"

No functional change.

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

11 years agoAllow overlaps between virtreg and physreg live ranges.
Jakob Stoklund Olesen [Thu, 6 Sep 2012 18:15:23 +0000 (18:15 +0000)]
Allow overlaps between virtreg and physreg live ranges.

The RegisterCoalescer understands overlapping live ranges where one
register is defined as a copy of the other. With this change, register
allocators using LiveRegMatrix can do the same, at least for copies
between physical and virtual registers.

When a physreg is defined by a copy from a virtreg, allow those live
ranges to overlap:

  %CL<def> = COPY %vreg11:sub_8bit; GR32_ABCD:%vreg11
  %vreg13<def,tied1> = SAR32rCL %vreg13<tied0>, %CL<imp-use,kill>

We can assign %vreg11 to %ECX, overlapping the live range of %CL.

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

11 years agoHandle overlapping regunit intervals in LiveIntervals::addKillFlags().
Jakob Stoklund Olesen [Thu, 6 Sep 2012 18:15:18 +0000 (18:15 +0000)]
Handle overlapping regunit intervals in LiveIntervals::addKillFlags().

We will soon allow virtual register live ranges to overlap regunit live
ranges when the physreg is defined as a copy of the virtreg:

  %EAX = COPY %vreg5
  FOO %vreg5
  BAR %EAX<kill>

There is no real interference since %vreg5 and %EAX have the same value
where they overlap.

This patch prevents addKillFlags from adding virtreg kill flags to FOO
where the assigned physreg is overlapping the virtual register live
range.

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

11 years agoClear kill flags while computing live ranges.
Jakob Stoklund Olesen [Thu, 6 Sep 2012 18:15:15 +0000 (18:15 +0000)]
Clear kill flags while computing live ranges.

Kill flags are difficult to maintain, and liveness queries are better
handled by live intervals.

Kill flags are reinserted after register allocation by addKillFlags().

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

11 years agoDont cast away const needlessly. Found by gcc48 -Wcast-qual.
Roman Divacky [Thu, 6 Sep 2012 15:42:13 +0000 (15:42 +0000)]
Dont cast away const needlessly. Found by gcc48 -Wcast-qual.

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

11 years agoDiagnose invalid alignments on duplicating VLDn instructions.
Tim Northover [Thu, 6 Sep 2012 15:27:12 +0000 (15:27 +0000)]
Diagnose invalid alignments on duplicating VLDn instructions.

Patch by Chris Lidbury.

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

11 years agoCheck for invalid alignment values when decoding VLDn/VSTn (single ln) instructions.
Tim Northover [Thu, 6 Sep 2012 15:17:49 +0000 (15:17 +0000)]
Check for invalid alignment values when decoding VLDn/VSTn (single ln) instructions.

Patch by Chris Lidbury.

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

11 years agoBasicAA: Recognize cyclic NoAlias phis
Arnold Schwaighofer [Thu, 6 Sep 2012 14:41:53 +0000 (14:41 +0000)]
BasicAA: Recognize cyclic NoAlias phis

Enhances basic alias analysis to recognize phis whose first incoming values are
NoAlias and whose other incoming values are just the phi node itself through
some amount of recursion.

Example: With this change basicaa reports that ptr_phi and ptr_phi2 do not alias
each other.

bb:
 ptr = ptr2 + 1

loop:
  ptr_phi = phi [bb, ptr], [loop, ptr_plus_one]
  ptr2_phi = phi [bb, ptr2], [loop, ptr2_plus_one]
  ...
  ptr_plus_one = gep ptr_phi, 1
  ptr2_plus_one = gep ptr2_phi, 1

This enables the elimination of one load in code like the following:

extern int foo;

int test_noalias(int *ptr, int num, int* coeff) {
  int *ptr2 = ptr;
  int result = (*ptr++) * (*coeff--);
  while (num--) {
    *ptr2++ = *ptr;
    result +=  (*coeff--) * (*ptr++);
  }
  *ptr = foo;
  return result;
}

Part 2/2 of fix for PR13564.

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

11 years agoUse correct part of complex operand to encode VST1 alignment.
Tim Northover [Thu, 6 Sep 2012 14:36:55 +0000 (14:36 +0000)]
Use correct part of complex operand to encode VST1 alignment.

Patch by Chris Lidbury.

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

11 years agoBasicAA: GEPs of NoAlias'ing base ptr with equivalent indices are NoAlias
Arnold Schwaighofer [Thu, 6 Sep 2012 14:31:51 +0000 (14:31 +0000)]
BasicAA: GEPs of NoAlias'ing base ptr with equivalent indices are NoAlias

If we can show that the base pointers of two GEPs don't alias each other using
precise analysis and the indices and base offset are equal then the two GEPs
also don't alias each other.
This is primarily needed for the follow up patch that analyses NoAlias'ing PHI
nodes.

Part 1/2 of fix for PR13564.

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

11 years agoDisable stack coloring by default in order to resolve the i386 failures.
Nadav Rotem [Thu, 6 Sep 2012 14:27:06 +0000 (14:27 +0000)]
Disable stack coloring by default in order to resolve the i386 failures.

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

11 years agoTablegen: Add OperandWithDefaultOps Operand type
Tom Stellard [Thu, 6 Sep 2012 14:15:52 +0000 (14:15 +0000)]
Tablegen: Add OperandWithDefaultOps Operand type

This Operand type takes a default argument, and is initialized to
this value if it does not appear in a patter.

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

11 years agoAVX2 optimization.
Elena Demikhovsky [Thu, 6 Sep 2012 12:42:01 +0000 (12:42 +0000)]
AVX2 optimization.
Added generation of VPSHUB instruction for <32 x i8> vector shuffle when possible.

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

11 years agoFix a few old-GCC warnings. No functional change.
Nadav Rotem [Thu, 6 Sep 2012 11:13:55 +0000 (11:13 +0000)]
Fix a few old-GCC warnings. No functional change.

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

11 years agoFix the test by specifying an exact cpu model.
Nadav Rotem [Thu, 6 Sep 2012 10:33:33 +0000 (10:33 +0000)]
Fix the test by specifying an exact cpu model.

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

11 years agoFix self-host; ensure signedness is consistent.
James Molloy [Thu, 6 Sep 2012 10:32:08 +0000 (10:32 +0000)]
Fix self-host; ensure signedness is consistent.

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

11 years agoFix switch_to_lookup_table.ll test from r163302.
Hans Wennborg [Thu, 6 Sep 2012 10:10:35 +0000 (10:10 +0000)]
Fix switch_to_lookup_table.ll test from r163302.

The lookup tables did not get built in a deterministic order.
This makes them get built in the order that the corresponding phi nodes
were found.

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

11 years agoImprove codegen for BUILD_VECTORs on ARM.
James Molloy [Thu, 6 Sep 2012 09:55:02 +0000 (09:55 +0000)]
Improve codegen for BUILD_VECTORs on ARM.

If we have a BUILD_VECTOR that is mostly a constant splat, it is often better to splat that constant then insertelement the non-constant lanes instead of insertelementing every lane from an undef base.

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

11 years agoBuild lookup tables for switches (PR884)
Hans Wennborg [Thu, 6 Sep 2012 09:43:28 +0000 (09:43 +0000)]
Build lookup tables for switches (PR884)

This adds a transformation to SimplifyCFG that attemps to turn switch
instructions into loads from lookup tables. It works on switches that
are only used to initialize one or more phi nodes in a common successor
basic block, for example:

  int f(int x) {
    switch (x) {
    case 0: return 5;
    case 1: return 4;
    case 2: return -2;
    case 5: return 7;
    case 6: return 9;
    default: return 42;
  }

This speeds up the code by removing the hard-to-predict jump, and
reduces code size by removing the code for the jump targets.

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

11 years agoAdd a new optimization pass: Stack Coloring, that merges disjoint static allocations...
Nadav Rotem [Thu, 6 Sep 2012 09:17:37 +0000 (09:17 +0000)]
Add a new optimization pass: Stack Coloring, that merges disjoint static allocations (allocas). Allocas are known to be
disjoint if they are marked by disjoint lifetime markers (@llvm.lifetime.XXX intrinsics).

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

11 years agoOptimize codegen for VSETLNi{8,16,32} operating on Q registers. Degenerate to a VSETL...
James Molloy [Thu, 6 Sep 2012 09:16:01 +0000 (09:16 +0000)]
Optimize codegen for VSETLNi{8,16,32} operating on Q registers. Degenerate to a VSETLN on D registers, instead of an (INSERT_SUBREG (VSETLN (EXTRACT_SUBREG ))) sequence to help the register coalescer.

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

11 years agoRemove duplicated helper function
Michael Liao [Thu, 6 Sep 2012 07:11:22 +0000 (07:11 +0000)]
Remove duplicated helper function

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

11 years agoUse iPTR instead of i32 for extract_subvector/insert_subvector index in lowering...
Craig Topper [Thu, 6 Sep 2012 06:09:01 +0000 (06:09 +0000)]
Use iPTR instead of i32 for extract_subvector/insert_subvector index in lowering and patterns. This makes it consistent with the incoming DAG nodes from the DAG builder.

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

11 years agoAdd patterns for converting stores of subvector_extracts of lower 128-bits of a 256...
Craig Topper [Thu, 6 Sep 2012 05:15:01 +0000 (05:15 +0000)]
Add patterns for converting stores of subvector_extracts of lower 128-bits of a 256-bit vector to VMOVAPSmr/VMOVUPSmr.

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

11 years agoRevert "Enable MCJIT tests on Darwin."
Jim Grosbach [Thu, 6 Sep 2012 03:24:09 +0000 (03:24 +0000)]
Revert "Enable MCJIT tests on Darwin."

This reverts commit 163278.

Works OK on x86_64, but not i386. Will re-enable when that's cleared up.

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

11 years agoWhitespace.
NAKAMURA Takumi [Thu, 6 Sep 2012 03:02:56 +0000 (03:02 +0000)]
Whitespace.

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

11 years agoUnix/Signals.inc: Fix a typo. Thanks to Dani Berg!
NAKAMURA Takumi [Thu, 6 Sep 2012 03:01:43 +0000 (03:01 +0000)]
Unix/Signals.inc: Fix a typo. Thanks to Dani Berg!

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

11 years agoThere are some Mips instructions that are lowered by the
Jack Carter [Thu, 6 Sep 2012 02:31:34 +0000 (02:31 +0000)]
There are some Mips instructions that are lowered by the
assembler such as shifts greater than 32. In the case
of direct object, the code gen needs to do this lowering
since the assembler is not involved.

With the advent of the llvm-mc assembler, it also needs
to do the same lowering.

This patch makes that specific lowering code accessible
to both the direct object output and the assembler.

This patch does not affect generated output.

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

11 years agoUpdate function names to conform to guidelines.
Jim Grosbach [Thu, 6 Sep 2012 00:59:08 +0000 (00:59 +0000)]
Update function names to conform to guidelines.

No functional change.

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

11 years agoEnable MCJIT tests on Darwin.
Jim Grosbach [Thu, 6 Sep 2012 00:59:06 +0000 (00:59 +0000)]
Enable MCJIT tests on Darwin.

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

11 years agoMips specific llvm assembler support for branch and jump instructions.
Jack Carter [Thu, 6 Sep 2012 00:43:26 +0000 (00:43 +0000)]
Mips specific llvm assembler support for branch and jump instructions.
Test case included.

Contributer: Vladimir Medic

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

11 years agoDon't include stdint.h directly.
Eli Friedman [Thu, 6 Sep 2012 00:12:55 +0000 (00:12 +0000)]
Don't include stdint.h directly.

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

11 years agoRemove predicated pseudo-instructions.
Jakob Stoklund Olesen [Wed, 5 Sep 2012 23:58:04 +0000 (23:58 +0000)]
Remove predicated pseudo-instructions.

These pseudos are no longer needed now that it is possible to represent
predicated instructions in SSA form.

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

11 years agoUse predication instead of pseudo-opcodes when folding into MOVCC.
Jakob Stoklund Olesen [Wed, 5 Sep 2012 23:58:02 +0000 (23:58 +0000)]
Use predication instead of pseudo-opcodes when folding into MOVCC.

Now that it is possible to dynamically tie MachineInstr operands,
predicated instructions are possible in SSA form:

  %vreg3<def> = SUBri %vreg1, -2147483647, pred:14, pred:%noreg, %opt:%noreg
  %vreg4<def,tied1> = MOVCCr %vreg3<tied0>, %vreg1, %pred:12, pred:%CPSR

Becomes a predicated SUBri with a tied imp-use:

  SUBri %vreg1, -2147483647, pred:13, pred:%CPSR, opt:%noreg, %vreg1<imp-use,tied0>

This means that any instruction that is safe to move can be folded into
a MOVCC, and the *CC pseudo-instructions are no longer needed.

The test case changes reflect that Thumb2SizeReduce recognizes the
predicated instructions. It didn't understand the pseudos.

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

11 years ago[ms-inline asm] Use the asm dialect from the MI to set the parser dialect.
Chad Rosier [Wed, 5 Sep 2012 23:57:37 +0000 (23:57 +0000)]
[ms-inline asm] Use the asm dialect from the MI to set the parser dialect.

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

11 years agoAdd missing file for test.
Nick Lewycky [Wed, 5 Sep 2012 23:52:20 +0000 (23:52 +0000)]
Add missing file for test.

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

11 years agoTeach libObject about some more ELF relocations. llvm-objdump -r now knows
Nick Lewycky [Wed, 5 Sep 2012 23:48:54 +0000 (23:48 +0000)]
Teach libObject about some more ELF relocations. llvm-objdump -r now knows
every relocation in C++ hello world built with debug info.

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

11 years agoJumpThreading: when default destination is the destination of some cases in a
Manman Ren [Wed, 5 Sep 2012 23:45:58 +0000 (23:45 +0000)]
JumpThreading: when default destination is the destination of some cases in a
switch, make sure we include the value for the cases when calculating edge
value from switch to the default destination.

rdar://12241132

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

11 years agoMips specific llvm assembler support for ALU instructions. This includes
Jack Carter [Wed, 5 Sep 2012 23:34:03 +0000 (23:34 +0000)]
Mips specific llvm assembler support for ALU instructions. This includes
register support. Test case included.

Contributer: Vladimir Medic

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

11 years agoCleanup a few magic numbers.
Chad Rosier [Wed, 5 Sep 2012 22:40:13 +0000 (22:40 +0000)]
Cleanup a few magic numbers.

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

11 years agoStop casting away const qualifier needlessly.
Roman Divacky [Wed, 5 Sep 2012 22:26:57 +0000 (22:26 +0000)]
Stop casting away const qualifier needlessly.

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

11 years ago[ms-inline asm] We only need one bit to represent the AsmDialect in the
Chad Rosier [Wed, 5 Sep 2012 22:17:43 +0000 (22:17 +0000)]
[ms-inline asm] We only need one bit to represent the AsmDialect in the
MachineInstr.

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

11 years agoConstify this properly. Found by gcc48 -Wcast-qual.
Roman Divacky [Wed, 5 Sep 2012 22:15:49 +0000 (22:15 +0000)]
Constify this properly. Found by gcc48 -Wcast-qual.

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

11 years agoMark checkSignature const, and in turn stop casting away const from
Roman Divacky [Wed, 5 Sep 2012 22:09:23 +0000 (22:09 +0000)]
Mark checkSignature const, and in turn stop casting away const from
ArchiveMemberHeader. Found by gcc48 -Wcast-qual.

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

11 years agoConstify SDNodeIterator an stop its only non-const user being cast stripped
Roman Divacky [Wed, 5 Sep 2012 22:03:34 +0000 (22:03 +0000)]
Constify SDNodeIterator an stop its only non-const user being cast stripped
of its constness. Found by gcc48 -Wcast-qual.

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

11 years agoConstify subtarget info properly so that we dont cast away the const in
Roman Divacky [Wed, 5 Sep 2012 21:43:57 +0000 (21:43 +0000)]
Constify subtarget info properly so that we dont cast away the const in
the SubtargetInfoKV tables. Found by gcc48 -Wcast-qual.

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

11 years agoUse const properly so that we dont remove const qualifier from region and MII
Roman Divacky [Wed, 5 Sep 2012 21:17:34 +0000 (21:17 +0000)]
Use const properly so that we dont remove const qualifier from region and MII
by casting. Found with gcc48.

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

11 years ago[ms-inline asm] Propagate the asm dialect into the MachineInstr representation.
Chad Rosier [Wed, 5 Sep 2012 21:00:58 +0000 (21:00 +0000)]
[ms-inline asm] Propagate the asm dialect into the MachineInstr representation.

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

11 years agoFix a bug.
Jan Wen Voung [Wed, 5 Sep 2012 20:56:00 +0000 (20:56 +0000)]
Fix a bug.

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

11 years agorevert the additional stuff.
Jan Wen Voung [Wed, 5 Sep 2012 20:55:57 +0000 (20:55 +0000)]
revert the additional stuff.

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

11 years agoClean up llvm-bcanalyzer to print to consistent streams.
Jan Wen Voung [Wed, 5 Sep 2012 20:55:54 +0000 (20:55 +0000)]
Clean up llvm-bcanalyzer to print to consistent streams.
Avoid interleaving fprintf(stderr,...) and outs() << ...;

Also add a column to show "bytes-per" for each record.

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

11 years ago[Docs] Fix Sphinx incremental build. Patch by Sean Silva!
Michael J. Spencer [Wed, 5 Sep 2012 19:44:47 +0000 (19:44 +0000)]
[Docs] Fix Sphinx incremental build. Patch by Sean Silva!

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

11 years agoMove the PPC TOC defs into the PPC64 InstrInfo file.
Hal Finkel [Wed, 5 Sep 2012 19:22:27 +0000 (19:22 +0000)]
Move the PPC TOC defs into the PPC64 InstrInfo file.

Since TOC is just defined for PPC64, move its definition to PPC64 td file.

Patch by Adhemerval Zanella.

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

11 years agoClean up.
Chad Rosier [Wed, 5 Sep 2012 19:16:22 +0000 (19:16 +0000)]
Clean up.

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

11 years ago[ms-inline asm] Enumerate the InlineAsm dialects and rename the nsdialect to
Chad Rosier [Wed, 5 Sep 2012 19:00:49 +0000 (19:00 +0000)]
[ms-inline asm] Enumerate the InlineAsm dialects and rename the nsdialect to
inteldialect.

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

11 years agoStrip old MachineInstrs *after* we know we can put them back.
Tim Northover [Wed, 5 Sep 2012 18:37:53 +0000 (18:37 +0000)]
Strip old MachineInstrs *after* we know we can put them back.

Previous patch accidentally decided it couldn't convert a VFP to a
NEON instruction after it had already destroyed the old one. Not a
good move.

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

11 years agoClean up includes.
Benjamin Kramer [Wed, 5 Sep 2012 18:19:08 +0000 (18:19 +0000)]
Clean up includes.

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

11 years agoUpdate CMakeList.txt for new lli sources.
Jim Grosbach [Wed, 5 Sep 2012 18:15:08 +0000 (18:15 +0000)]
Update CMakeList.txt for new lli sources.

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

11 years agoRemove unused typedefs gcc4.8 warns about.
Roman Divacky [Wed, 5 Sep 2012 17:55:46 +0000 (17:55 +0000)]
Remove unused typedefs gcc4.8 warns about.

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

11 years agoMCJIT: getPointerToFunction() references target address space.
Jim Grosbach [Wed, 5 Sep 2012 16:50:40 +0000 (16:50 +0000)]
MCJIT: getPointerToFunction() references target address space.

Make sure to return a pointer into the target memory, not the local memory.
Often they are the same, but we can't assume that.

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

11 years agoMCJIT: Add faux remote target execution to lli for the MCJIT.
Jim Grosbach [Wed, 5 Sep 2012 16:50:34 +0000 (16:50 +0000)]
MCJIT: Add faux remote target execution to lli for the MCJIT.

Simulate a remote target address space by allocating a seperate chunk of
memory for the target and re-mapping section addresses to that prior to
execution. Later we'll want to have a truly remote process, but for now
this gets us closer to being able to test the remote target
functionality outside LLDB.

rdar://12157052

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

11 years agoSwitch BasicAliasAnalysis' cache to SmallDenseMap.
Benjamin Kramer [Wed, 5 Sep 2012 16:49:37 +0000 (16:49 +0000)]
Switch BasicAliasAnalysis' cache to SmallDenseMap.

It relies on clear() being fast and the cache rarely has more than 1 or 2
elements, so give it an inline capacity and always shrink it back down in case
it grows. DenseMap will grow to 64 buckets which makes clear() a lot slower.

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

11 years agoLLVM Bug Fix 13709: Remove needless lsr(Rp, #32) instruction access the
Pranav Bhandarkar [Wed, 5 Sep 2012 16:01:40 +0000 (16:01 +0000)]
LLVM Bug Fix 13709: Remove needless lsr(Rp, #32) instruction access the
subreg_hireg of register pair Rp.

* lib/Target/Hexagon/HexagonPeephole.cpp(PeepholeDoubleRegsMap): New
 DenseMap similar to PeepholeMap that additionally records subreg info
 too.
        (runOnMachineFunction): Record information in PeepholeDoubleRegsMap
        and copy propagate the high sub-reg of Rp0 in Rp1 = lsr(Rp0, #32) to
the instruction Rx = COPY Rp1:logreg_subreg.
* test/CodeGen/Hexagon/remove_lsr.ll: New test.

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

11 years ago[asan] fix lint
Kostya Serebryany [Wed, 5 Sep 2012 09:00:18 +0000 (09:00 +0000)]
[asan] fix lint

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

11 years agoFixed the DAG combiner to better handle the folding of AND nodes for vector types...
Silviu Baranga [Wed, 5 Sep 2012 08:57:21 +0000 (08:57 +0000)]
Fixed the DAG combiner to better handle the folding of AND nodes for vector types. The previous code was making the assumption that the length of the bitmask returned by isConstantSplat was equal to the size of the vector type. Now we first make sure that the splat value has at least the length of the vector lane type, then we only use as many fields as we have available in the splat value.

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

11 years ago[asan] extend the blacklist functionality to handle global-init. Patch by Reid Watson
Kostya Serebryany [Wed, 5 Sep 2012 07:29:56 +0000 (07:29 +0000)]
[asan] extend the blacklist functionality to handle global-init. Patch by Reid Watson

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

11 years agoRemove some of the patterns added in r163196. Increasing the complexity on insert_sub...
Craig Topper [Wed, 5 Sep 2012 07:26:35 +0000 (07:26 +0000)]
Remove some of the patterns added in r163196. Increasing the complexity on insert_subvector into undef accomplishes the same thing.

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

11 years agoAdd patterns for integer forms of VINSERTF128/VINSERTI128 folded with loads. Also...
Craig Topper [Wed, 5 Sep 2012 06:58:39 +0000 (06:58 +0000)]
Add patterns for integer forms of VINSERTF128/VINSERTI128 folded with loads. Also add patterns to turn subvector inserts with loads to index 0 of an undef into VMOVAPS.

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

11 years agoAdd a FIXME that assumes we maintain backward compatibility until the next major...
Chad Rosier [Wed, 5 Sep 2012 06:28:52 +0000 (06:28 +0000)]
Add a FIXME that assumes we maintain backward compatibility until the next major release.

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

11 years agoReorder the comments of EmitExceptionTable.
Logan Chien [Wed, 5 Sep 2012 06:28:26 +0000 (06:28 +0000)]
Reorder the comments of EmitExceptionTable.

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

11 years agoFix UseInitArray option for MIPS target.
Logan Chien [Wed, 5 Sep 2012 06:17:17 +0000 (06:17 +0000)]
Fix UseInitArray option for MIPS target.

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

11 years agoConvert vextracti128/vextractf128 intrinsics to extract_subvector at DAG build time...
Craig Topper [Wed, 5 Sep 2012 05:48:09 +0000 (05:48 +0000)]
Convert vextracti128/vextractf128 intrinsics to extract_subvector at DAG build time. Similar was previously done for vinserti128/vinsertf128. Add patterns for folding these extract_subvectors with stores.

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

11 years agoRemoved Trie.h; unused in a long time
Marshall Clow [Wed, 5 Sep 2012 03:18:55 +0000 (03:18 +0000)]
Removed Trie.h; unused in a long time

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

11 years agoRemove redundant semicolons to fix -pedantic-errors build.
Richard Smith [Wed, 5 Sep 2012 01:41:37 +0000 (01:41 +0000)]
Remove redundant semicolons to fix -pedantic-errors build.

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

11 years agoFix function name per coding standard.
Chad Rosier [Wed, 5 Sep 2012 01:15:43 +0000 (01:15 +0000)]
Fix function name per coding standard.

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

11 years agoFix function name per coding standard.
Chad Rosier [Wed, 5 Sep 2012 01:02:38 +0000 (01:02 +0000)]
Fix function name per coding standard.

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

11 years ago[ms-inline asm] Add support for the nsdialect keyword in the Bitcode
Chad Rosier [Wed, 5 Sep 2012 00:56:20 +0000 (00:56 +0000)]
[ms-inline asm] Add support for the nsdialect keyword in the Bitcode
Reader/Writer.

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

11 years ago[ms-inline asm] Add the nsdialect keyword to the lexer.
Chad Rosier [Wed, 5 Sep 2012 00:51:02 +0000 (00:51 +0000)]
[ms-inline asm] Add the nsdialect keyword to the lexer.

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

11 years ago[ms-inline asm] Emit the (new) inline asm Non-Standard Dialect attribute.
Chad Rosier [Wed, 5 Sep 2012 00:08:17 +0000 (00:08 +0000)]
[ms-inline asm] Emit the (new) inline asm Non-Standard Dialect attribute.

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

11 years agoMake provenance checking conservative in cases when
Dan Gohman [Tue, 4 Sep 2012 23:16:20 +0000 (23:16 +0000)]
Make provenance checking conservative in cases when
pointers-to-strong-pointers may be in play. These can lead to retains and
releases happening in unstructured ways, foiling the optimizer. This fixes
rdar://12150909.

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

11 years agoBypassSlowDivision: Assign to reference, don't copy the object.
Jakub Staszak [Tue, 4 Sep 2012 23:11:11 +0000 (23:11 +0000)]
BypassSlowDivision: Assign to reference, don't copy the object.

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

11 years agoSearch the whole instruction for tied operands.
Jakob Stoklund Olesen [Tue, 4 Sep 2012 22:59:30 +0000 (22:59 +0000)]
Search the whole instruction for tied operands.

Implicit uses can be dynamically tied to defs. This will soon be used
for predicated instructions on ARM.

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

11 years ago[ms-inline asm] Add the inline assembly dialect, AsmDialect, to the InlineAsm
Chad Rosier [Tue, 4 Sep 2012 22:46:24 +0000 (22:46 +0000)]
[ms-inline asm] Add the inline assembly dialect, AsmDialect, to the InlineAsm
class.

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

11 years ago[ms-inline asm] Remove the Inline Asm Non-Standard Dialect attribute. This
Chad Rosier [Tue, 4 Sep 2012 22:29:45 +0000 (22:29 +0000)]
[ms-inline asm] Remove the Inline Asm Non-Standard Dialect attribute.  This
implementation does not co-exist well with how the sideeffect and alignstack
attributes are handled.  The reverts r161641.

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

11 years ago[LIT] Add a clang_tools_extra_site_cfg to match the various other site_cfg.
David Blaikie [Tue, 4 Sep 2012 22:09:04 +0000 (22:09 +0000)]
[LIT] Add a clang_tools_extra_site_cfg to match the various other site_cfg.

This doesn't seem ideal, perhaps we could just keep the llvm_site_cfg and have
other config (clang and clang-tools-extra) derive their site_cfg from that.

Suggestions/complaints/ideas welcome.

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

11 years agoFix my previous patch (r163164). It does now what it is supposed to do:
Jakub Staszak [Tue, 4 Sep 2012 21:16:59 +0000 (21:16 +0000)]
Fix my previous patch (r163164). It does now what it is supposed to do:
Doesn't set MadeChange to TRUE if BypassSlowDivision doesn't change anything.

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

11 years agoReturn false if BypassSlowDivision doesn't change anything.
Jakub Staszak [Tue, 4 Sep 2012 20:48:24 +0000 (20:48 +0000)]
Return false if BypassSlowDivision doesn't change anything.
Also a few minor changes:
- use pre-inc instead of post-inc
- use isa instead of dyn_cast
- 80 col
- trailing spaces

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

11 years agoRemove unneeded code.
Jakub Staszak [Tue, 4 Sep 2012 19:49:17 +0000 (19:49 +0000)]
Remove unneeded code.

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

11 years agoTypo.
Jakob Stoklund Olesen [Tue, 4 Sep 2012 18:44:43 +0000 (18:44 +0000)]
Typo.

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

11 years agoActually use the MachineOperand field for isRegTiedToDefOperand().
Jakob Stoklund Olesen [Tue, 4 Sep 2012 18:43:25 +0000 (18:43 +0000)]
Actually use the MachineOperand field for isRegTiedToDefOperand().

The MachineOperand::TiedTo field was maintained, but not used.

This patch enables it in isRegTiedToDefOperand() and
isRegTiedToUseOperand() which are the actual functions use by the
register allocator.

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

11 years agoMove tie checks into MachineVerifier::visitMachineOperand.
Jakob Stoklund Olesen [Tue, 4 Sep 2012 18:38:28 +0000 (18:38 +0000)]
Move tie checks into MachineVerifier::visitMachineOperand.

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