Commit Graph

6134 Commits

Author SHA1 Message Date
Daniel Dunbar b34440a6a8 MC: Eliminate MCAsmFixup, replace with MCFixup.
llvm-svn: 104699
2010-05-26 15:18:56 +00:00
Daniel Dunbar 353a91ff76 MC: Use accessors for access to MCAsmFixup.
llvm-svn: 104697
2010-05-26 15:18:31 +00:00
Daniel Dunbar 3627af5da4 MC: Change MCInst::dump_pretty to not include a trailing newline.
llvm-svn: 104696
2010-05-26 15:18:13 +00:00
Zhongxing Xu 730a977e02 SRetReturnReg was set in LowerFormalArguments(). So only assert it here.
llvm-svn: 104691
2010-05-26 08:10:02 +00:00
Jakob Stoklund Olesen 50eec620f4 Revert "Replace the SubRegSet tablegen class with a less error-prone mechanism."
This reverts commit 104654.

llvm-svn: 104660
2010-05-26 01:21:14 +00:00
Jakob Stoklund Olesen 0b0274524c Replace the SubRegSet tablegen class with a less error-prone mechanism.
A Register with subregisters must also provide SubRegIndices for adressing the
subregisters. TableGen automatically inherits indices for sub-subregisters to
minimize typing.

CompositeIndices may be specified for the weirder cases such as the XMM sub_sd
index that returns the same register, and ARM NEON Q registers where both D
subregs have ssub_0 and ssub_1 sub-subregs.

It is now required that all subregisters are named by an index, and a future
patch will also require inherited subregisters to be named. This is necessary to
allow composite subregister indices to be reduced to a single index.

llvm-svn: 104654
2010-05-26 00:28:19 +00:00
Kevin Enderby 492d4f409a Changed the encoding of X86 floating point stack operations where both operands
are st(0).  These can be encoded using an opcode for storing in st(0) or using
an opcode for storing in st(i), where i can also be 0.  To allow testing with
the darwin assembler and get a matching binary the opcode for storing in st(0)
is now used.  To do this the same logical trick is use from the darwin assembler
in converting things like this:

fmul %st(0), %st

into this:

fmul %st(0)

by looking for the second operand being X86::ST0 for specific floating point
mnemonics then removing the second X86::ST0 operand.  This also has the add
benefit to allow things like:

fmul %st(1), %st

that llvm-mc did not assemble.

llvm-svn: 104634
2010-05-25 20:52:34 +00:00
Jakob Stoklund Olesen 3311eb50d7 Separate unrelated cases that once shared a numeric value
llvm-svn: 104629
2010-05-25 19:49:40 +00:00
Jakob Stoklund Olesen 673e7e0f37 Remove NumberHack entirely.
SubRegIndex instances are now numbered uniquely the same way Register instances
are - in lexicographical order by name.

llvm-svn: 104627
2010-05-25 19:49:33 +00:00
Daniel Dunbar 0e767d7364 MC/X86: Add a hack to allow recognizing 'cmpltps' and friends.
llvm-svn: 104626
2010-05-25 19:49:32 +00:00
Daniel Dunbar 4a5b2c597b MC/X86: Define explicit immediate forms of cmp{ss,sd,ps,pd}.
llvm-svn: 104622
2010-05-25 18:40:53 +00:00
Kevin Enderby c798965e63 The BT64ri8 record in X86Instr64bit.td was missing a REX_W which is required
for the 64-bit version of the Bit Test instruction.

llvm-svn: 104621
2010-05-25 18:16:58 +00:00
Eric Christopher f6562d35ac Make sure aeskeygenassist uses an unsigned immediate field.
Fixes rdar://8017638

llvm-svn: 104617
2010-05-25 17:33:22 +00:00
Jakob Stoklund Olesen 3b59e0601e Ignore NumberHack and give each SubRegIndex instance a unique enum value instead.
This passes lit tests, but I'll give it a go through the buildbots to smoke out
any remaining places that depend on the old SubRegIndex numbering.

Then I'll remove NumberHack entirely.

llvm-svn: 104615
2010-05-25 17:21:04 +00:00
Jakob Stoklund Olesen 396c8802b2 Use enums instead of literals for X86 subregisters.
The cases in getMatchingSuperRegClass cannot be broken up until the enums have
unique values.

llvm-svn: 104611
2010-05-25 17:04:16 +00:00
Jakob Stoklund Olesen fdb25de17e Switch SubRegSet to using symbolic SubRegIndices
llvm-svn: 104571
2010-05-24 23:03:18 +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
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
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
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
Evan Cheng 168ced94d8 Implement @llvm.returnaddress. rdar://8015977.
llvm-svn: 104421
2010-05-22 01:47:14 +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
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
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
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
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
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
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
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
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
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
Dan Gohman 5238275478 Set neverHasSideEffects on 64-bit pushf and popf, for consistency with
16-bit and 32-bit pushf and popf.

llvm-svn: 104228
2010-05-20 15:42:55 +00:00
Dan Gohman 1e19eab963 Define the x86 pause instruction.
llvm-svn: 104204
2010-05-20 01:35:50 +00:00
Dan Gohman a3b7570a3a Fix the sfence instruction to use MRM_F8 instead of MRM7r, since it
doesn't have a register operand. Also, use I instead of PSI, for
consistency with mfence and lfence.

llvm-svn: 104203
2010-05-20 01:23:41 +00:00
Evan Cheng 738e920edf Code refactoring: pull SchedPreference enum from TargetLowering.h to TargetMachine.h and put it in its own namespace.
llvm-svn: 104147
2010-05-19 20:19:50 +00:00
Daniel Dunbar 52e37becf6 MC/X86: Add missing entry for TAILJMP_1 to getRelaxedOpcode().
llvm-svn: 104122
2010-05-19 17:20:58 +00:00
Daniel Dunbar d2f78e755f MC/X86: Lower TAILCALLd[64] to JMP_1, to allow relaxation and to avoid same
prefix byte problem as in r104062.
 - As a total hack to keep the TAILCALL markers in the output, which some tests depend on, this invents a new TAILJMP_1 instruction.

llvm-svn: 104120
2010-05-19 15:26:43 +00:00
Daniel Dunbar b243dfb085 MC/X86: Strip spurious operands from TAILJMPr64 as we do for CALL64r and
CALL64pcrel32, for the same reason.

llvm-svn: 104116
2010-05-19 08:07:12 +00:00
Daniel Dunbar 4f6c7c6d94 MC/X86: Lower MOV{8,16,32,64}{rm,mr} to fixed-register forms, as appropriate.
llvm-svn: 104112
2010-05-19 06:20:44 +00:00
Daniel Dunbar 45ace40959 MC/X86: Strip spurious operands from CALL64r as we do for CALL64pcrel32, to
avoid same prefix byte problem as in r104062.

llvm-svn: 104108
2010-05-19 04:31:36 +00:00
Dan Gohman 58c6f21453 Factor out the code for picking integer arithmetic with immediate
opcodes into a helper function. This fixes a few places in the code
which were not properly selecting the 8-bit-immediate opcodes.

llvm-svn: 104091
2010-05-19 00:53:19 +00:00
Dan Gohman f8bf663873 Teach mode load folding and unfolding code about CMP32ri8 and friends.
llvm-svn: 104068
2010-05-18 21:54:15 +00:00
Dan Gohman 887dd1cd31 When converting a test to a cmp to fold a load, use the cmp that has an
8-bit immediate field rather than one with a wider immediate field.

llvm-svn: 104064
2010-05-18 21:42:03 +00:00
Chris Lattner 9f46539e07 make mcinstlower remove all but the first operand to CALL64pcrel32.
The register use operands (e.g. the first argument is passed in a 
register) is currently being modeled as a normal register use,
instead of correctly being an implicit use.  This causes the operand
to get propagated onto the mcinst, which was causing the encoder to
emit a rex prefix byte, which generates an invalid call.

This fixes rdar://7998435

llvm-svn: 104062
2010-05-18 21:40:18 +00:00
Daniel Dunbar a4820fcc78 MC/X86: Implement custom lowering to make sure we match things like
X86::ADC32ri $0, %eax
to
  X86::ADC32i32 $0

llvm-svn: 104030
2010-05-18 17:22:24 +00:00
Eric Christopher bf79238599 Add some section and constant support for darwin TLS.
llvm-svn: 103974
2010-05-17 21:02:07 +00:00
Dale Johannesen 2ef974ee0e Revert 103911; it broke a test that expects bitconvert
<1xi64> -> i64 to work in MMX registers on hosts where -no-sse
is the default (not mine).  The right thing is
to accept this and make i64->f64 conversions go through memory,
but I don't have time right now.

