Commit Graph

60871 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen 1181a19318 Lose the dummies
llvm-svn: 104564
2010-05-24 21:47:01 +00:00
Jakob Stoklund Olesen edab242488 Replace the tablegen RegisterClass field SubRegClassList with an alist-like data
structure that represents a mapping without any dependencies on SubRegIndex
numbering.

This brings us closer to being able to remove the explicit SubRegIndex
numbering, and it is now possible to specify any mapping without inventing
*_INVALID register classes.

llvm-svn: 104563
2010-05-24 21:46:58 +00:00
Evan Cheng 1b79babdec Avoid adding duplicate function live-in's.
llvm-svn: 104560
2010-05-24 21:33:37 +00:00
Dan Gohman 79b6a0f140 Fix an mmx movd encoding.
llvm-svn: 104552
2010-05-24 20:51:08 +00:00
Kevin Enderby dc71cc794b MC/X86: Add aliases for CMOVcc variants.
llvm-svn: 104549
2010-05-24 20:32:23 +00:00
Bob Wilson 722bff2c7d Clean up some extra whitespace.
llvm-svn: 104544
2010-05-24 20:08:34 +00:00
Bob Wilson 3eb7691858 Thumb2 RSBS instructions were being printed without the 'S' suffix.
Fix it by changing the T2I_rbin_s_is multiclass to handle the CPSR
output and 'S' suffix in the same way as T2I_bin_s_irs.

llvm-svn: 104531
2010-05-24 18:44:06 +00:00
Devang Patel 51b37e0bd8 Do not emit line number entries for unknown debug values.
This fixes recent regression in store.exp from gdb testsuite.

llvm-svn: 104524
2010-05-24 18:26:49 +00:00
Evan Cheng 755d45be43 LR is in GPR, not tGPR even in Thumb1 mode.
llvm-svn: 104518
2010-05-24 18:00:18 +00:00
Jakob Stoklund Olesen ff2d118733 Add SubRegIndex defs to PowerPC. It looks like the CR subregister indices are
never used.

llvm-svn: 104517
2010-05-24 17:55:38 +00:00
Jakob Stoklund Olesen 8a57aeca2a Use SubRegIndex in SystemZ.
Anton, please review the change to SystemZAsmPrinter.cpp. It could be a bug.

llvm-svn: 104515
2010-05-24 17:43:01 +00:00
Jakob Stoklund Olesen 5d56769fb6 SubRegIndex'ize Mips
llvm-svn: 104514
2010-05-24 17:42:58 +00:00
Jakob Stoklund Olesen fd6f16fab9 SubRegIndex'ize MSP430
llvm-svn: 104513
2010-05-24 17:42:55 +00:00
Jakob Stoklund Olesen 8d042c0269 Fix a few places that depended on the numeric value of subreg indices.
Add assertions in places that depend on consecutive indices.

llvm-svn: 104510
2010-05-24 17:13:28 +00:00
Jakob Stoklund Olesen 6c47d6423c Switch ARMRegisterInfo.td to use SubRegIndex and eliminate the parallel enums
from ARMRegisterInfo.h

llvm-svn: 104508
2010-05-24 16:54:32 +00:00
Jakob Stoklund Olesen 9340ea59e1 Rename X86 subregister indices to something shorter.
Use the tablegen-produced enums.

llvm-svn: 104493
2010-05-24 14:48:17 +00:00
Jakob Stoklund Olesen 1c69646e99 Add the SubRegIndex TableGen class.
This is the beginning of purely symbolic subregister indices, but we need a bit
of jiggling before the explicit numeric indices can be completely removed.

llvm-svn: 104492
2010-05-24 14:48:12 +00:00
Nicolas Geoffray c5327226e4 Encode the Caml frametable by following what the comment says: the number of descriptors
is first emitted, and StackOffsets are emitted in 16 bits.

llvm-svn: 104488
2010-05-24 12:24:11 +00:00
Duncan Sands e9cd6d069d Apply timeouts and memory limits in more places. In particular, when
bugpoint does "Running the code generator to test for a crash" this
gets you a crash if llc goes into an infinite loop or uses up vast
amounts of memory.

