oota-llvm.git
14 years agoadd an x86 implementation of MCTargetExpr for
Chris Lattner [Mon, 8 Feb 2010 22:09:08 +0000 (22:09 +0000)]
add an x86 implementation of MCTargetExpr for
representing @GOT and friends.  Use it for
personality references as a first use.

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

14 years agodon't make hte dtor private or we can't construct the class.
Chris Lattner [Mon, 8 Feb 2010 22:07:36 +0000 (22:07 +0000)]
don't make hte dtor private or we can't construct the class.

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

14 years agouse a c-style cast instead of reinterpret-cast, as sometimes the
Chris Lattner [Mon, 8 Feb 2010 22:05:38 +0000 (22:05 +0000)]
use a c-style cast instead of reinterpret-cast, as sometimes the
cast needs to adjust for a vtable pointer when going from base to
derived type (when the base doesn't have a vtable but the
derived type does).

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

14 years agoAdd VCVTR (between floating-point and integer, VFP) for disassembly purpose.
Johnny Chen [Mon, 8 Feb 2010 22:02:41 +0000 (22:02 +0000)]
Add VCVTR (between floating-point and integer, VFP) for disassembly purpose.
The 'R' suffix means the to-integer operations use the rounding mode specified
by the FPSCR, encoded as Inst{7} = 0.

A8.6.295

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

14 years agoWhen CodeGen'ing unoptimized code, there may be unfolded constant expressions
Dan Gohman [Mon, 8 Feb 2010 22:02:38 +0000 (22:02 +0000)]
When CodeGen'ing unoptimized code, there may be unfolded constant expressions
in global initializers. Instead of aborting, attempt to fold them on the
spot. If folding succeeds, emit the folded expression instead.

This fixes PR6255.

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

14 years agoAdd const qualifiers.
Dan Gohman [Mon, 8 Feb 2010 22:00:06 +0000 (22:00 +0000)]
Add const qualifiers.

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

14 years agoApply the 95471 fix to SelectionDAGBuilder as well;
Dale Johannesen [Mon, 8 Feb 2010 21:53:27 +0000 (21:53 +0000)]
Apply the 95471 fix to SelectionDAGBuilder as well;
we can get in here if FastISel gives up in a block.
(Actually the two copies of this need to be unified.  Later.)

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

14 years agoIn guaranteed tailcall mode, don't decline the tailcall optimization
Dan Gohman [Mon, 8 Feb 2010 20:34:14 +0000 (20:34 +0000)]
In guaranteed tailcall mode, don't decline the tailcall optimization
for blocks ending in "unreachable".

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

14 years agoRename the PerformTailCallOpt variable to GuaranteedTailCallOpt to reflect
Dan Gohman [Mon, 8 Feb 2010 20:27:50 +0000 (20:27 +0000)]
Rename the PerformTailCallOpt variable to GuaranteedTailCallOpt to reflect
its current purpose.

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

14 years agoAdd VCMP (VFP floating-point compare without 'E' bit set) for disassembly purpose.
Johnny Chen [Mon, 8 Feb 2010 19:41:48 +0000 (19:41 +0000)]
Add VCMP (VFP floating-point compare without 'E' bit set) for disassembly purpose.

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

14 years agoadd scaffolding for target-specific MCExprs.
Chris Lattner [Mon, 8 Feb 2010 19:41:07 +0000 (19:41 +0000)]
add scaffolding for target-specific MCExprs.

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

14 years agoFlesh out the list of predicates, for those who like this style. I was
Duncan Sands [Mon, 8 Feb 2010 19:36:51 +0000 (19:36 +0000)]
Flesh out the list of predicates, for those who like this style.  I was
looking for isPointer, and added the rest for uniformity.

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

14 years agoImmutableIntervalMap: Fix for unqualified lookup into dependent base class, done
Daniel Dunbar [Mon, 8 Feb 2010 18:08:46 +0000 (18:08 +0000)]
ImmutableIntervalMap: Fix for unqualified lookup into dependent base class, done
by clang's -fixit! :)

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

14 years agoAdded VMOVRRS/VMOVSRR to ARMInstrVFP.td for disassembly purpose.
Johnny Chen [Mon, 8 Feb 2010 17:26:09 +0000 (17:26 +0000)]
Added VMOVRRS/VMOVSRR to ARMInstrVFP.td for disassembly purpose.