llvm-svn: 103914
2010-05-16 20:19:04 +00:00
Dale Johannesen fc1492d71b Make x86-64 64-bit bitconvert work when SSE is not available.
(This worked as of about 6 months ago and I didn't track down
exactly what broke it; I think this fix is appropriate.)

llvm-svn: 103911
2010-05-16 18:22:38 +00:00
Anton Korobeynikov 8f35fabbc1 Add support for thiscall calling convention.
Patch by Charles Davis and Steven Watanabe!

llvm-svn: 103902
2010-05-16 09:08:45 +00:00
Dale Johannesen 3a366a88f2 Fix uint64->{float, double} conversion to do rounding correctly in 32-bit.
The implementation in LegalizeIntegerTypes to handle this as 
sint64->float + appropriate power of 2 is subject to double rounding,
considered incorrect by numerics people.  Use this implementation only
when it is safe.  This leads to using library calls in some cases
that produced inline code before, but it's correct now.
(EVTToAPFloatSemantics belongs somewhere else, any suggestions?)

Add a correctly rounding (though not particularly fast) conversion
that uses X87 80-bit computations for x86-32.

7885399, 5901940.  This shows up in gcc.c-torture/execute/ieee/rbug.c
in the gcc testsuite on some platforms.

llvm-svn: 103883
2010-05-15 18:51:12 +00:00
Bill Wendling 1713d95874 Several tail call tests apparently rely upon this being "adjusts stack" instead
of "has calls". That's probably wrong, but it needs further
investigation. Revert to the original behavior until this is settled.

llvm-svn: 103824
2010-05-14 21:58:35 +00:00
Bill Wendling e9ac7ad68c This should happen if there are no calls, not if it just doesn't adjust the
stack.

llvm-svn: 103813
2010-05-14 21:38:44 +00:00
Bill Wendling db4bc54c4f Revert r103804. The comment is correct.
llvm-svn: 103808
2010-05-14 21:28:24 +00:00
Bill Wendling 7bf4bae5dc Fix comment.
llvm-svn: 103804
2010-05-14 21:17:29 +00:00
Bill Wendling 95f6ebcb37 Rename "HasCalls" in MachineFrameInfo to "AdjustsStack" to better describe what
the variable actually tracks.

N.B., several back-ends are using "HasCalls" as being synonymous for something
that adjusts the stack. This isn't 100% correct and should be looked into.

llvm-svn: 103802
2010-05-14 21:14:32 +00:00
Dan Gohman 35dd005d22 Lowering of atomic instructions can result in operands being
used more than once. If ISel had put a kill flag on one of them,
it's not valid to transfer the kill flag to each new instance.

llvm-svn: 103799
2010-05-14 21:01:44 +00:00
Kevin Enderby 7bc111f5a9 Fix so "int3" is correctly accepted, added "into" and fixed "int" with an
argument, like "int $4", to not get an Assertion error.

llvm-svn: 103791
2010-05-14 19:16:02 +00:00
Dan Gohman 30e3db2ba3 Set isTerminator on TRAP instructions.
llvm-svn: 103778
2010-05-14 16:46:02 +00:00
Dan Gohman 02d9947e60 Add mayLoad and mayStore flags to instructions which missed them.
llvm-svn: 103776
2010-05-14 16:34:55 +00:00
Oscar Fuentes 82135e5a2f CMake: fixes 64 bit Visual Studio IDE build. Fixes bug 4936.
Patch by Dimitry Andric!

llvm-svn: 103727
2010-05-13 19:34:06 +00:00
Chris Lattner 9efef006cf reapply r103668 with a fix. Never make "minor syntax changes"
after testing before committing.

llvm-svn: 103681
2010-05-13 00:02:47 +00:00
Chris Lattner e354235512 revert r103668 for now, it is apparently breaking things.
llvm-svn: 103677
2010-05-12 23:40:59 +00:00
Chris Lattner a6df4650fd moffset forms of moves are x86-32 only, make the parser
lower them to the correct x86-64 instructions since we 
don't have a clean way to handle this in td files yet.
rdar://7947184

llvm-svn: 103668
2010-05-12 23:13:36 +00:00
Chris Lattner e132b0a92c fix the encoding of the obscure "moffset" forms of moves, i386
part first.  rdar://7947184

llvm-svn: 103660
2010-05-12 22:48:24 +00:00
Daniel Dunbar 059379a9d7 MC/X86: Extend suffix matching hack to match 'q' suffix.
llvm-svn: 103535
2010-05-12 00:54:20 +00:00
Daniel Dunbar ba2f4c3884 MC/Mach-O/x86_64: Add a new hook for checking whether a particular section can
be diced into atoms, and adjust getAtom() to take this into account.
 - This fixes relocations to symbols in fixed size literal sections, for
   example.

llvm-svn: 103532
2010-05-12 00:38:17 +00:00
Dan Gohman 1a1b51ff59 Add initial kill flag support to FastISel.
llvm-svn: 103529
2010-05-11 23:54:07 +00:00
Duncan Sands 6c5e4355bb I got tired of VISIBILITY_HIDDEN colliding with the gcc enum. Rename it
to LLVM_LIBRARY_VISIBILITY and introduce LLVM_GLOBAL_VISIBILITY, which is
the opposite, for future use by dragonegg.

llvm-svn: 103495
2010-05-11 20:16:09 +00:00
Dan Gohman bb919dfb6b Implement a bunch more TargetSelectionDAGInfo infrastructure.
Move EmitTargetCodeForMemcpy, EmitTargetCodeForMemset, and
EmitTargetCodeForMemmove out of TargetLowering and into
SelectionDAGInfo to exercise this.

llvm-svn: 103481
2010-05-11 17:31:57 +00:00
Dan Gohman 4df9d9ce11 Remove the TargetLowering::getSubtarget() virtual function, which
was unused. TargetMachine::getSubtarget() is used instead.

llvm-svn: 103474
2010-05-11 16:21:03 +00:00
Nathan Jeffords b19c598843 updated handling dllexport in X86AsmPrinter
changed dllexport code to use EmitBytes instead of EmitRawText, and changed the export option to use /EXPORT: instead of -export: on the windows platform

llvm-svn: 103377
2010-05-09 08:40:06 +00:00
Nathan Jeffords 2760216c89 made COFF target dllexport logic apply to all subtargets
llvm-svn: 103373
2010-05-09 05:52:28 +00:00
Chris Lattner 72afa956db break coff symbol definition stuff out into proper MCStreamer callbacks,
patch by Nathan Jeffords!

llvm-svn: 103346
2010-05-08 19:54:22 +00:00
Devang Patel 4423abd734 Use overloaded operators instead of DIDescriptor::getNode()
llvm-svn: 103276
2010-05-07 18:19:32 +00:00
Chris Lattner 87cffa9498 switch MCSectionCOFF from a syntactic to semantic representation,
patch by Peter Housel!

llvm-svn: 103267
2010-05-07 17:17:41 +00:00
Dan Gohman 90c600d6d2 When rematerializing, use the debug location of the original
instruction, rather than a location near where the new instruction
is being inserted.

llvm-svn: 103232
2010-05-07 01:28:10 +00:00
Daniel Dunbar 21aa523c28 MC/X86: X86AbsMemAsmOperand is subclass of X86NoSegMemAsmOperand.
- This fixes "leal 0, %eax", for example.

llvm-svn: 103205
2010-05-06 22:39:14 +00:00
Chris Lattner 348dc9b15a fix rdar://7947167 - llvm-mc doesn't match movsq
llvm-svn: 103199
2010-05-06 21:48:14 +00:00
Sean Callanan e7e1cf9fbd Eliminated the classification of control registers into %ecr_
and %rcr_, leaving just %cr_ which is what people expect.
Updated the disassembler to support this unified register set.
Added a testcase to verify that the registers continue to be
decoded correctly.

llvm-svn: 103196
2010-05-06 20:59:00 +00:00
Daniel Dunbar 358b29c855 MC/X86: Error out if we see a non-constant FK_Data_1 or FK_Data_2 fixup, since
we don't currently support relaxing them.

llvm-svn: 103195
2010-05-06 20:34:01 +00:00
Dan Gohman 779c69bbc5 Add a DebugLoc argument to TargetInstrInfo::copyRegToReg, so that it
doesn't have to guess.

