Commit Graph

57030 Commits

Author SHA1 Message Date
Chris Lattner 4660c225a2 make target independent.
llvm-svn: 95655
2010-02-09 06:36:30 +00:00
Chris Lattner 933509287b merge a target-specific add test into x86 directory.
llvm-svn: 95654
2010-02-09 06:35:50 +00:00
Chris Lattner 015ecd85d4 merge another test in, drop the trivially constant folded cases.
llvm-svn: 95653
2010-02-09 06:33:27 +00:00
Chris Lattner c77b9eb31c consolidate and filecheckize two tests.
llvm-svn: 95652
2010-02-09 06:24:00 +00:00
Chris Lattner 534e1667a0 merge two tests, make target independent.
llvm-svn: 95651
2010-02-09 06:19:20 +00:00
Chris Lattner f5f335da37 move PR3462 to here.
llvm-svn: 95650
2010-02-09 05:55:14 +00:00
Chris Lattner cf11e602a2 add a note from PR6194
llvm-svn: 95649
2010-02-09 05:45:29 +00:00
Dale Johannesen c3adf44885 Skip DEBUG_VALUE in some places where it was affecting codegen.
llvm-svn: 95647
2010-02-09 02:01:46 +00:00
Devang Patel ce25dd74c0 Add declaration attribute to a variable DIE, if there is a separate DIE for the definition.
llvm-svn: 95646
2010-02-09 01:58:33 +00:00
Sean Callanan e7a1b988bf Updated the enhanced disassembly library to produce
whitespace tokens in the right places.

llvm-svn: 95645
2010-02-09 01:50:54 +00:00
Chris Lattner fd8a55167f fix llvm_build_struct_gep for PR6167, patch by
Peter Hawkins!

llvm-svn: 95644
2010-02-09 01:39:46 +00:00
Chris Lattner f4c8d3cea9 simplify this code, duh.
llvm-svn: 95643
2010-02-09 01:14:06 +00:00
Chris Lattner 9b6a1789e5 fix PR6193, only considering sign extensions *from i1* for this
xform.

llvm-svn: 95642
2010-02-09 01:12:41 +00:00
Eric Christopher be2f0b2b7b Add file in here too.
llvm-svn: 95641
2010-02-09 01:11:03 +00:00
Sean Callanan 12f1a3ec0c Fixed a problem where the enhanced disassembly
library was reporting inaccurate token IDs.

llvm-svn: 95639
2010-02-09 01:00:18 +00:00
Chris Lattner 89261502cb make -show-inst be formatted a bit nicer. Before:
movl	$3735928559, a          ## inst: <MCInst 1273 <MCOperand Reg:0> <MCOperand Imm:1> <MCOperand Reg:0> <MCOperand Expr:(a)> <MCOperand Reg:0> <MCOperand Expr:(3735928559)>>

after:

	movl	$3735928559, a          ## <MCInst #1273
                                        ##   <MCOperand Reg:0>
                                        ##   <MCOperand Imm:1>
                                        ##   <MCOperand Reg:0>
                                        ##   <MCOperand Expr:(a)>
                                        ##   <MCOperand Reg:0>
                                        ##   <MCOperand Expr:(3735928559)>>

llvm-svn: 95637
2010-02-09 00:54:51 +00:00
Lang Hames 48121948dc Fixed a bug in the PBQP allocator's findCoalesces method.
Previously spill registers, whose def indexes are not defined, would sometimes be improperly marked as coalescable with conflicting registers. The new findCoalesces routine conservatively assumes that any register with at least one undefined def is not coalescable with any register it interferes with.

llvm-svn: 95636
2010-02-09 00:50:27 +00:00
Chris Lattner d00faaa9c7 Implement x86 asm parsing support for %st and %st(4)
llvm-svn: 95634
2010-02-09 00:49:22 +00:00
Lang Hames 7b1e683975 Added copy sensible construction & assignment to PBQP graphs and fixed a memory access bug in the heuristic solver.
llvm-svn: 95633
2010-02-09 00:45:48 +00:00
Dale Johannesen ce33776994 Debug operands should not be def or kill.
llvm-svn: 95632
2010-02-09 00:42:08 +00:00
Lang Hames 4695741312 Changed the definition of an "invalid" slot to include the empty & tombstone values, but not zero.
llvm-svn: 95631
2010-02-09 00:41:23 +00:00
Chris Lattner 928480ec18 stop using reserved identifiers.
llvm-svn: 95630
2010-02-09 00:40:07 +00:00
Eric Christopher 9f85e7eb16 Add a new pass to do llvm.objsize lowering using SCEV.
Initial skeleton and SCEVUnknown lowering implemented,
the rest should come relatively quickly.  Move testcase
to new directory.