A8.6.331 VMOV (between two ARM core registers and two single-precision registers)

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

14 years agoFix some typos.
Duncan Sands [Mon, 8 Feb 2010 11:03:31 +0000 (11:03 +0000)]
Fix some typos.

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

14 years agoFix x86 JIT stub on MSVC.
Torok Edwin [Mon, 8 Feb 2010 08:37:27 +0000 (08:37 +0000)]
Fix x86 JIT stub on MSVC.
Thanks to Kristaps Straupe for noticing the bug.

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

14 years agoFixed build error for redefinition.
Sanjiv Gupta [Mon, 8 Feb 2010 06:08:32 +0000 (06:08 +0000)]
Fixed build error for redefinition.

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

14 years agoAdd uppercase and lowercase part defines in driver.
Sanjiv Gupta [Mon, 8 Feb 2010 05:56:37 +0000 (05:56 +0000)]
Add uppercase and lowercase part defines in driver.
Use a temp dir with a unique name in the current dir itself.
Use forward_value instead of unpack_values.

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

14 years agoMake the destructor for TypeMapBase protected. Spotted by Duncan Sands with
Nick Lewycky [Sun, 7 Feb 2010 21:13:46 +0000 (21:13 +0000)]
Make the destructor for TypeMapBase protected. Spotted by Duncan Sands with
cppcheck!

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

14 years agoGive DwarfPrinter a protected (but not virtual) destructor. Cppcheck
Duncan Sands [Sun, 7 Feb 2010 21:09:22 +0000 (21:09 +0000)]
Give DwarfPrinter a protected (but not virtual) destructor.  Cppcheck
warns about this base class not having a virtual destructor, but since
this class has no virtual methods and neither it or the types derived
from it has a destructor, a protected trivial destructor will do (and
shuts cppcheck up) the trick without the cost of introducing a vtable.

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

14 years agoAdd suport for VASTART on Mips.
Bruno Cardoso Lopes [Sat, 6 Feb 2010 21:00:02 +0000 (21:00 +0000)]
Add suport for VASTART on Mips.

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

14 years agoFirst step towards varargs support in Mips:
Bruno Cardoso Lopes [Sat, 6 Feb 2010 19:20:49 +0000 (19:20 +0000)]
First step towards varargs support in Mips:
- o32 cc must pass all arguments in A0...A3 and stack regardless
if its type (but respect the alignment).
- Store all variable arguments back to the caller stack.

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

14 years agoRun codegen dce pass for all targets at all optimization levels. Previously it's
Evan Cheng [Sat, 6 Feb 2010 09:07:11 +0000 (09:07 +0000)]
Run codegen dce pass for all targets at all optimization levels. Previously it's
only run for x86 with fastisel. I've found it being very effective in
eliminating some obvious dead code as result of formal parameter lowering
especially when tail call optimization eliminated the need for some of the loads
from fixed frame objects. It also shrinks a number of the tests. A couple of
tests no longer make sense and are now eliminated.

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

14 years agoRemove a large test case that (soon will) no longer make sense.
Evan Cheng [Sat, 6 Feb 2010 09:00:30 +0000 (09:00 +0000)]
Remove a large test case that (soon will) no longer make sense.

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

14 years agoFix an uninitialized value. Radar 7609421.
Bob Wilson [Sat, 6 Feb 2010 05:55:20 +0000 (05:55 +0000)]
Fix an uninitialized value.  Radar 7609421.

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

14 years agoFix alignment on ppc linux. This fixes the build of crtend.o
Rafael Espindola [Sat, 6 Feb 2010 03:32:21 +0000 (03:32 +0000)]
Fix alignment on ppc linux. This fixes the build of crtend.o

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

14 years agoDo not emit callseq instructions around sibcalls. This eliminated some unnecessary...
Evan Cheng [Sat, 6 Feb 2010 03:28:46 +0000 (03:28 +0000)]
Do not emit callseq instructions around sibcalls. This eliminated some unnecessary stack adjustments.

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

14 years agoAdd a Debug bit to MachineOperand, for uses that
Dale Johannesen [Sat, 6 Feb 2010 02:28:32 +0000 (02:28 +0000)]
Add a Debug bit to MachineOperand, for uses that
are from debug info.  Add an iterator to MachineRegisterInfo
to skip Debug operands when walking the use list.  No
functional change yet.

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