llvm-svn: 103194
2010-05-06 20:33:48 +00:00
Evan Cheng efb126a665 Add argument TargetRegisterInfo to loadRegFromStackSlot and storeRegToStackSlot.
llvm-svn: 103193
2010-05-06 19:06:44 +00:00
Evan Cheng 31cdcd46d6 Re-apply 103156 and 103157. 103156 didn't break anything. 10315 exposed a coalescer bug that's fixed by 103170.
llvm-svn: 103172
2010-05-06 06:36:08 +00:00
Eric Christopher 9feb1bb117 Revert r103156 since it was breaking the build bots.
Reverse-merging r103156 into '.':
U    lib/Target/ARM/ARMInstrNEON.td
U    lib/Target/ARM/ARMRegisterInfo.h
U    lib/Target/ARM/ARMBaseRegisterInfo.cpp
U    lib/Target/ARM/ARMBaseInstrInfo.cpp
U    lib/Target/ARM/ARMRegisterInfo.td

llvm-svn: 103159
2010-05-06 02:29:06 +00:00
Sean Callanan 4cd930f417 Fixed a sign-extension bug in the X86 disassembler
that was causing PC-relative branch targets to be
evaluated incorrectly.  Also added support for
checking operand values to the llvm-mc tester.

llvm-svn: 103128
2010-05-05 22:47:27 +00:00
Evan Cheng 5ab29366b5 Trim include.
llvm-svn: 103103
2010-05-05 18:27:57 +00:00
Eric Christopher 4e7e4e6b60 Revert 102941, we're going to do this via attr and can just
hack the code to turn it off when debugging.

llvm-svn: 103083
2010-05-05 07:35:59 +00:00
Eric Christopher a00830df31 Update comment.
llvm-svn: 103057
2010-05-04 22:13:03 +00:00
Daniel Dunbar c3e0bafc6d MC/X86: Chris pointed that 'as' isn't consistent in accepting the long form of
instructions which have no direct register usage.

Darwin 'as' accepts:
  add $0, (%rax)
but rejects
  mov $0, (%rax)
for example.

Given that, only accept suffix matches which match exactly one form. We still
need to emit nice diagnostics for failures...

llvm-svn: 103015
2010-05-04 17:31:02 +00:00
Daniel Dunbar 9b816a1bb3 MC/X86: Add "support" for matching ATT style mnemonic prefixes.
- The idea is that when a match fails, we just try to match each of +'b', +'w',
   +'l'. If exactly one matches, we assume this is a mnemonic prefix and accept
   it. If all match, we assume it is width generic, and take the 'l' form.

 - This would be a horrible hack, if it weren't so simple. Therefore it is an
   elegant solution! Chris gets the credit for this particular elegant
   solution. :)

 - Next step to making this more robust is to have the X86 matcher generate the
   mnemonic prefix information. Ideally we would also compute up-front exactly
   which mnemonic to attempt to match, but this may require more custom code in
   the matcher than is really worth it.

llvm-svn: 103012
2010-05-04 16:12:42 +00:00
Kevin Enderby 8f0037097f Fix to r102952. The MOV64toSDrm record in X86Instr64bit.td needed the opcode
changed to 0x7E from 0x6E as well as the previous change of RPDI to S3SI.

llvm-svn: 102991
2010-05-04 00:42:46 +00:00
Kevin Enderby 6f2f8d0798 Changed llvm-mc to use the same suffixes with floating point compare
instructions as the Mac OS X darwin assembler.  Some of which like 'fcoml'
assembled to different opcodes.  While some of the suffixes were just different.

llvm-svn: 102958
2010-05-03 21:31:40 +00:00
Kevin Enderby e3a1726034 Fixed the encoding of two of the X86 movq instuctions. The Move quadword from
mm to mm/m64 and the Move quadword from xmm2/mem64 to xmm1 had the incorrect
encodings.

llvm-svn: 102952
2010-05-03 21:03:31 +00:00
Kevin Enderby 1a51d4cec9 Fixed the encoding of the x86 push instructions. Using a 32-bit immediate value
caused the a pushl instruction to be incorrectly encoding using only two bytes
of immediate, causing the following 2 instruction bytes to be part of the 32-bit
immediate value.  Also fixed the one byte form of push to be used when the
immediate would fit in a signed extended byte.  Lastly changed the names to not
include the 32 of PUSH32 since they actually push the size of the stack pointer.

llvm-svn: 102951
2010-05-03 20:45:05 +00:00
Eric Christopher 937a5b75f9 Add an option, defaulting to off, to disable the sse domain crossing opts.
llvm-svn: 102941
2010-05-03 19:54:02 +00:00
Dan Gohman 25c1653700 Get rid of the EdgeMapping map. Instead, just check for BasicBlock
changes before doing phi lowering for switches.

llvm-svn: 102809
2010-05-01 00:01:06 +00:00
Dan Gohman 2e2cc87081 Make this code less confusing. Instead of reassigning BB, just operate
on the original variables, so it's easier to see what is being done
to which blocks.

llvm-svn: 102759
2010-04-30 20:14:26 +00:00
Dan Gohman 57bb73c80b Remove the -disable-16bit command-line option, which is now obsolete.
llvm-svn: 102730
2010-04-30 18:30:26 +00:00
Evan Cheng 5117a555e0 Another sibcall bug. If caller and callee calling conventions differ, then it's only safe to do a tail call if the results are returned in the same way.
llvm-svn: 102683
2010-04-30 01:12:32 +00:00
Dan Gohman 0fd54fbbcf Don't leave Base.FrameIndex uninitialized, so that it doesn't
print randomly in debug output.

llvm-svn: 102668
2010-04-29 23:30:41 +00:00
Devang Patel 080e4fb2f0 Print variable scope name in DEBUG_VALUE comment. Useful in some cases. e.g.
##DEBUG_VALUE: runOnMachineFunction:this <- RDI+0
	##DEBUG_VALUE: runOnMachineFunction:fn <- RSI+0
	##DEBUG_VALUE: DeadDefs <- undef ## SimpleRegisterCoalescing.cpp:2706
	##DEBUG_VALUE: getRegInfo:this <- [%rsp+$56]+$0
	##DEBUG_VALUE: getTarget:this <- [%rsp+$56]+$0

llvm-svn: 102655
2010-04-29 18:52:10 +00:00
Evan Cheng 38dfa5cf20 Load folding tail call should not use ebp / rbp after it's popped. PEI
should use esp / rsp to reference frame instead.

llvm-svn: 102596
2010-04-29 05:08:22 +00:00
Evan Cheng 250e917e9d Frame index can be negative.
llvm-svn: 102577
2010-04-29 01:13:30 +00:00
Kevin Enderby 4822841b82 Fixed the word sized Bit Scan Forward/Reverse instructions, they needed the
Operand size override prefix to be part of their records.

llvm-svn: 102556
2010-04-28 23:20:40 +00:00
Jakob Stoklund Olesen 96fad31694 Teach X86FloatingPoint that a register can be killed multiple times by the same
instruction.

This instruction would crash the pass:

  INLINEASM <es:foo $0 $1>, 9, %FP0<kill>, 9, %FP0<kill>, 14, %EFLAGS<earlyclobber,def,dead>

Now it doesn't.

llvm-svn: 102509
2010-04-28 18:28:37 +00:00
Evan Cheng 050df1b8de Enable i16 to i32 promotion by default.
llvm-svn: 102493
2010-04-28 08:30:49 +00:00
Evan Cheng d21f564543 Unbreak the build. Only form shld / shrd after legalization.
llvm-svn: 102488
2010-04-28 02:25:18 +00:00
Devang Patel 50c9431203 Emit debug info for byval parameters.
llvm-svn: 102486
2010-04-28 01:39:28 +00:00
Evan Cheng 347e3b8f15 Rather than having a ton of patterns for double shift instructions, e.g. SHLD16rrCL, just perform custom dag combine to form x86 specific dag so they match to the same pattern. This also makes sure later dag combine do not cause isel to miss them (e.g. promoting i16 to i32).
llvm-svn: 102485
2010-04-28 01:18:01 +00:00
Stuart Hastings c0458f1a40 Tweak x86 INC/DEC generation to look for CopyToReg or SETCC. Radar 7866163.
llvm-svn: 102477
2010-04-28 00:35:10 +00:00
Evan Cheng 9e3a4ef089 Fix obvious typos.
llvm-svn: 102467
2010-04-27 21:46:03 +00:00
Evan Cheng 3b928af28f SRA promotion is also not free.
llvm-svn: 102456
2010-04-27 19:48:31 +00:00
Chris Lattner 6a5e706e3c on darwin empty functions need to codegen into something of non-zero length,
otherwise labels get incorrectly merged.  We handled this by emitting a 
".byte 0", but this isn't correct on thumb/arm targets where the text segment
needs to be a multiple of 2/4 bytes.  Handle this by emitting a noop.  This
is more gross than it should be because arm/ppc are not fully mc'ized yet.

This fixes rdar://7908505