Move pass to right before SimplifyLibCalls - which is
moved down a bit so we can take advantage of a few opts.

llvm-svn: 95628
2010-02-09 00:35:38 +00:00
Chris Lattner 60db0a6ba5 pass stringref by value instead of by const&
llvm-svn: 95627
2010-02-09 00:34:28 +00:00
Dan Gohman cc066d6e66 Add explicit keywords.
llvm-svn: 95626
2010-02-09 00:29:29 +00:00
Chris Lattner 187242b3ab move PR6212 to this file.
llvm-svn: 95624
2010-02-09 00:11:10 +00:00
Chris Lattner a460edca79 enhance bits_storage to work with enums by using a c-style
cast instead of reinterpret_cast, fixing PR6243.  Apparently
reinterpret_cast and I aren't getting along today.

llvm-svn: 95622
2010-02-09 00:05:45 +00:00
Dan Gohman 227077d1be Implement AsmPrinter support for several more operators which have
direct MCExpr equivalents. Don't use MCExpr::Shr because it isn't
consistent between targets.

llvm-svn: 95620
2010-02-09 00:02:37 +00:00
Dan Gohman 9a9d9ea7bc Document that MCExpr::Mod is actually remainder.
Document that MCExpr::Div, Mod, and the comparison operators are all
signed operators.

Document that the comparison operators' results are target-dependent.

Document that the behavior of shr is target-dependent.

llvm-svn: 95619
2010-02-08 23:58:47 +00:00
Chris Lattner b22423c89a fix some problems handling large vectors reported in PR6230
llvm-svn: 95616
2010-02-08 23:56:03 +00:00
Chris Lattner 08297ad15d this is done, tested by CodeGen/ARM/iabs.ll
llvm-svn: 95609
2010-02-08 23:48:10 +00:00
Chris Lattner ae67ca33ed convert to filecheck.
llvm-svn: 95608
2010-02-08 23:47:34 +00:00
Sean Callanan cb956d93b8 Added header file declarations and .exports entries
for the new APIs offered by the enhanced disassembler
for inspecting operands.

llvm-svn: 95606
2010-02-08 23:34:25 +00:00
Devang Patel 557e4248cb test case for r95604.
llvm-svn: 95605
2010-02-08 23:27:46 +00:00
Jim Grosbach a570d05228 tighten up eh.setjmp sequence a bit.
llvm-svn: 95603
2010-02-08 23:22:00 +00:00
Chris Lattner ebc970e4eb now that @GOTOFF is no longer represented as a suffix on a
MCSymbol, we can remove the 'suffix' argument of 
GetBlockAddressSymbol.  Do so.

llvm-svn: 95601
2010-02-08 23:10:08 +00:00
Chris Lattner d9d7186dc0 unify the paths for external symbols and global variables:
2 files changed, 48 insertions(+), 83 deletions(-)

llvm-svn: 95599
2010-02-08 23:03:41 +00:00
Chris Lattner 99777dd78f switch the rest of the "@ concatentation" logic in the X86
backend to use X86MCTargetExpr, simplifying a bunch of code.

llvm-svn: 95595
2010-02-08 22:52:47 +00:00
Sean Callanan 4d16049c61 Fixed the AT&T AsmLexer to report the proper strings
for register tokens.  Before, if it encountered
'%al,' it would report 'al,' as the token.  Now it
correctly reports '%al'.

llvm-svn: 95594
2010-02-08 22:50:23 +00:00
Chris Lattner b8479fb309 switch ELF @GOTOFF references to use X86MCTargetExpr.
llvm-svn: 95593
2010-02-08 22:33:55 +00:00
Dan Gohman e51b57bee0 ConstantFoldConstantExpression can theoretically return the original
expression; don't go into an infinite loop if it does.

llvm-svn: 95591
2010-02-08 22:19:11 +00:00
Chris Lattner b6b2164e28 add an x86 implementation of MCTargetExpr for
representing @GOT and friends.  Use it for
personality references as a first use.

llvm-svn: 95588
2010-02-08 22:09:08 +00:00
Chris Lattner 54d88f1759 don't make hte dtor private or we can't construct the class.
llvm-svn: 95587
2010-02-08 22:07:36 +00:00
Chris Lattner cddc4c17b1 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).

llvm-svn: 95585
2010-02-08 22:05:38 +00:00
Johnny Chen 9e60686a83 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

llvm-svn: 95584
2010-02-08 22:02:41 +00:00
Dan Gohman 4268d6a7c3 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.