14 years agoAfter Victor's latest commits I am seeing null
Dale Johannesen [Sat, 6 Feb 2010 02:26:02 +0000 (02:26 +0000)]
After Victor's latest commits I am seeing null
addresses in dbg.declare; ignore this for the
moment to prevent things from breaking.

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

14 years agoLinker should not remap null operands of metadata
Victor Hernandez [Sat, 6 Feb 2010 01:31:55 +0000 (01:31 +0000)]
Linker should not remap null operands of metadata

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

14 years agoFunction-local metadata whose operands had been optimized to no longer refer to funct...
Victor Hernandez [Sat, 6 Feb 2010 01:21:09 +0000 (01:21 +0000)]
Function-local metadata whose operands had been optimized to no longer refer to function-local IR were not getting written by BitcodeWriter; solution is for these metadata to be enumerated just like global metadata.

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

14 years agoReintroduce the InlineHint function attribute.
Jakob Stoklund Olesen [Sat, 6 Feb 2010 01:16:28 +0000 (01:16 +0000)]
Reintroduce the InlineHint function attribute.

This time it's for real! I am going to hook this up in the frontends as well.

The inliner has some experimental heuristics for dealing with the inline hint.
When given a -respect-inlinehint option, functions marked with the inline
keyword are given a threshold just above the default for -O3.

We need some experiments to determine if that is the right thing to do.

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

14 years agoAdd a test for my change to disable reassociation for i1 types.
Bob Wilson [Sat, 6 Feb 2010 01:16:25 +0000 (01:16 +0000)]
Add a test for my change to disable reassociation for i1 types.

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

14 years agoSet DW_AT_artificial only if argument is marked as artificial.
Devang Patel [Sat, 6 Feb 2010 01:02:37 +0000 (01:02 +0000)]
Set DW_AT_artificial only if argument is marked as artificial.

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

14 years agoHandle AddrMode6 (for NEON load/stores) in Thumb2's rewriteT2FrameIndex.
Bob Wilson [Sat, 6 Feb 2010 00:24:38 +0000 (00:24 +0000)]
Handle AddrMode6 (for NEON load/stores) in Thumb2's rewriteT2FrameIndex.
Radar 7614112.

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

14 years agoDon't unroll loops containing function calls.
Jakob Stoklund Olesen [Fri, 5 Feb 2010 23:21:31 +0000 (23:21 +0000)]
Don't unroll loops containing function calls.

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

14 years agoUpdate CodeMetrics to count 'big' function calls explicitly.
Jakob Stoklund Olesen [Fri, 5 Feb 2010 23:21:18 +0000 (23:21 +0000)]
Update CodeMetrics to count 'big' function calls explicitly.

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

14 years agoDo not generate specification DIE for nested functions.
Devang Patel [Fri, 5 Feb 2010 23:09:20 +0000 (23:09 +0000)]
Do not generate specification DIE for nested functions.

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

14 years agofix incorrect encoding of SBB8mi that Kevin noticed.
Chris Lattner [Fri, 5 Feb 2010 22:56:11 +0000 (22:56 +0000)]
fix incorrect encoding of SBB8mi that Kevin noticed.

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

14 years agofix a case where we'd mis-encode fisttp because of an incorrect (and
Chris Lattner [Fri, 5 Feb 2010 22:49:06 +0000 (22:49 +0000)]
fix a case where we'd mis-encode fisttp because of an incorrect (and
redundant with a correct one) pattern that was added for the disassembler.

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

14 years agoadd note.
Chris Lattner [Fri, 5 Feb 2010 22:48:33 +0000 (22:48 +0000)]
add note.

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

14 years agoremove fixme
Chris Lattner [Fri, 5 Feb 2010 22:46:46 +0000 (22:46 +0000)]
remove fixme

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

14 years agoprint encodings like this:
Chris Lattner [Fri, 5 Feb 2010 22:20:08 +0000 (22:20 +0000)]
print encodings like this:
pslld 69, %mm3                ## encoding: [0x0f,0xf2,0x1c,0x25,0x45,0x00,0x00,0x00]

instead of like this:
pslld 69, %mm3                ## encoding: [0x0f,0xf2,0x1c,0x25,0x45,0000,0000,0000]

this only affects 0.

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

14 years agoport X86InstrInfo::determineREX over to the new encoder.
Chris Lattner [Fri, 5 Feb 2010 22:10:22 +0000 (22:10 +0000)]
port X86InstrInfo::determineREX over to the new encoder.

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