llvm-svn: 102400
2010-04-26 23:37:21 +00:00
Evan Cheng 6e45f1d1ff Promoting 16-bit cmp / test aren't free. Don't do it.
llvm-svn: 102366
2010-04-26 19:06:11 +00:00
Evan Cheng 1ff9d1b63e Remove a redundant comment.
llvm-svn: 102326
2010-04-26 08:16:57 +00:00
Evan Cheng ed69b382ea - Move TargetLowering::EmitTargetCodeForFrameDebugValue to TargetInstrInfo and rename it to emitFrameIndexDebugValue.
- Teach spiller to modify DBG_VALUE instructions to reference spill slots.

llvm-svn: 102323
2010-04-26 07:38:55 +00:00
Dale Johannesen 582565e991 Stop abusing EmitInstrWithCustomInserter for target-dependent
form of DEBUG_VALUE, as it doesn't have reasonable default
behavior for unsupported targets.  Add a new hook instead.
No functional change.

llvm-svn: 102320
2010-04-25 21:33:54 +00:00
Evan Cheng a02d0e7d6b Avoid promoting a i16 node if it would eliminate a (store (op (load))) opportunity.
llvm-svn: 102237
2010-04-24 04:44:57 +00:00
Stuart Hastings 24b63f1597 Add some missing x86 patterns for movdq2q. Fixes two (LLVM-)GCC DejaGNU testcases. Radar 6881029.
llvm-svn: 102199
2010-04-23 19:03:32 +00:00
Evan Cheng 0367559786 Fix X86ISD::CMP i16 to i32 promotion.
llvm-svn: 102192
2010-04-23 18:21:16 +00:00
Dan Gohman c594eab10f Move HandlePHINodesInSuccessorBlocks functions out of SelectionDAGISel
and into SelectionDAGBuilder and FastISel.

llvm-svn: 102123
2010-04-22 20:46:50 +00:00
Evan Cheng f1223bdec0 - It's not safe to promote rotates (at least not trivially).
- Some code refactoring.

llvm-svn: 102111
2010-04-22 20:19:46 +00:00
Evan Cheng 4158a0ff6b Implement -disable-non-leaf-fp-elim which disable frame pointer elimination
optimization for non-leaf functions. This will be hooked up to gcc's
-momit-leaf-frame-pointer option. rdar://7886181