llvm-svn: 95583
2010-02-08 22:02:38 +00:00
Dan Gohman 6f9646e1c5 Add const qualifiers.
llvm-svn: 95582
2010-02-08 22:00:06 +00:00
Dale Johannesen 120cfe23a7 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.)

llvm-svn: 95579
2010-02-08 21:53:27 +00:00
Dan Gohman bd374da130 In guaranteed tailcall mode, don't decline the tailcall optimization
for blocks ending in "unreachable".

llvm-svn: 95565
2010-02-08 20:34:14 +00:00
Dan Gohman 3464a5b609 Rename the PerformTailCallOpt variable to GuaranteedTailCallOpt to reflect
its current purpose.

llvm-svn: 95564
2010-02-08 20:27:50 +00:00
Johnny Chen beb1238a85 Add VCMP (VFP floating-point compare without 'E' bit set) for disassembly purpose.
llvm-svn: 95560
2010-02-08 19:41:48 +00:00
Chris Lattner 38d022efe9 add scaffolding for target-specific MCExprs.
llvm-svn: 95559
2010-02-08 19:41:07 +00:00
Duncan Sands e77bebc4ba Flesh out the list of predicates, for those who like this style. I was
looking for isPointer, and added the rest for uniformity.

llvm-svn: 95557
2010-02-08 19:36:51 +00:00
Daniel Dunbar ff7e95878f ImmutableIntervalMap: Fix for unqualified lookup into dependent base class, done
by clang's -fixit! :)

llvm-svn: 95551
2010-02-08 18:08:46 +00:00
Johnny Chen c7e606f132 Added VMOVRRS/VMOVSRR to ARMInstrVFP.td for disassembly purpose.
A8.6.331 VMOV (between two ARM core registers and two single-precision registers)

llvm-svn: 95548
2010-02-08 17:26:09 +00:00
Duncan Sands 4583dfc651 Fix some typos.
llvm-svn: 95542
2010-02-08 11:03:31 +00:00
Torok Edwin 6e29e9d262 Fix x86 JIT stub on MSVC.
Thanks to Kristaps Straupe for noticing the bug.

llvm-svn: 95537
2010-02-08 08:37:27 +00:00
Sanjiv Gupta bb3f887a85 Fixed build error for redefinition.
llvm-svn: 95532
2010-02-08 06:08:32 +00:00
Sanjiv Gupta b67dc69a78 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.

llvm-svn: 95530
2010-02-08 05:56:37 +00:00
Nick Lewycky b1d5ead9fb Make the destructor for TypeMapBase protected. Spotted by Duncan Sands with
cppcheck!

llvm-svn: 95527
2010-02-07 21:13:46 +00:00
Duncan Sands a1b98ab7d5 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.

llvm-svn: 95526
2010-02-07 21:09:22 +00:00
Bruno Cardoso Lopes d59cddc098 Add suport for VASTART on Mips.
llvm-svn: 95506
2010-02-06 21:00:02 +00:00
Bruno Cardoso Lopes d6fff557db 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.

llvm-svn: 95500
2010-02-06 19:20:49 +00:00
Evan Cheng ea5c6be766 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.

llvm-svn: 95493
2010-02-06 09:07:11 +00:00
Evan Cheng c72f7882c0 Remove a large test case that (soon will) no longer make sense.
llvm-svn: 95492
2010-02-06 09:00:30 +00:00
Bob Wilson 182c53ee88 Fix an uninitialized value. Radar 7609421.
llvm-svn: 95488
2010-02-06 05:55:20 +00:00
Rafael Espindola 4536b9a904 Fix alignment on ppc linux. This fixes the build of crtend.o
llvm-svn: 95477
2010-02-06 03:32:21 +00:00
Evan Cheng d064aefefc Do not emit callseq instructions around sibcalls. This eliminated some unnecessary stack adjustments.
llvm-svn: 95475
2010-02-06 03:28:46 +00:00
Dale Johannesen 0a741b7258 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.

llvm-svn: 95473
2010-02-06 02:28:32 +00:00
Dale Johannesen db2eb47835 After Victor's latest commits I am seeing null
addresses in dbg.declare; ignore this for the
moment to prevent things from breaking.

llvm-svn: 95471
2010-02-06 02:26:02 +00:00
Victor Hernandez 827de51a4a Linker should not remap null operands of metadata
llvm-svn: 95468
2010-02-06 01:31:55 +00:00
Victor Hernandez 1b08138152 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.
llvm-svn: 95467
2010-02-06 01:21:09 +00:00
Jakob Stoklund Olesen 74bb06c0f0 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.