14 years agoTeach SimplifyCFG about magic pointer constants.
Jakob Stoklund Olesen [Fri, 5 Feb 2010 22:03:18 +0000 (22:03 +0000)]
Teach SimplifyCFG about magic pointer constants.

Weird code sometimes uses pointer constants other than null. This patch
teaches SimplifyCFG to build switch instructions in those cases.

Code like this:

void f(const char *x) {
  if (!x)
    puts("null");
  else if ((uintptr_t)x == 1)
    puts("one");
  else if (x == (char*)2 || x == (char*)3)
    puts("two");
  else if ((intptr_t)x == 4)
    puts("four");
  else
    puts(x);
}

Now becomes a switch:

define void @f(i8* %x) nounwind ssp {
entry:
  %magicptr23 = ptrtoint i8* %x to i64            ; <i64> [#uses=1]
  switch i64 %magicptr23, label %if.else16 [
    i64 0, label %if.then
    i64 1, label %if.then2
    i64 2, label %if.then9
    i64 3, label %if.then9
    i64 4, label %if.then14
  ]

Note that LLVM's own DenseMap uses magic pointers.

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

14 years agowire up 64-bit MCCodeEmitter.
Chris Lattner [Fri, 5 Feb 2010 21:51:35 +0000 (21:51 +0000)]
wire up 64-bit MCCodeEmitter.

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

14 years agoreally kill off the last MRMInitReg inst, remove logic from encoder.
Chris Lattner [Fri, 5 Feb 2010 21:34:18 +0000 (21:34 +0000)]
really kill off the last MRMInitReg inst, remove logic from encoder.

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

14 years agolower the last of the MRMInitReg instructions in MCInstLower.
Chris Lattner [Fri, 5 Feb 2010 21:30:49 +0000 (21:30 +0000)]
lower the last of the MRMInitReg instructions in MCInstLower.

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

14 years agoteach X86MCInstLower to lower the MOV32r0 and MOV8r0
Chris Lattner [Fri, 5 Feb 2010 21:21:06 +0000 (21:21 +0000)]
teach X86MCInstLower to lower the MOV32r0 and MOV8r0
pseudo instructions.

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

14 years agogenericize helpers, use them for MOV16r0/MOV64r0
Chris Lattner [Fri, 5 Feb 2010 21:15:57 +0000 (21:15 +0000)]
genericize helpers, use them for MOV16r0/MOV64r0

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

14 years agofactor code better in X86MCInstLower::Lower, teach it to
Chris Lattner [Fri, 5 Feb 2010 21:13:48 +0000 (21:13 +0000)]
factor code better in X86MCInstLower::Lower, teach it to
lower the SETB* instructions.

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

14 years agofix logical-select to invoke filecheck right, and fix hte instcombine
Chris Lattner [Fri, 5 Feb 2010 19:53:02 +0000 (19:53 +0000)]
fix logical-select to invoke filecheck right, and fix hte instcombine
xform it is checking to actually pass.  There is no need to match
m_SelectCst<0, -1> since instcombine canonicalizes that into not(sext).

Add matches for sext(not(x)) in addition to not(sext(x)).

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

14 years agoimplement the rest of the encoding types.
Chris Lattner [Fri, 5 Feb 2010 19:37:31 +0000 (19:37 +0000)]
implement the rest of the encoding types.

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

14 years agomove functions for decoding X86II values into the X86II namespace.
Chris Lattner [Fri, 5 Feb 2010 19:24:13 +0000 (19:24 +0000)]
move functions for decoding X86II values into the X86II namespace.

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

14 years agoImplement releaseMemory in CodeGenPrepare and free the BackEdges
Dan Gohman [Fri, 5 Feb 2010 19:24:11 +0000 (19:24 +0000)]
Implement releaseMemory in CodeGenPrepare and free the BackEdges
container data. This prevents it from holding onto dangling
pointers and potentially behaving unpredictably.

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

14 years agoconstant propagate a method away.
Chris Lattner [Fri, 5 Feb 2010 19:20:30 +0000 (19:20 +0000)]
constant propagate a method away.

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

14 years agoUse a SmallSetVector instead of a SetVector; this code showed up as a
Dan Gohman [Fri, 5 Feb 2010 19:20:15 +0000 (19:20 +0000)]
Use a SmallSetVector instead of a SetVector; this code showed up as a
malloc caller in a profile.

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

14 years agochange getSizeOfImm and getBaseOpcodeFor to just take
Chris Lattner [Fri, 5 Feb 2010 19:16:26 +0000 (19:16 +0000)]
change getSizeOfImm and getBaseOpcodeFor to just take
TSFlags directly instead of a TargetInstrDesc.

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

14 years agoadd some more encodings.
Chris Lattner [Fri, 5 Feb 2010 19:04:37 +0000 (19:04 +0000)]
add some more encodings.

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

14 years agoRemove this code for now. I have a better idea and will rewrite with
Eric Christopher [Fri, 5 Feb 2010 19:04:06 +0000 (19:04 +0000)]
Remove this code for now. I have a better idea and will rewrite with
that in mind.

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

14 years agoMake lit's gtest support honor config.environment.
Jeffrey Yasskin [Fri, 5 Feb 2010 18:09:19 +0000 (18:09 +0000)]
Make lit's gtest support honor config.environment.

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

14 years agoVMOVRRD and VMOVDRR both have Inst{7-6} = 0b00.
Johnny Chen [Fri, 5 Feb 2010 18:04:58 +0000 (18:04 +0000)]
VMOVRRD and VMOVDRR both have Inst{7-6} = 0b00.

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

14 years agoMove --march, --mcpu, and --mattr from JIT/TargetSelect.cpp to lli.cpp.
Jeffrey Yasskin [Fri, 5 Feb 2010 16:19:36 +0000 (16:19 +0000)]
Move --march, --mcpu, and --mattr from JIT/TargetSelect.cpp to lli.cpp.
llc.cpp also defined these flags, meaning that when I linked all of LLVM's
libraries into a single shared library, llc crashed on startup with duplicate
flag definitions.  This patch passes them through the EngineBuilder into
JIT::selectTarget().

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

14 years agoMake test more fucused eliminating extraneous bits.
Bill Wendling [Fri, 5 Feb 2010 11:21:05 +0000 (11:21 +0000)]
Make test more fucused eliminating extraneous bits.

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

14 years agoMC: Change default comment column to 40 characters.
Daniel Dunbar [Fri, 5 Feb 2010 07:32:18 +0000 (07:32 +0000)]
MC: Change default comment column to 40 characters.

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

14 years agoFix test.
Evan Cheng [Fri, 5 Feb 2010 06:37:00 +0000 (06:37 +0000)]
Fix test.

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

14 years agoimplement the non-relocation forms of memory operands
Chris Lattner [Fri, 5 Feb 2010 06:16:07 +0000 (06:16 +0000)]
implement the non-relocation forms of memory operands

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

14 years agoHandle tail call with byval arguments.
Evan Cheng [Fri, 5 Feb 2010 02:21:12 +0000 (02:21 +0000)]
Handle tail call with byval arguments.

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

14 years agostart adding MRMDestMem, which requires memory form mod/rm encoding
Chris Lattner [Fri, 5 Feb 2010 02:18:40 +0000 (02:18 +0000)]
start adding MRMDestMem, which requires memory form mod/rm encoding
to start limping.

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

14 years agoAdd a few more encodings, we can now encode all of:
Chris Lattner [Fri, 5 Feb 2010 01:53:19 +0000 (01:53 +0000)]
Add a few more encodings, we can now encode all of:

pushl %ebp
movl %esp, %ebp
movl $42, %eax
popl %ebp
ret

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

14 years agoWhen the scheduler unfold a load folding instruction it move some of the predecessors...
Evan Cheng [Fri, 5 Feb 2010 01:27:11 +0000 (01:27 +0000)]
When the scheduler unfold a load folding instruction it move some of the predecessors to the unfolded load. It decides what gets moved to the load by checking whether the new load is using the predecessor as an operand. The check neglects the cases whether the predecessor is a flagged scheduling unit.
rdar://7604000

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

14 years agoAn empty global constant (one of size 0) may have a section immediately
Bill Wendling [Fri, 5 Feb 2010 00:17:02 +0000 (00:17 +0000)]
An empty global constant (one of size 0) may have a section immediately
following it. However, the EmitGlobalConstant method wasn't emitting a body for
the constant. The assembler doesn't like that. Before, we were generating this:

  .zerofill __DATA, __common, __cmd, 1, 3

This fix puts us back to that semantic.

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

14 years agoDo not reassociate expressions with i1 type. SimplifyCFG converts some
Bob Wilson [Thu, 4 Feb 2010 23:32:37 +0000 (23:32 +0000)]
Do not reassociate expressions with i1 type.  SimplifyCFG converts some
short-circuited conditions to AND/OR expressions, and those expressions
are often converted back to a short-circuited form in code gen.  The
original source order may have been optimized to take advantage of the
expected values, and if we reassociate them, we change the order and
subvert that optimization.  Radar 7497329.

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

14 years agoDisable external stubs for X86-32 and X86-64
Evan Phoenix [Thu, 4 Feb 2010 19:56:59 +0000 (19:56 +0000)]
Disable external stubs for X86-32 and X86-64

Instruction selection for X86 now can choose an instruction
sequence that will fit any address of any symbol, no matter
the pointer width. X86-64 uses a mov+call-via-reg sequence
for this.

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

14 years agoFix typo Duncan noticed.
Evan Cheng [Thu, 4 Feb 2010 19:07:06 +0000 (19:07 +0000)]
Fix typo Duncan noticed.

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

14 years agoIncrease inliner thresholds by 25.
Jakob Stoklund Olesen [Thu, 4 Feb 2010 18:48:20 +0000 (18:48 +0000)]
Increase inliner thresholds by 25.

This makes the inliner about as agressive as it was before my changes to the
inliner cost calculations. These levels give the same performance and slightly
smaller code than before.

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

14 years agoFix small bug in handling instructions with more than one implicitly defined operand.
Jakob Stoklund Olesen [Thu, 4 Feb 2010 18:46:28 +0000 (18:46 +0000)]
Fix small bug in handling instructions with more than one implicitly defined operand.

ProcessImplicitDefs would only mark one operand per instruction with <undef>.
This fixed PR6086.

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

14 years agoGet the LLVMC tests working with clang++ by removing the problematic CXXFLAG in lit.
Benjamin Kramer [Thu, 4 Feb 2010 18:40:11 +0000 (18:40 +0000)]
Get the LLVMC tests working with clang++ by removing the problematic CXXFLAG in lit.

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

14 years agoApply property changes from PR6228.
Benjamin Kramer [Thu, 4 Feb 2010 11:57:54 +0000 (11:57 +0000)]
Apply property changes from PR6228.

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

14 years agoNew flag for GenLibDeps, and llvm-config-perobjincl.
Torok Edwin [Thu, 4 Feb 2010 09:31:35 +0000 (09:31 +0000)]
New flag for GenLibDeps, and llvm-config-perobjincl.

This allows to show the explicit files that need to be built/linked to get an
LLVM component.

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

14 years agomove the PR6214 microoptzn to this file.
Chris Lattner [Thu, 4 Feb 2010 07:32:01 +0000 (07:32 +0000)]
move the PR6214 microoptzn to this file.

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

14 years agofix a broken archive that was breaking dejagnu only (not lit)
Chris Lattner [Thu, 4 Feb 2010 07:11:08 +0000 (07:11 +0000)]
fix a broken archive that was breaking dejagnu only (not lit)
after r95292

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

14 years agoRe-enable x86 tail call optimization.
Evan Cheng [Thu, 4 Feb 2010 06:47:24 +0000 (06:47 +0000)]
Re-enable x86 tail call optimization.

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

14 years agoTemporarily revert this since it appears to have caused a build
Eric Christopher [Thu, 4 Feb 2010 06:41:27 +0000 (06:41 +0000)]
Temporarily revert this since it appears to have caused a build
failure.

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

14 years agoadd support for the sparcv9-*-* target triple to turn on
Chris Lattner [Thu, 4 Feb 2010 06:34:01 +0000 (06:34 +0000)]
add support for the sparcv9-*-* target triple to turn on
64-bit sparc codegen.  Patch by Nathan Keynes!

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

14 years agoFrom PR6228:
Chris Lattner [Thu, 4 Feb 2010 06:19:43 +0000 (06:19 +0000)]
From PR6228:

"Attached patch removes the extra NUL bytes from the output and changes
test/Archive/MacOSX.toc from a binary to a text file (removes
svn:mime-type=application/octet-stream and adds svn:eol-style=native).  I can't
figure out how to get SVN to include the new contents of the file in the patch
so I'm attaching it separately."

Patch by James Abbatiello!

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

14 years agoRework constant expr and array handling for objectsize instcombining.
Eric Christopher [Thu, 4 Feb 2010 02:55:34 +0000 (02:55 +0000)]
Rework constant expr and array handling for objectsize instcombining.

Fix bugs where we would compute out of bounds as in bounds, and where
we couldn't know that the linker could override the size of an array.

Add a few new testcases, change existing testcase to use a private
global array instead of extern.

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

14 years agoIt's too risky to eliminate sext / zext of call results for tail call optimization...
Evan Cheng [Thu, 4 Feb 2010 02:45:02 +0000 (02:45 +0000)]
It's too risky to eliminate sext / zext of call results for tail call optimization even if the caller / callee attributes completely match. The callee may have been bitcast'ed (or otherwise lied about what it's doing).

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

14 years agoChange the argument to getIntegerSCEV to be an int64_t, rather
Dan Gohman [Thu, 4 Feb 2010 02:43:51 +0000 (02:43 +0000)]
Change the argument to getIntegerSCEV to be an int64_t, rather
than int. This will make it more convenient for LSR, which does
a lot of things with int64_t offsets.

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

14 years agoIndirect tail call has to go through a call preserved register since it's after calle...
Evan Cheng [Thu, 4 Feb 2010 02:40:39 +0000 (02:40 +0000)]
Indirect tail call has to go through a call preserved register since it's after callee register pops. X86 isel lowering is using EAX / R11 and it was somehow adding that to function live out. That prevented the real function return register from being added to the function live out list and bad things happen.
This fixes 483.xalancbmk (with tail call opt).

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

14 years agoFilled in a few new APIs for the enhanced
Sean Callanan [Thu, 4 Feb 2010 01:43:08 +0000 (01:43 +0000)]
Filled in a few new APIs for the enhanced
disassembly library that provide access to
instruction information, and fixed ambiguous
wording in the comments for the header.

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

14 years agoUse a tab instead of space after .type, for consistency.
Dan Gohman [Thu, 4 Feb 2010 01:42:13 +0000 (01:42 +0000)]
Use a tab instead of space after .type, for consistency.

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

14 years agoRewrite FP constant handling in DEBUG_VALUE yet
Dale Johannesen [Thu, 4 Feb 2010 01:33:43 +0000 (01:33 +0000)]
Rewrite FP constant handling in DEBUG_VALUE yet
again, so it more or less handles long double.
Restore \n removed in latest MC frenzy.

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

14 years agoFix (and test) function-local metadata that occurs before the instruction that it...
Victor Hernandez [Thu, 4 Feb 2010 01:13:08 +0000 (01:13 +0000)]
Fix (and test) function-local metadata that occurs before the instruction that it refers to; fix is to not enumerate operands of function-local metadata until after all instructions have been enumerated

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

14 years agoIf we're dealing with a zero-length array, don't lower to any
Eric Christopher [Wed, 3 Feb 2010 23:56:07 +0000 (23:56 +0000)]
If we're dealing with a zero-length array, don't lower to any
particular size, we just don't know what the length is yet.

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

14 years agoThis test passes now on ppc darwin; if it doesn't pass
Dale Johannesen [Wed, 3 Feb 2010 22:33:17 +0000 (22:33 +0000)]
This test passes now on ppc darwin; if it doesn't pass
on some other ppc say something on the list.

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

14 years agoThis test passes now on ppc darwin, so reenable it.
Dale Johannesen [Wed, 3 Feb 2010 22:29:02 +0000 (22:29 +0000)]
This test passes now on ppc darwin, so reenable it.

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

14 years agoDebugging is now reenabled on PPC darwin, so reenable
Dale Johannesen [Wed, 3 Feb 2010 22:24:49 +0000 (22:24 +0000)]
Debugging is now reenabled on PPC darwin, so reenable
these tests (they pass).

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

14 years agoenhance new encoder to support prefixes + RawFrm
Chris Lattner [Wed, 3 Feb 2010 21:57:59 +0000 (21:57 +0000)]
enhance new encoder to support prefixes + RawFrm
instructions with no operands.  It can now handle

define void @test2() nounwind { ret void }

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

14 years agoset up some infrastructure, some minor cleanups.
Chris Lattner [Wed, 3 Feb 2010 21:43:43 +0000 (21:43 +0000)]
set up some infrastructure, some minor cleanups.

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