llvm-svn: 101984
2010-04-21 03:18:23 +00:00
Evan Cheng 9c8cd8c061 isel (i32 anyext i16) as insert_subreg when 16-bit ops are being promoted.
llvm-svn: 101979
2010-04-21 01:47:12 +00:00
Evan Cheng 873310f635 Trim include.
llvm-svn: 101978
2010-04-21 01:39:06 +00:00
Bill Wendling 11740305f9 Handle a displacement location in 64-bit as an RIP-relative displacement. It
fixes a bug (<rdar://problem/7880900>) in the JIT. This code wouldn't work:

target triple = "x86_64-apple-darwin"

define double @func(double %a) {
  %tmp1 = fmul double %a, 5.000000e-01            ; <double> [#uses=1]
  ret double %tmp1
}

define i32 @main() nounwind {
  %1 = call double @func(double 4.770000e-04) ; <i64> [#uses=0]
  ret i32 0
}

llvm-svn: 101965
2010-04-21 00:34:04 +00:00
Chris Lattner 84776786a7 teach the x86 address matching stuff to handle
(shl (or x,c), 3) the same as (shl (add x, c), 3)
when x doesn't have any bits from c set.

This finishes off PR1135.  Before we compiled the block to:
to:

LBB0_3:                                 ## %bb
	cmpb	$4, %dl
	sete	%dl
	addb	%dl, %cl
	movb	%cl, %dl
	shlb	$2, %dl
	addb	%r8b, %dl
	shlb	$2, %dl
	movzbl	%dl, %edx
	movl	%esi, (%rdi,%rdx,4)
	leaq	2(%rdx), %r9
	movl	%esi, (%rdi,%r9,4)
	leaq	1(%rdx), %r9
	movl	%esi, (%rdi,%r9,4)
	addq	$3, %rdx
	movl	%esi, (%rdi,%rdx,4)
	incb	%r8b
	decb	%al
	movb	%r8b, %dl
	jne	LBB0_1

Now we produce:

LBB0_3:                                 ## %bb
	cmpb	$4, %dl
	sete	%dl
	addb	%dl, %cl
	movb	%cl, %dl
	shlb	$2, %dl
	addb	%r8b, %dl
	shlb	$2, %dl
	movzbl	%dl, %edx
	movl	%esi, (%rdi,%rdx,4)
	movl	%esi, 8(%rdi,%rdx,4)
	movl	%esi, 4(%rdi,%rdx,4)
	movl	%esi, 12(%rdi,%rdx,4)
	incb	%r8b
	decb	%al
	movb	%r8b, %dl
	jne	LBB0_1

llvm-svn: 101958
2010-04-20 23:18:40 +00:00
Dale Johannesen 0522b90cdb Because of the EMMS problem, right now we have to support
user-defined operations that use MMX register types, but
the compiler shouldn't generate them on its own.  This adds
a Synthesizable abstraction to represent this, and changes
the vector widening computation so it won't produce MMX types.
(The motivation is to remove noise from the ABI compatibility
part of the gcc test suite, which has some breakage right now.)

llvm-svn: 101951
2010-04-20 22:34:09 +00:00
Chris Lattner 4025306a91 disable optimizations in this directory for MSVC9. This avoids
an optimizer infinite loop on the file, PR6866.

llvm-svn: 101854
2010-04-20 01:11:32 +00:00
Eric Christopher 64831c6a4c Remove the palignr intrinsics now that we lower them to vector shuffles,
shifts and null vectors. Autoupgrade these to what we'd lower them to.

Add a testcase to exercise this.

llvm-svn: 101851
2010-04-20 00:59:54 +00:00
Evan Cheng e19aa5cc52 More progress on promoting i16 operations to i32 for x86. Work in progress.
llvm-svn: 101808
2010-04-19 19:29:22 +00:00
Chris Lattner b927073f2e teach the x86 asm parser how to handle segment prefixes
in memory operands.  rdar://7874844

llvm-svn: 101661
2010-04-17 18:56:34 +00:00
Chris Lattner 05f34394d9 remove a dead variable, PR6856
llvm-svn: 101648
2010-04-17 17:28:00 +00:00
Dan Gohman 53d4a08d2b Add const qualifiers to TargetLoweringObjectFile usage.
llvm-svn: 101640
2010-04-17 16:44:48 +00:00
Dan Gohman 88f7f6aeda Use const_cast instead of a C-style cast to cast away const.
llvm-svn: 101639
2010-04-17 16:43:55 +00:00
Dan Gohman 21cea8ac2e Use const qualifiers with TargetLowering. This eliminates several
const_casts, and it reinforces the design of the Target classes being
immutable.

SelectionDAGISel::IsLegalToFold is now a static member function, because
PIC16 uses it in an unconventional way. There is more room for API
cleanup here.

And PIC16's AsmPrinter no longer uses TargetLowering.

llvm-svn: 101635
2010-04-17 15:26:15 +00:00
Dan Gohman 31ae586c74 Move per-function state out of TargetLowering subclasses and into
MachineFunctionInfo subclasses.

llvm-svn: 101634
2010-04-17 14:41:14 +00:00
Chris Lattner 7f5088e6de a bunch of ssse3 instructions are misencoded to think they have an
i8 field when they really do not.  This fixes rdar://7840289

llvm-svn: 101629
2010-04-17 07:38:24 +00:00
Evan Cheng f1bd5fcdb4 More work to allow dag combiner to promote 16-bit ops to 32-bit.
llvm-svn: 101621
2010-04-17 06:13:15 +00:00
Eric Christopher 7258dcd77f Revert 101465, it broke internal OpenGL testing.
Probably the best way to know that all getOperand() calls have been handled
is to replace that API instead of updating.

llvm-svn: 101579
2010-04-16 23:37:20 +00:00
Dan Gohman 9becdddc49 Add skeleton target-specific SelectionDAGInfo files.
llvm-svn: 101564
2010-04-16 23:04:22 +00:00
Chris Lattner d4758fc393 add a missing break back, patch by Nico Schmidt!
llvm-svn: 101538
2010-04-16 21:15:15 +00:00
Dan Gohman 148c69a3f6 Eliminate an unnecessary SelectionDAG dependency in getOptimalMemOpType.
llvm-svn: 101531
2010-04-16 20:11:05 +00:00
Gabor Greif f375520f7b reapply r101434
with a fix for self-hosting

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary

llvm-svn: 101465
2010-04-16 15:33:14 +00:00
Evan Cheng af56facacd Adding support for dag combiner to promote operations for profit. This requires target specific queries. For example, x86 should promote i16 to i32 when it does not impact load folding.
x86 support is off by default. It can be enabled with -promote-16bit.

Work in progress.

llvm-svn: 101448
2010-04-16 06:14:10 +00:00
Gabor Greif 403e9694f9 back out r101423 and r101397, they break llvm-gcc self-host on darwin10
llvm-svn: 101434
2010-04-16 01:16:20 +00:00
Gabor Greif 33ae80bff7 reapply r101364, which has been backed out in r101368
with a fix

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary

llvm-svn: 101397
2010-04-15 20:51:13 +00:00
Gabor Greif 9fd00c7d25 back out r101364, as it trips the linux nightlybot on some clang C++ tests
llvm-svn: 101368
2010-04-15 12:46:56 +00:00
Gabor Greif aafd209632 rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary

llvm-svn: 101364
2010-04-15 10:49:53 +00:00
Dan Gohman bcaf681cde Add const qualifiers to CodeGen's use of LLVM IR constructs.
llvm-svn: 101334
2010-04-15 01:51:59 +00:00
Eric Christopher eabc9623da Allow lowering for palignr instructions for mmx sized vectors. Add
patterns to handle the lowering.

llvm-svn: 101331
2010-04-15 01:40:20 +00:00
Dan Gohman c87b74d913 Delete unneeeded arguments.
llvm-svn: 101276
2010-04-14 20:17:22 +00:00
Dan Gohman 7deb447781 Factor out EH landing pad code into a separate function, and constify
a bunch of stuff to support it.

llvm-svn: 101273
2010-04-14 19:53:31 +00:00
Douglas Gregor 9078f954bf Unbreak CMake build by improving the EnhancedDisassembly makefile a
bit (we're not trying to build a shared library yet) and generating
the X86GenEDInfo.inc and ARMGenEDInfo.inc files as necessary.

llvm-svn: 101188
2010-04-13 22:47:43 +00:00
Sean Callanan 814e69b171 Fixed a nasty layering violation in the edis source
code.  It used to #include the enhanced disassembly
information for the targets it supported straight
out of lib/Target/{X86,ARM,...} but now it uses a
new interface provided by MCDisassembler, and (so
far) implemented by X86 and ARM.

Also removed hacky #define-controlled initialization
of targets in edis.  If clients only want edis to
initialize a limited set of targets, they can set
--enable-targets on the configure command line.

llvm-svn: 101179
2010-04-13 21:21:57 +00:00
Evan Cheng 4ca4bc6f95 Re-apply 101075 and fix it properly. Just reuse the debug info of the branch instruction being optimized. There is no need to --I which can deref off start of the BB.
llvm-svn: 101162
2010-04-13 18:50:27 +00:00
Eric Christopher d67f66dc0c Temporarily revert r101075, it's causing invalid iterator assertions
in a nightly tester.

llvm-svn: 101158
2010-04-13 18:37:58 +00:00
Dan Gohman 9d2d053e11 Eliminate MachineBasicBlock::const_livein_iterator and make
MachineBasicBlock::livein_iterator a const_iterator, because
clients shouldn't ever be using the iterator interface to
mutate the livein set.

llvm-svn: 101147
2010-04-13 16:57:55 +00:00
Evan Cheng d0d8e3343a Use .set expression for x86 pic jump table reference to reduce assembly relocation. rdar://7738756
llvm-svn: 101085
2010-04-12 23:07:17 +00:00
Bill Wendling b02bbe416f Micro-optimization:
If we have this situation:

    jCC  L1
    jmp  L2
L1:
  ...
L2:
  ...

We can get a small performance boost by emitting this instead:

    jnCC L2
L1:
  ...
L2:
  ...

This testcase shows an example of this:

float func(float x, float y) {
    double product = (double)x * y;
    if (product == 0.0)
        return product;
    return product - 1.0;
}

llvm-svn: 101075
2010-04-12 22:19:57 +00:00
Chris Lattner 5418dd5fda move elf section uniquing to MCContext. Along the way
merge XCore's section into MCSectionELF

llvm-svn: 100812
2010-04-08 21:26:26 +00:00
Chris Lattner 433d40695b remove the TargetLoweringObjectFileMachO::getMachoSection
api and update clients to use MCContext instead.

llvm-svn: 100808
2010-04-08 20:40:11 +00:00
Evan Cheng ebe47c872f Avoid using f64 to lower memcpy from constant string. It's cheaper to use i32 store of immediates.
llvm-svn: 100751
2010-04-08 07:37:57 +00:00
Eric Christopher c0f63cf7a9 mpsadbw is not commutative.
Fixes PR3440.

llvm-svn: 100736
2010-04-08 00:52:02 +00:00
Chris Lattner 2104b8d36e rename llvm::llvm_report_error -> llvm::report_fatal_error
llvm-svn: 100709
2010-04-07 22:58:41 +00:00
Sean Callanan 1efe661b46 Fixed a bug where the disassembler would allow an immediate
argument that had to be between 0 and 7 to have any value,
firing an assert later in the AsmPrinter.  Now, the
disassembler rejects instructions with out-of-range values
for that immediate.

llvm-svn: 100694
2010-04-07 21:42:19 +00:00
Dale Johannesen 60b289709e Educate GetInstrSizeInBytes implementations that
DBG_VALUE does not generate code.

llvm-svn: 100681
2010-04-07 19:51:44 +00:00
John McCall 6ac5cc973c Clean up some signedness oddities in this code noticed by clang.
llvm-svn: 100599
2010-04-07 01:49:15 +00:00
Dale Johannesen 5d7f0a0fdd Move printing of target-indepedent DEBUG_VALUE comments
into AsmPrinter.  Target-dependent form is still generated
by FastISel and still handled in X86 code.

llvm-svn: 100596
2010-04-07 01:15:14 +00:00
John McCall 796583eec0 Fix a number of clang -Wsign-compare warnings that didn't have an obvious
solution.  The only reason these don't fire with gcc-4.2 is that gcc turns off
part of -Wsign-compare in C++ on accident.

llvm-svn: 100581
2010-04-06 23:35:53 +00:00
Dale Johannesen b36c70913b Revert 100573, it's causing some testsuite problems.
llvm-svn: 100578
2010-04-06 22:45:26 +00:00
Dale Johannesen 85b35b6214 Move printing of DEBUG_VALUE comments to target-independent place.
There is probably a more elegant way to do this.

llvm-svn: 100573
2010-04-06 22:21:07 +00:00
Jim Grosbach 4dac890600 Fix PR6696 and PR6663
When a frame pointer is not otherwise required, and dynamic stack alignment
is necessary solely due to the spilling of a register with larger alignment
requirements than the default stack alignment, the frame pointer can be both
used as a general purpose register and a frame pointer. That goes poorly, for
obvious reasons. This patch brings back a bit of old logic for identifying
the use of such registers and conservatively reserves the frame pointer
during register allocation in such cases.

For now, implement for X86 only since it's 32-bit linux which is hitting this,
and we want a targeted fix for 2.7. As a follow-on, this will be expanded
to handle other targets, as theoretically the problem could arise elsewhere
as well.

llvm-svn: 100559
2010-04-06 20:26:37 +00:00
Jakob Stoklund Olesen 41051a0bfe Don't try to collapse DomainValues onto an incompatible SSE domain.
This fixes the Bullet regression on i386/nocona.

llvm-svn: 100553
2010-04-06 19:48:56 +00:00
Jakob Stoklund Olesen 1a9b3f3484 Properly enable load clustering.
Operand 2 on a load instruction does not have to be a RegisterSDNode for this to
work.

llvm-svn: 100497
2010-04-05 23:48:02 +00:00
Evan Cheng 23d16d5b86 Fix ADD32rr_alt instruction encoding bug. Patch by Marius Wachtler.
llvm-svn: 100480
2010-04-05 22:21:09 +00:00
Eric Christopher 1290fa0f72 Remove FIXME.
llvm-svn: 100466
2010-04-05 21:14:32 +00:00
Chris Lattner 305f2efb63 unthread MMI from FastISel
llvm-svn: 100416
2010-04-05 06:05:26 +00:00
Chris Lattner 82ff9af068 remove the MMI pointer from MachineFrameInfo.
llvm-svn: 100415
2010-04-05 05:57:52 +00:00
Jakob Stoklund Olesen b93331f3be Replace TSFlagsFields and TSFlagsShifts with a simpler TSFlags field.
When a target instruction wants to set target-specific flags, it should simply
set bits in the TSFlags bit vector defined in the Instruction TableGen class.

This works well because TableGen resolves member references late:

class I : Instruction {
  AddrMode AM = AddrModeNone;
  let TSFlags{3-0} = AM.Value;
}

let AM = AddrMode4 in
def ADD : I;

TSFlags gets the expected bits from AddrMode4 in this example.

llvm-svn: 100384
2010-04-05 03:10:20 +00:00
Chris Lattner 7cfa70e9b3 fastisel doesn't need DwarfWriter, remove some tendricles.
llvm-svn: 100381
2010-04-05 02:19:28 +00:00
Chris Lattner 626cb66fdb just have all targets create the DwarfWriter.
llvm-svn: 100377
2010-04-05 00:42:55 +00:00
Chris Lattner 8b30492da3 simplify various getAnalysisUsage implementations.
llvm-svn: 100376
2010-04-05 00:38:44 +00:00
Chris Lattner 324c86600d eliminate the magic AbsoluteDebugSectionOffsets MAI hook,
which is really a property of the section being referenced.
Add a predicate to MCSection to replace it.

Yay for reduction in magic.

llvm-svn: 100367
2010-04-04 23:22:29 +00:00
Jakob Stoklund Olesen d03ac95d5d Clean up SSEDomainFix pass.
Restrict bit mask operations to the DomainValue class. Rename methods for
clarity.

llvm-svn: 100353
2010-04-04 21:27:26 +00:00
Chris Lattner 7bde8c07a7 clean up the asmprinter header and privatize some stuff.
llvm-svn: 100342
2010-04-04 18:52:31 +00:00
Jakob Stoklund Olesen 42caaa4f5b Switch SSEDomainFix to SpecificBumpPtrAllocator.
llvm-svn: 100332
2010-04-04 18:00:21 +00:00
Chris Lattner d20699bc87 Momentous day: remove the "O" member from AsmPrinter. Now all
"asm printering" happens through MCStreamer.  This also 
Streamerizes PIC16 debug info, which escaped my attention.

This removes a leak from LLVMTargetMachine of the 'legacy'
output stream.

llvm-svn: 100327
2010-04-04 08:18:47 +00:00
Chris Lattner d479317d65 streamerize printing of dbg_value, the x86 backend is now fully
streamerized for everything.

llvm-svn: 100316
2010-04-04 05:40:34 +00:00
Chris Lattner bf43d4b6e9 split DEBUG_VALUE printing stuff out to its own method.
llvm-svn: 100315
2010-04-04 05:38:19 +00:00
Chris Lattner 9b13639f45 mc'ize elf stub printing, convert cygwin stuff to EmitRawText,
which will abort in .o file writing mode.

llvm-svn: 100314
2010-04-04 05:35:04 +00:00
Chris Lattner 3bb09768cb fix PrintAsmOperand and PrintAsmMemoryOperand to pass down
raw_ostream to print to.

llvm-svn: 100313
2010-04-04 05:29:35 +00:00
Chris Lattner 787253819a use predicates in DBG_VALUE printing code to simplify it.
llvm-svn: 100312
2010-04-04 05:21:31 +00:00
Chris Lattner 562e02e4e1 remove more implicit uses of "O".
llvm-svn: 100311
2010-04-04 05:19:20 +00:00
Chris Lattner 7012916275 fix an ugly wart in the MCInstPrinter api where the
raw_ostream to print an instruction to had to be specified
at MCInstPrinter construction time instead of being able
to pick at each call to printInstruction.

llvm-svn: 100307
2010-04-04 05:04:31 +00:00
Chris Lattner 76c564b1bb change a ton of code to not implicitly use the "O" raw_ostream
member of AsmPrinter.  Instead, pass it in explicitly.

llvm-svn: 100306
2010-04-04 04:47:45 +00:00
Mon P Wang c576ee9040 Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)

llvm-svn: 100304
2010-04-04 03:10:48 +00:00
Chris Lattner f33c7fcc28 asmstreamerize the .size directive for function bodies, force clients
of printOffset to pass in a stream to print to.

llvm-svn: 100296
2010-04-03 22:28:33 +00:00
Eric Christopher 000e502eb1 Rewrite aesimc handling. It only takes a single input and has a single
dest.

llvm-svn: 100252
2010-04-02 23:48:33 +00:00
Eric Christopher 2ef63183a5 Separate out the AES-NI instructions from the SSE4.2 instructions. Add
a new subtarget option for AES and check for the support.  Add "westmere"
line of processors and add AES-NI support to the core i7.

Add a couple of TODOs for information I couldn't verify.

llvm-svn: 100231
2010-04-02 21:54:27 +00:00
Sean Callanan 010b373cf3 Fixes to the X86 disassembler. The disassembler will now
return an error status in all failure cases, printing
messages to debugs() only when debugging is enabled.

llvm-svn: 100229
2010-04-02 21:23:51 +00:00
Chris Lattner 6f306d7d30 use DebugLoc default ctor instead of DebugLoc::getUnknownLoc()
llvm-svn: 100214
2010-04-02 20:16:16 +00:00
Evan Cheng 61399375a2 Correctly lower memset / memcpy of undef. It should be a nop. PR6767.
llvm-svn: 100208
2010-04-02 19:36:14 +00:00
Mon P Wang 999c1b927b Revert r100191 since it breaks objc in clang
llvm-svn: 100199
2010-04-02 18:43:02 +00:00
Mon P Wang a972ab8564 Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)

llvm-svn: 100191
2010-04-02 18:04:15 +00:00
Eric Christopher 06a1639b98 Remove FIXME - if there's a better way to do this it isn't here.
llvm-svn: 100176
2010-04-02 04:32:37 +00:00
Dale Johannesen 4244d12769 Teach AnalyzeBranch, RemoveBranch and the branch
folder to be tolerant of debug info following the
branch(es) at the end of a block.

llvm-svn: 100168
2010-04-02 01:38:09 +00:00
Chandler Carruth 8d6d0d4c58 Disambiguate conditional expression for newer GCCs.
llvm-svn: 100167
2010-04-02 01:31:24 +00:00
Eric Christopher 5342ddaadf Revert r100143.
llvm-svn: 100146
2010-04-01 22:54:42 +00:00
Evan Cheng f997c31598 In 64-bit mode, use i64 to lower memcpy / memset instead of f64.
llvm-svn: 100137
2010-04-01 20:27:45 +00:00
Evan Cheng d9929f03cf Add comments about DstAlign and SrcAlign.
llvm-svn: 100132
2010-04-01 20:10:42 +00:00
Evan Cheng 4c014c892a - Avoid using floating point stores to implement memset unless the value is zero.
- Do not try to infer GV alignment unless its type is sized. It's not possible to infer alignment if it has opaque type.

llvm-svn: 100118
2010-04-01 18:19:11 +00:00
Evan Cheng 43cd9e3845 Fix sdisel memcpy, memset, memmove lowering:
1. Makes it possible to lower with floating point loads and stores.
2. Avoid unaligned loads / stores unless it's fast.
3. Fix some memcpy lowering logic bug related to when to optimize a
   load from constant string into a constant.
4. Adjust x86 memcpy lowering threshold to make it more sane.
5. Fix x86 target hook so it uses vector and floating point memory
   ops more effectively.
rdar://7774704

llvm-svn: 100090
2010-04-01 06:04:33 +00:00
Evan Cheng 738b0f9ec7 Nehalem unaligned memory access is fast.
llvm-svn: 100089
2010-04-01 05:58:17 +00:00
Eric Christopher 9002ac5d93 Add aeskeygenassist intrinsic and rename all of the aes intrinsics to
aes instead of sse4.2.  Add a brief todo for a subtarget flag and rework
the aeskeygenassist instruction to more closely match the docs.

llvm-svn: 100078
2010-04-01 03:05:45 +00:00
Chris Lattner 503a0ef6f4 reduce indentation, minor cleanups.
llvm-svn: 100042
2010-03-31 20:32:51 +00:00
Jakob Stoklund Olesen 58ca0a649c Use spaces, not tabs
llvm-svn: 100037
2010-03-31 20:05:12 +00:00
Bill Wendling d749aefbd5 Comment the changes for r98218 and friends inside the source code.
llvm-svn: 100033
2010-03-31 18:48:58 +00:00
Jakob Stoklund Olesen 4cd5866f8e Fix PR6750. Don't try to merge a DomainValue with itself.
llvm-svn: 100016
2010-03-31 17:13:16 +00:00
Jakob Stoklund Olesen 9986ba954c Replace V_SET0 with variants for each SSE execution domain.
llvm-svn: 99975
2010-03-31 00:40:13 +00:00
Jakob Stoklund Olesen 710c6892be Fix typo. Thank you, valgrind.
llvm-svn: 99974
2010-03-31 00:40:08 +00:00
Jakob Stoklund Olesen 6f6ebb663c Enable -sse-domain-fix by default. Now with tests!
llvm-svn: 99954
2010-03-30 22:47:00 +00:00
Jakob Stoklund Olesen 3493398f13 V_SETALLONES is an integer instruction.
Since it is just a pxor in disguise, we should probably expand it to a full
polymorphic triple.

llvm-svn: 99953
2010-03-30 22:46:55 +00:00
Jakob Stoklund Olesen dbff4e8103 Renumber SSE execution domains for better code size.
SSEDomainFix will collapse to the domain with the lower number when it has a
choice. The SSEPackedSingle domain often has smaller instructions, so prefer
that.

llvm-svn: 99952
2010-03-30 22:46:53 +00:00
Bob Wilson 6f7fd28824 Revert Mon Ping's change 99928, since it broke all the llvm-gcc buildbots.
llvm-svn: 99948
2010-03-30 22:27:04 +00:00
Jakob Stoklund Olesen cf35648ebe Revert "Enable -sse-domain-fix by default. What could possibly go wrong?"
Not running 'make check-all' before committing is a bad idea.

llvm-svn: 99933
2010-03-30 21:36:32 +00:00
Jakob Stoklund Olesen a654df84e6 Enable -sse-domain-fix by default. What could possibly go wrong?
llvm-svn: 99931
2010-03-30 21:09:31 +00:00
Mon P Wang 7460571381 Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
A update of langref will occur in a subsequent checkin.

llvm-svn: 99928
2010-03-30 20:55:56 +00:00
Jakob Stoklund Olesen 3b9af40938 Add cross-block inference to SSEDomainFix.
llvm-svn: 99916
2010-03-30 20:04:01 +00:00
Eric Christopher 6ad8167714 Remove the pmulld intrinsic and autoupdate it as a vector multiply.
Rewrite the pmulld patterns, and make sure that they fold in loads of
arguments into the instruction.

llvm-svn: 99910
2010-03-30 18:49:01 +00:00
Chris Lattner 9897043928 Rip out the 'is temporary' nonsense from the MCContext interface to
create symbols.  It is extremely error prone and a source of a lot
of the remaining integrated assembler bugs on x86-64.

This fixes rdar://7807601.

llvm-svn: 99902
2010-03-30 18:10:53 +00:00
Eric Christopher c1ddaaf5b1 Add FIXME for operand promotion.
llvm-svn: 99859
2010-03-30 01:04:59 +00:00
Jakob Stoklund Olesen 486aa2eadc Be gentle to MSVC. C++ is hard, after all.
llvm-svn: 99855
2010-03-30 00:09:32 +00:00
Jakob Stoklund Olesen b551aa4da5 Basic implementation of SSEDomainFix pass.
Cross-block inference is primitive and wrong, but the pass is working otherwise.

llvm-svn: 99848
2010-03-29 23:24:21 +00:00
Benjamin Kramer 2788f797ca Make isInt?? and isUint?? template specializations of the generic versions. This
makes calls a little bit more consistent and allows easy removal of the
specializations in the future. Convert all callers to the templated functions.

llvm-svn: 99838
2010-03-29 21:13:41 +00:00
Eric Christopher 9bdadf0d99 We'll never match these as instructions, just as intrinsics so remove
the SDNodes.

llvm-svn: 99835
2010-03-29 20:41:51 +00:00
Chris Lattner 11f85ccf7d zap an extra line that Eli noticed!
llvm-svn: 99770
2010-03-28 18:52:28 +00:00
Chris Lattner 505849d277 remove a pattern with no testcase that doesn't appear to be
matchable: it seems like it would always constant fold.

llvm-svn: 99758
2010-03-28 08:40:48 +00:00
Chris Lattner 227a83d6ed revert r99743, this is saying that the repmovs instructinos have an
*input* of other type, which is the VT. 

llvm-svn: 99749
2010-03-28 07:38:39 +00:00
Chris Lattner be980f2df7 remove a bunch of dead patterns.
llvm-svn: 99748
2010-03-28 07:38:00 +00:00
Chris Lattner cba70c8162 claiming to return other is pointless.
llvm-svn: 99743
2010-03-28 05:57:36 +00:00
Chris Lattner ec5fe65838 fix some modelling problems exposed by a patch I'm working on. bsr/bsf/ptest
nodes all have an EFLAGS result when made by isel lowering.

llvm-svn: 99736
2010-03-28 05:07:17 +00:00
Chris Lattner 07943af506 eliminate the last of the parallel's!
llvm-svn: 99700
2010-03-27 02:47:14 +00:00
Chris Lattner c5e20d9031 eliminate almost all the rest of the x86-32 parallels.
llvm-svn: 99686
2010-03-27 00:45:04 +00:00
Evan Cheng 3365fb1412 Do not sibcall if stack needs to be dynamically aligned.
llvm-svn: 99620
2010-03-26 16:26:03 +00:00
Evan Cheng 00a620c61e Allow trivial sibcall of vararg callee when no arguments are being passed.
llvm-svn: 99598
2010-03-26 02:13:13 +00:00
Daniel Dunbar d919276bc0 Fix -Asserts warning, again.
llvm-svn: 99542
2010-03-25 19:35:53 +00:00
Jakob Stoklund Olesen 3758ff917e Tag SSE2 integer instructions as SSEPackedInt.
llvm-svn: 99540
2010-03-25 18:52:04 +00:00
Jakob Stoklund Olesen f8d7eda663 Teach TableGen to understand X.Y notation in the TSFlagsFields strings.
Remove much horribleness from X86InstrFormats as a result. Similar
simplifications are probably possible for other targets.

llvm-svn: 99539
2010-03-25 18:52:01 +00:00
Jakob Stoklund Olesen 49e121d5e4 Add a late SSEDomainFix pass that twiddles SSE instructions to avoid domain crossings.
On Nehalem and newer CPUs there is a 2 cycle latency penalty on using a register
in a different domain than where it was defined. Some instructions have
equvivalents for different domains, like por/orps/orpd.

The SSEDomainFix pass tries to minimize the number of domain crossings by
changing between equvivalent opcodes where possible.

This is a work in progress, in particular the pass doesn't do anything yet. SSE
instructions are tagged with their execution domain in TableGen using the last
two bits of TSFlags. Note that not all instructions are tagged correctly. Life
just isn't that simple.

The SSE execution domain issue is very similar to the ARM NEON/VFP pipeline
issue handled by NEONMoveFixPass. This pass may become target independent to
handle both.

llvm-svn: 99524
2010-03-25 17:25:00 +00:00
Bob Wilson e543e7fcb1 Reapply Kevin's change 94440, now that Chris has fixed the limitation on
opcode values fitting in one byte (svn r99494).

llvm-svn: 99514
2010-03-25 16:36:14 +00:00
Chris Lattner 23bf99a97c eliminate a bunch more parallels now that scheduling
handles dead implicit results more aggressively.  More
to come, I think this is now just a data entry problem.

llvm-svn: 99486
2010-03-25 05:44:01 +00:00
Evan Cheng b07a29ecd4 Disable folding loads into tail call in 32-bit PIC mode. It can introduce illegal code like this:
addl    $12, %esp
        popl    %esi
        popl    %edi
        popl    %ebx
        popl    %ebp
        jmpl    *__Block_deallocator-L1$pb(%esi)  # TAILCALL

The problem is the global base register is assigned GR32 register class. TCRETURNmi needs the registers making up the address mode to have the GR32_TC register class.

The *proper* fix is for X86DAGToDAGISel::getGlobalBaseReg() to return a copy from the global base register of the machine function rather than returning the register itself. But that has the potential of causing it to be coalesced to a more restrictive register class: GR32_TC. It can introduce additional copies and spills. For something as important the PIC base, it's not worth it especially since this is not an issue on 64-bit.

llvm-svn: 99455
2010-03-25 00:10:31 +00:00
Bob Wilson 5b2da69f6d Speculatively revert this to see if it fixes buildbot failures.
--- Reverse-merging r99440 into '.':
U    test/MC/AsmParser/X86/x86_32-bit_cat.s
U    test/MC/AsmParser/X86/x86_32-encoding.s
U    include/llvm/IntrinsicsX86.td
U    include/llvm/CodeGen/SelectionDAGNodes.h
U    lib/Target/X86/X86InstrSSE.td
U    lib/Target/X86/X86ISelLowering.h

llvm-svn: 99450
2010-03-24 23:26:29 +00:00
Kevin Enderby f5584a7397 Added the Advanced Encryption Standard (AES) Instructions.
llvm-svn: 99440
2010-03-24 22:33:33 +00:00
Kevin Enderby b96eb68497 Fixed the SS42AI template for the SSE 4.2 instructions with TA prefix so it does
not get an "Unknown immediate size" assert failure when used.  All instructions 
of this form have an 8-bit immediate.  Also added a test case of an example
instruction that is of this form.

llvm-svn: 99435
2010-03-24 22:28:42 +00:00
Nate Begeman 2ceb288416 Per chris's request, add some comments.
llvm-svn: 99434
2010-03-24 22:19:06 +00:00
Nate Begeman 583e05d8ce BUILD_VECTOR was missing out on some prime opportunities to use SSE 4.1 inserts.
llvm-svn: 99423
2010-03-24 20:49:50 +00:00
Chris Lattner 9096bcdeda Switch INC8r to defining its pattern in terms of X86inc_flag
and defining the add pattern with Pat<>, eliminating a use of
parallel.

llvm-svn: 99375
2010-03-24 01:02:12 +00:00
Chris Lattner f9c8bec6c5 switch SDTBinaryArithWithFlags to be a multiple-result node as well.
llvm-svn: 99370
2010-03-24 00:49:29 +00:00
Chris Lattner db1ac3cf3e Switch SDTUnaryArithWithFlags to being modeled as a two-result
ISD node.  The only change in the generated isel code are comments
like:

<                 // Src: (X86dec_flag:i16 GR16:i16:$src)
---
>                 // Src: (X86dec_flag:i16:i32 GR16:i16:$src)

because now it knows that X86dec_flag returns both an i16 (for the result)
and an i32 (for EFLAGS) in this case.  Wewt.

llvm-svn: 99369
2010-03-24 00:47:47 +00:00
Chris Lattner cca83a7aa4 remove 64-bit or_is_add parallels.
llvm-svn: 99360
2010-03-24 00:16:52 +00:00
Chris Lattner f5e5004327 remove useless or_is_add parallel's.
llvm-svn: 99359
2010-03-24 00:15:23 +00:00
Chris Lattner 237d38e748 reduce nesting.
llvm-svn: 99358
2010-03-24 00:12:57 +00:00
Jakob Stoklund Olesen a86ccbfe88 Revert "Add a late SSEDomainFix pass that twiddles SSE instructions to avoid domain crossings."
This reverts commit 99345. It was breaking buildbots.

llvm-svn: 99352
2010-03-23 23:48:51 +00:00
Jakob Stoklund Olesen 31da45b7af Add a late SSEDomainFix pass that twiddles SSE instructions to avoid domain crossings.
This is work in progress. So far, SSE execution domain tables are added to
X86InstrInfo, and a skeleton pass is enabled with -sse-domain-fix.

llvm-svn: 99345
2010-03-23 23:14:44 +00:00
Evan Cheng b6dee6e015 Teach isSafeToClobberEFLAGS to ignore dbg_value's. We need a MachineBasicBlock::iterator that does this automatically?
llvm-svn: 99320
2010-03-23 20:35:45 +00:00
Daniel Dunbar 86face8333 MC: Add TargetAsmBackend::MayNeedRelaxation, for checking whether a particular instruction + fixups might need relaxation.
llvm-svn: 99249
2010-03-23 03:13:05 +00:00
Daniel Dunbar a9ae3ae698 MC: Add TargetAsmBackend::WriteNopData and use to eliminate some target dependencies in MCMachOStreamer and MCAssembler.
llvm-svn: 99248
2010-03-23 02:36:58 +00:00
Daniel Dunbar e0c43577c1 MC: Add TargetAsmBackend::RelaxInstruction callback, and custom X86 implementation.
llvm-svn: 99245
2010-03-23 01:39:09 +00:00
Daniel Dunbar fbd12cc36c MC/X86: Fix an MCOperand link, when we parsing shrld $1,%eax and friends; I believe this fixes the last memory leaks under test/MC.
llvm-svn: 99102
2010-03-20 22:36:38 +00:00
Daniel Dunbar fed917e078 TargetRegistry: Fix create{AsmInfo,MCDisassembler} to return non-const objects.
llvm-svn: 99097
2010-03-20 22:36:22 +00:00
Evan Cheng 3f6f769c4f If call result is in ST0 and it is not being passed to the caller's
caller, then it is not safe to optimize the call into a sibcall since
the call result has to be popped off the x87 stack.

llvm-svn: 99032
2010-03-20 02:58:15 +00:00
Chris Lattner 8352941b34 remove the patterns that I commented out in r98930, Dan verified
that they are dead.

llvm-svn: 99000
2010-03-19 21:43:36 +00:00
Kevin Enderby cf0843ed93 Fixed the encoding problems of the crc32 instructions. All had the Operand size
override prefix and only the r/m16 forms should have had that.  Also for variant
one, the AT&T syntax, added suffixes to all forms.  Also added the missing
64-bit form for 'CRC32 r64, r/m8'.  Plus added test cases for all forms and
tweaked one test case to add the needed suffixes.

llvm-svn: 98980
2010-03-19 20:04:42 +00:00
Daniel Dunbar c532697372 MC/X86: Rename alternate spellings of {ADD64,CMP64} and mark as "code gen only" so they don't get selected by the asm matcher.
llvm-svn: 98972
2010-03-19 18:07:48 +00:00
Daniel Dunbar 4d7c8645fd MC: Add TargetAsmBackend::createObjectWriter.
- MCAssembler is now object-file independent, although we will surely need more work to fully support ELF/COFF.

llvm-svn: 98955
2010-03-19 10:43:26 +00:00
Daniel Dunbar eaa367f5ae MCCodeEmitter: Add target independent fixup flag for is-pc-relative.
llvm-svn: 98954
2010-03-19 10:43:23 +00:00
Daniel Dunbar c5084cccc8 MC: Add TargetAsmBackend::isVirtualSection hook.
llvm-svn: 98950
2010-03-19 09:29:03 +00:00
Daniel Dunbar f0517efc6c MCAssembler: Move ApplyFixup to the TargetAsmBackend, this is a target specific not object writer specific task.
llvm-svn: 98947
2010-03-19 09:28:12 +00:00
Chris Lattner 83aeaab462 add a new SDNPVariadic SDNP node flag, and use it in
dag isel gen instead of instruction properties.  This
allows the oh-so-useful behavior of matching a variadic
non-root node.

llvm-svn: 98934
2010-03-19 05:07:09 +00:00
Chris Lattner 607795f917 comment out a bunch of parallel store patterns that apparently
can't match or just have no testcases.  Will remove after 
confirmation from dan that they really are dead.

llvm-svn: 98930
2010-03-19 04:14:21 +00:00
Daniel Dunbar c9deca20e8 X86: Fix encoding for TEST64rr.
llvm-svn: 98919
2010-03-19 01:15:03 +00:00
Chris Lattner 83facb0812 Now that tblgen can handle matching implicit defs of instructions
to input patterns, we can fix X86ISD::CMP and X86ISD::BT as taking
two inputs (which have to be the same type) and *returning an i32*.
This is how the SDNodes get made in the graph, but we weren't able
to model it this way due to deficiencies in the pattern language.

Now we can change things like this:

 def UCOM_FpIr80: FpI_<(outs), (ins RFP80:$lhs, RFP80:$rhs), CompareFP,
-                  [(X86cmp RFP80:$lhs, RFP80:$rhs),
-                   (implicit EFLAGS)]>; // CC = ST(0) cmp ST(i)
+                  [(set EFLAGS, (X86cmp RFP80:$lhs, RFP80:$rhs))]>;

and fix terrible crimes like this:

-def : Pat<(parallel (X86cmp GR8:$src1, 0), (implicit EFLAGS)),
+def : Pat<(X86cmp GR8:$src1, 0),
           (TEST8rr GR8:$src1, GR8:$src1)>;

This relies on matching the result of TEST8rr (which is EFLAGS, which is
an implicit def) to the result of X86cmp, an i32.

llvm-svn: 98903
2010-03-19 00:01:11 +00:00
Eric Christopher 5e95aee159 Couple of changes that Dan mentioned for llvm.stackprotector fast-isel.
llvm-svn: 98881
2010-03-18 21:58:33 +00:00
Daniel Dunbar 2ca1108254 X86MCCodeEmitter: Fix two minor issues with reloc_riprel_4byte_movq_load, we
were missing it on some movq instructions and were not including the appropriate
PCrel bias.

llvm-svn: 98880
2010-03-18 21:53:54 +00:00
Chris Lattner 0204bc3de1 outs come before ins.
llvm-svn: 98864
2010-03-18 20:50:06 +00:00
Eric Christopher 52ecfdf3c5 Make fast-isel understand llvm.stackprotector.
llvm-svn: 98862
2010-03-18 20:27:26 +00:00
Daniel Dunbar 63ec093b6e MC/X86/AsmMatcher: Use the new instruction cleanup routine to implement a
temporary workaround for matching inc/dec on x86_64 to the correct instruction.
 - This hack will eventually be replaced with a robust mechanism for handling
   matching instructions based on the available target features.

llvm-svn: 98858
2010-03-18 20:06:02 +00:00