llvm-svn: 104485
2010-05-24 07:49:55 +00:00
Daniel Dunbar 6738a2e39e llvm-mc: Use EmitIntValue where possible, which makes the API calls from the AsmParser and CodeGen line up better.
llvm-svn: 104467
2010-05-23 18:36:38 +00:00
Daniel Dunbar 8271d1bb4a llvm-mc: Use AddBlankLine in asm parser. This makes transliteration match the input much more closely, and also makes the API calls from the AsmParser and CodeGen line up better.
llvm-svn: 104466
2010-05-23 18:36:34 +00:00
Daniel Dunbar 3ff1a06de6 MC: Add an MCLoggingStreamer, for use in debugging integrated-as mismatches.
llvm-svn: 104463
2010-05-23 17:44:06 +00:00
Bob Wilson 49f40e8c32 VDUP doesn't support vectors with 64-bit elements.
llvm-svn: 104455
2010-05-23 05:42:31 +00:00
Daniel Dunbar b52fcd6304 MC/X86: Subdivide immediates a bit more, so that we properly recognize immediates based on the width of the target instruction. For example:
addw $0xFFFF, %ax
should match the same as
  addw $-1, %ax
but we used to match it to the longer encoding.

llvm-svn: 104453
2010-05-22 21:02:33 +00:00
Daniel Dunbar 346782c12c tblgen/AsmMatcher: Change AsmOperandClass to allow a list of superclasses instead of just one.
llvm-svn: 104452
2010-05-22 21:02:29 +00:00
Daniel Dunbar d459e29a0a MC/X86: Add alias for setz, setnz, jz, jnz.
llvm-svn: 104435
2010-05-22 06:37:33 +00:00
John Mosby 987a1576d2 Trivial change to dump() function for SparseBitVector
llvm-svn: 104433
2010-05-22 05:13:17 +00:00
Evan Cheng 168ced94d8 Implement @llvm.returnaddress. rdar://8015977.
llvm-svn: 104421
2010-05-22 01:47:14 +00:00
Jim Grosbach bd9485db63 Implement eh.sjlj.longjmp for ARM. Clean up the intrinsic a bit.
Followups: docs patch for the builtin and eh.sjlj.setjmp cleanup to match
longjmp.

llvm-svn: 104419
2010-05-22 01:06:18 +00:00
Eric Christopher 64087cd346 This test is darwin only. Make it so(tm).
llvm-svn: 104418
2010-05-22 00:55:55 +00:00
Bob Wilson 91fdf68516 Recognize more BUILD_VECTORs and VECTOR_SHUFFLEs that can be implemented by
copying VFP subregs.  This exposed a bunch of dead code in the *spill-q.ll
tests, so I tweaked those tests to keep that code from being optimized away.
Radar 7872877.

llvm-svn: 104415
2010-05-22 00:23:12 +00:00
Eric Christopher 6fdea1bda8 Add full bss data support for darwin tls variables.
llvm-svn: 104414
2010-05-22 00:10:22 +00:00
Devang Patel 4a8e6e83dc Collect variable information during endFunction() instead of beginFunction().
llvm-svn: 104412
2010-05-22 00:04:14 +00:00
Eric Christopher 75ed30b593 Add a new section and accessor for TLS data.
llvm-svn: 104411
2010-05-22 00:00:58 +00:00
Bob Wilson 61438fe064 Clean up extra whitespace.
llvm-svn: 104410
2010-05-21 23:53:55 +00:00
Eric Christopher 53ff992dde Make this LookAheadLimit, not the uninitialized LookAheadLeft.
Evan please verify!

llvm-svn: 104408
2010-05-21 23:40:03 +00:00
Chris Lattner 4dc833c607 add a note
llvm-svn: 104404
2010-05-21 23:16:21 +00:00
Eric Christopher 09d47031b1 Expand on comment.
llvm-svn: 104396
2010-05-21 23:03:53 +00:00
Kevin Enderby 7e7482c80f Added retl for 32-bit x86 and added retq for 64-bit x86.
llvm-svn: 104394
2010-05-21 23:01:38 +00:00
Eric Christopher 0624d5226c Fix comment and whitespace.
llvm-svn: 104392
2010-05-21 22:39:11 +00:00
Chris Lattner 37c529ae68 expand on the llvm ir bitcode dox. Patch by Peter Housel!
llvm-svn: 104391
2010-05-21 22:20:54 +00:00
Evan Cheng 2c8bdead9e Allow machine cse to cse instructions which define physical registers. Controlled by option -machine-cse-phys-defs.
llvm-svn: 104385
2010-05-21 21:22:19 +00:00
Eric Christopher 3dca28d0e2 Fix section attribute name.
llvm-svn: 104381
2010-05-21 21:08:52 +00:00
Bob Wilson 51d9ee3ff6 Change CodeGen/ARM/2009-11-02-NegativeLane.ll to use 16-bit vector elements
so that it will continue to test what it was meant to test when I commit a
separate change for better support of BUILD_VECTOR and VECTOR_SHUFFLE for Neon.
Fix a DAG combiner crash exposed by this test change.