llvm-svn: 95466
2010-02-06 01:16:28 +00:00
Bob Wilson a10e65c852 Add a test for my change to disable reassociation for i1 types.
llvm-svn: 95465
2010-02-06 01:16:25 +00:00
Devang Patel 6efc8e5120 Set DW_AT_artificial only if argument is marked as artificial.
llvm-svn: 95461
2010-02-06 01:02:37 +00:00
Bob Wilson 5638c36efd Handle AddrMode6 (for NEON load/stores) in Thumb2's rewriteT2FrameIndex.
Radar 7614112.

llvm-svn: 95456
2010-02-06 00:24:38 +00:00
Jakob Stoklund Olesen 5f9ead2714 Don't unroll loops containing function calls.
llvm-svn: 95454
2010-02-05 23:21:31 +00:00
Jakob Stoklund Olesen b0b2297066 Update CodeMetrics to count 'big' function calls explicitly.
llvm-svn: 95453
2010-02-05 23:21:18 +00:00
Devang Patel d4be4ced76 Do not generate specification DIE for nested functions.
llvm-svn: 95452
2010-02-05 23:09:20 +00:00
Chris Lattner 9d624778a3 fix incorrect encoding of SBB8mi that Kevin noticed.
llvm-svn: 95448
2010-02-05 22:56:11 +00:00
Chris Lattner d91f302a05 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.

llvm-svn: 95446
2010-02-05 22:49:06 +00:00
Chris Lattner a60af09414 add note.
llvm-svn: 95445
2010-02-05 22:48:33 +00:00
Chris Lattner d2e879a012 remove fixme
llvm-svn: 95444
2010-02-05 22:46:46 +00:00
Chris Lattner 175629608e 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.

llvm-svn: 95441
2010-02-05 22:20:08 +00:00
Chris Lattner 58827ff98e port X86InstrInfo::determineREX over to the new encoder.
llvm-svn: 95440
2010-02-05 22:10:22 +00:00
Jakob Stoklund Olesen 916f48a054 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.

llvm-svn: 95439
2010-02-05 22:03:18 +00:00
Chris Lattner 9c9453e582 wire up 64-bit MCCodeEmitter.
llvm-svn: 95438
2010-02-05 21:51:35 +00:00
Chris Lattner 86bd194234 really kill off the last MRMInitReg inst, remove logic from encoder.
llvm-svn: 95437
2010-02-05 21:34:18 +00:00
Chris Lattner e96d534ce0 lower the last of the MRMInitReg instructions in MCInstLower.
llvm-svn: 95435
2010-02-05 21:30:49 +00:00
Chris Lattner 90916287ed teach X86MCInstLower to lower the MOV32r0 and MOV8r0
pseudo instructions.

llvm-svn: 95433
2010-02-05 21:21:06 +00:00
Chris Lattner fd7976a432 genericize helpers, use them for MOV16r0/MOV64r0
llvm-svn: 95432
2010-02-05 21:15:57 +00:00
Chris Lattner 340b542f8b factor code better in X86MCInstLower::Lower, teach it to
lower the SETB* instructions.

llvm-svn: 95431
2010-02-05 21:13:48 +00:00
Chris Lattner 64ffd11d49 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)).

llvm-svn: 95420
2010-02-05 19:53:02 +00:00
Chris Lattner 89f7dfff21 implement the rest of the encoding types.
llvm-svn: 95414
2010-02-05 19:37:31 +00:00
Chris Lattner 503243559a move functions for decoding X86II values into the X86II namespace.
llvm-svn: 95410
2010-02-05 19:24:13 +00:00
Dan Gohman 4739e41ce9 Implement releaseMemory in CodeGenPrepare and free the BackEdges
container data. This prevents it from holding onto dangling
pointers and potentially behaving unpredictably.

llvm-svn: 95409
2010-02-05 19:24:11 +00:00
Chris Lattner 342762fdba constant propagate a method away.
llvm-svn: 95408
2010-02-05 19:20:30 +00:00
Dan Gohman 8abb67df63 Use a SmallSetVector instead of a SetVector; this code showed up as a
malloc caller in a profile.

llvm-svn: 95407
2010-02-05 19:20:15 +00:00
Chris Lattner b8d375fd21 change getSizeOfImm and getBaseOpcodeFor to just take
TSFlags directly instead of a TargetInstrDesc.

llvm-svn: 95405
2010-02-05 19:16:26 +00:00
Chris Lattner 37166eb419 add some more encodings.
llvm-svn: 95403
2010-02-05 19:04:37 +00:00