llvm-svn: 104380
2010-05-21 21:05:32 +00:00
Evan Cheng 3858451e09 - Change MachineInstr::findRegisterDefOperandIdx so it can also look for defs
that are aliases of the specified register.
- Rename modifiesRegister to definesRegister since it's looking a def of the
specific register or one of its super-registers. It's not looking for def of a
sub-register or alias that could change the specified register.
- Added modifiesRegister to look for defs of aliases.

llvm-svn: 104377
2010-05-21 20:53:24 +00:00
Jakob Stoklund Olesen 7d7f604321 Add MachineInstr::readsWritesVirtualRegister() to determine if an instruction
reads or writes a register.

This takes partial redefines and undef uses into account.

Don't actually use it yet. That caused miscompiles.

llvm-svn: 104372
2010-05-21 20:02:01 +00:00
Devang Patel 1782aae355 Simplify
llvm-svn: 104338
2010-05-21 18:49:09 +00:00
Dale Johannesen 2b78565842 Previous commit message should refer to 104308.
llvm-svn: 104337
2010-05-21 18:44:47 +00:00
Dale Johannesen 6361e3e8a2 Fix two bugs in 104348:
Case where MMX is disabled wasn't handled right.
MMX->MMX bitconverts are Legal.

llvm-svn: 104336
2010-05-21 18:40:15 +00:00
Nathan Jeffords ea91abddfe added an assertion to MCObjectWriter::WriteBytes to catch misuse of the ZeroFillSize parameter
If the size of the string is greater than the zero fill size, the function will attempt to write a very large string of zeros to the object file (~4GB on 32 bit platforms). This assertion will catch the scenario and crash the program before the write occurs.

llvm-svn: 104334
2010-05-21 18:23:56 +00:00
Chris Lattner 0735ecfe17 now that fp reg kill insertion stuff happens as a separate
pass after isel instead of being interlaced with it, we can
trust that all the code for a function has been isel'd before
it is run.

The practical impact of this is that we can scan for machine
instr phis instead of doing a fuzzy match on the LLVM BB for
phi nodes.  Doing the fuzzy match required knowing when isel
would produce an fp reg stack phi which was gross.  It was
also wrong in cases where select got lowered to a branch
tree because cmovs aren't available (PR6828).

Just do the scan on machine phis which is simpler, faster
and more correct.  This fixes PR6828.

llvm-svn: 104333
2010-05-21 18:17:54 +00:00
Chris Lattner 058a207436 Use less evil form of switch stmt.
llvm-svn: 104331
2010-05-21 18:02:42 +00:00
Chris Lattner 39a8a43bd8 use continue to reduce nesting.
llvm-svn: 104330
2010-05-21 18:01:24 +00:00
Chris Lattner b7d68a2256 pull a nested loop of this pass out to its own function,
eliminating the gymnastics around the ContainsFPCode var.

llvm-svn: 104328
2010-05-21 17:57:03 +00:00
Chris Lattner fb41aaefeb modernize this pass a bit, fit in 80 columns.
llvm-svn: 104326
2010-05-21 17:49:07 +00:00
Chris Lattner a81e1cab04 constify accessor.
llvm-svn: 104325
2010-05-21 17:47:50 +00:00
Jakob Stoklund Olesen b4e1687270 Revert "Use MachineInstr::readsWritesVirtualRegister to determine if a register is read."
This reverts r104322. I think it was causing miscompilations.

llvm-svn: 104323
2010-05-21 17:36:32 +00:00
Jakob Stoklund Olesen 8e8e090301 Use MachineInstr::readsWritesVirtualRegister to determine if a register is read.
This correctly handles partial redefines and undef uses.

llvm-svn: 104322
2010-05-21 16:42:30 +00:00
Jakob Stoklund Olesen a648c6a757 Teach VirtRegRewriter to handle spilling in instructions that have multiple
definitions of the virtual register.

This happens when spilling the registers produced by REG_SEQUENCE:

%reg1047:5<def>, %reg1047:6<def>, %reg1047:7<def> = VLD3d8 %reg1033, 0, pred:14, pred:%reg0

The rewriter would spill the register multiple times, dead store elimination
tried to keep up, but ended up cutting the branch it was sitting on.

llvm-svn: 104321
2010-05-21 16:36:13 +00:00
Jakob Stoklund Olesen 1f3801062d If the first definition of a virtual register is a partial redef, add an
<imp-def> operand for the full register. This ensures that the full physical
register is marked live after register allocation.

llvm-svn: 104320
2010-05-21 16:32:16 +00:00
Matt Fleming 638cdb2db1 Currently, createMachOStreamer() is invoked directly in llvm-mc which
isn't ideal if we want to be able to use another object file format.

Add a createObjectStreamer() factory method so that the correct object
file streamer can be instantiated for a given target triple.

llvm-svn: 104318
2010-05-21 12:54:43 +00:00
Matt Fleming 5abb6dd61e Split out the x86_32 an x86_64 ELF backends as they handle ELF
differently. This will make adding ELF support easier in the long run.

llvm-svn: 104317
2010-05-21 11:39:07 +00:00
Matt Fleming ec9d6faef0 Add support for parsing the ELF .type assembler directive.
llvm-svn: 104316
2010-05-21 11:36:59 +00:00
Lang Hames d5f0998c6e Removed scaleNumbering method declaration from LiveInterval (not defined, not used).
llvm-svn: 104311
2010-05-21 03:04:04 +00:00
Dale Johannesen b3b9c8ac48 Fix i64->f64 conversion, x86-64, -no-sse. A bit
tricky since there's a 3rd 64-bit type, MMX vectors.
PR 7135.

llvm-svn: 104308
2010-05-21 00:52:33 +00:00
Evan Cheng 34c260458a Change ARM scheduling default to list-hybrid if the target supports floating point instructions (and is not using soft float).
llvm-svn: 104307
2010-05-21 00:43:17 +00:00
Evan Cheng 725211e948 Rename -pre-RA-sched=hybrid to -pre-RA-sched=list-hybrid.
llvm-svn: 104306
2010-05-21 00:42:32 +00:00
Daniel Dunbar e85262d651 Remove dead option.
llvm-svn: 104303
2010-05-21 00:27:55 +00:00
Devang Patel fbd6c45e06 Simplify.
llvm-svn: 104302
2010-05-21 00:10:20 +00:00
Daniel Dunbar c120ffe3f6 Fix __crashreport_info__ declaration.
llvm-svn: 104300
2010-05-20 23:50:19 +00:00
Evan Cheng 4401f8873c Allow targets more controls on what nodes are scheduled by reg pressure, what for latency in hybrid mode.
llvm-svn: 104293
2010-05-20 23:26:43 +00:00
Dan Gohman 9b48b856ea DominatorTree.getNode can return null for unreachable blocks.
llvm-svn: 104290
2010-05-20 22:46:54 +00:00
Dan Gohman 86110fa2bb Minor code cleanups.
llvm-svn: 104287
2010-05-20 22:25:20 +00:00
Mikhail Glushenkov 3a48292204 Print a space after the colon.
llvm-svn: 104279
2010-05-20 21:11:37 +00:00
Dan Gohman 6295f2ebb8 Make Solve check its own post-condition, to reduce clutter in the
top-level LSRInstance logic.

llvm-svn: 104278
2010-05-20 20:59:23 +00:00
Dan Gohman a4ca28a3ae Add comments.
llvm-svn: 104276
2010-05-20 20:52:00 +00:00
Daniel Dunbar baf2eea6f4 MC/X86: Add movq alias for movabsq, to allow matching 64-bit immediates with movq.
llvm-svn: 104275
2010-05-20 20:36:29 +00:00
Devang Patel 0adee9b362 Rename variable. add comment.
llvm-svn: 104274
2010-05-20 20:35:24 +00:00
Dan Gohman 927bcaadda More code cleanups. Use iterators instead of indices when indices
aren't needed.

llvm-svn: 104273
2010-05-20 20:33:18 +00:00
Daniel Dunbar 61655aa2bb X86: Model i64i32imm properly, as a subclass of all immediates.
llvm-svn: 104272
2010-05-20 20:20:39 +00:00
Daniel Dunbar 6d4c66dc1d X86: Fix immediate type of FOO64i32 operations.
llvm-svn: 104271
2010-05-20 20:20:35 +00:00
Daniel Dunbar 5661c0c755 tblgen/Target: Add a isAsmParserOnly bit, and teach the disassembler to honor
it.

llvm-svn: 104270
2010-05-20 20:20:32 +00:00
Dan Gohman 4c4043cf34 Fix OptimizeShadowIV to set Changed. Change OptimizeLoopTermCond to set
Changed directly instead of using a return value.

Rename FilterOutUndesirableDedicatedRegisters's Changed variable to
distinguish it from LSRInstance's Changed member.

llvm-svn: 104269
2010-05-20 20:05:31 +00:00
Dan Gohman 8ec018cedf Add some comments.
llvm-svn: 104268
2010-05-20 20:00:41 +00:00
Dan Gohman 8ce95cc3c5 Simplify this code. Don't do a DomTreeNode lookup for each visited block.
llvm-svn: 104267
2010-05-20 20:00:25 +00:00
Devang Patel 490c8ab76d Refactor.
llvm-svn: 104265
2010-05-20 19:57:06 +00:00
Matt Fleming 141791c6d1 Grammar fix. This is a test commit.
llvm-svn: 104264
2010-05-20 19:45:09 +00:00
Dan Gohman ab5fb7f559 Minor code cleanups.
llvm-svn: 104263
2010-05-20 19:44:23 +00:00
Dan Gohman ee2fea3cd7 When canonicalizing icmp operand order to put the loop invariant
operand on the left, the interesting operand is on the right. This
fixes a bug where LSR was failing to recognize ICmpZero uses,
which led it to be unable to reverse the induction variable in the
attached testcase.

Delete test/CodeGen/X86/stack-color-with-reg-2.ll, because its test
is extremely fragile and hard to meaningfully update.

llvm-svn: 104262
2010-05-20 19:26:52 +00:00
Mikhail Glushenkov 3e69aa0399 llvmc: Make segfault detection work on Win32.
llvm-svn: 104261
2010-05-20 19:23:47 +00:00
Dan Gohman fdf9874ba7 Set Changed to true when canonicalizing ICmp operand order; even though
it isn't a very interesting change, it's a change nonetheless.

llvm-svn: 104260
2010-05-20 19:16:03 +00:00
Bob Wilson 5954994bba Handle Neon v2f64 and v2i64 vector shuffles as register copies.
This fixes the remaining issue with pr7167.

llvm-svn: 104257
2010-05-20 18:39:53 +00:00
Jim Grosbach 63d4f68df4 Remove dbg_value workaround and associated command line option
llvm-svn: 104254
2010-05-20 18:34:01 +00:00
Dan Gohman 098a47931c Delete MMX_MOVQ64gmr. It was the same as MMX_MOVQ64mr, but it didn't
have a pattern and it had an invalid encoding.

llvm-svn: 104244
2010-05-20 18:05:01 +00:00
Dale Johannesen d7d6638e3e The PPC MFCR instruction implicitly uses all 8 of the CR
registers.  Currently it is not so marked, which leads to
VCMPEQ instructions that feed into it getting deleted.
If it is so marked, local RA complains about this sequence:
 vreg = MCRF  CR0
 MFCR  <kill of whatever preg got assigned to vreg>
All current uses of this instruction are only interested in
one of the 8 CR registers, so redefine MFCR to be a normal
unary instruction with a CR input (which is emitted only as
a comment).  That avoids all problems.  7739628.

llvm-svn: 104238
2010-05-20 17:48:26 +00:00
Devang Patel e2ff7f3a7d Strip llvm.dbg.lv also.
llvm-svn: 104236
2010-05-20 16:49:22 +00:00
Dan Gohman 981563d0ba Rename a variable to avoid shadowing.
llvm-svn: 104234
2010-05-20 16:41:11 +00:00
Devang Patel e1c53f29d3 Split DbgVariable. Eventually, variable info will be communicated through frame index, or DBG_VALUE instruction, or collection of DBG_VALUE instructions. Plus each DbgVariable may not need a label.
llvm-svn: 104233
2010-05-20 16:36:41 +00:00
Dan Gohman 6b733fc189 Minor code simplification.
llvm-svn: 104232
2010-05-20 16:23:28 +00:00
Dan Gohman 29790edb93 Fix assembly parsing and encoding of the pushf and popf family of
instructions.

llvm-svn: 104231
2010-05-20 16:16:00 +00:00