1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Commit Graph

36700 Commits

Author SHA1 Message Date
Johnny Chen
dc6ad68a6d Removed the extra S from the multiclass def T2I_adde_sube_s_irs as well as from
the opc string passed in, since it's a given from the class inheritance of T2sI.
The fixed the extra 's' in adcss & sbcss when disassembly printing.

llvm-svn: 97582
2010-03-02 19:38:59 +00:00
Chris Lattner
0c14477270 run HandleMergeInputChains even if we only have one input chain.
llvm-svn: 97581
2010-03-02 19:34:59 +00:00
Dan Gohman
f06941597a When expanding an expression such as (A + B + C + D), sort the operands
by loop depth and emit loop-invariant subexpressions outside of loops.
This speeds up MultiSource/Applications/viterbi and others.

llvm-svn: 97580
2010-03-02 19:32:21 +00:00
Evan Cheng
a93cb01841 Swap parameters of isSafeToMove and isSafeToReMat for consistency.
llvm-svn: 97578
2010-03-02 19:03:01 +00:00
Evan Cheng
e335555959 Fix typo.
llvm-svn: 97577
2010-03-02 19:02:27 +00:00
Johnny Chen
88f05c26a5 Added 32-bit Thumb instructions: CPS, SDIV, UDIV, SXTB16, SXTAB16, UXTAB16, SEL,
SMMULR, SMMLAR, SMMLSR, TBB, TBH, and 16-bit Thumb instruction CPS for
disassembly only.

llvm-svn: 97573
2010-03-02 18:14:57 +00:00
Devang Patel
7de01928e9 Fix grammar.
Thanks Duncan!

llvm-svn: 97572
2010-03-02 17:58:15 +00:00
Johnny Chen
9b5f5645e4 AL is an optional mnemonic extension for always, except in IT instructions.
Add printMandatoryPredicateOperand() PrintMethod for IT predicate printing.

Ref: A8.3 Conditional execution
llvm-svn: 97571
2010-03-02 17:57:15 +00:00
Johnny Chen
ddbf29a06c Change some asm shift opcode strings to lowercase.
llvm-svn: 97567
2010-03-02 17:03:18 +00:00
Xerxes Ranby
8f57e7907a fix typo add missing (
llvm-svn: 97565
2010-03-02 13:42:03 +00:00
Xerxes Ranby
1adef1fad2 Unbreak llvm-arm-linux buildbot and fix PR5309.
llvm-svn: 97564
2010-03-02 13:26:18 +00:00
Duncan Sands
5a60a368dd Rather than passing "false" for InsertBefore, AddressSpace for ThreadLocal,
and nothing for AddressSpace, pass 0 for InsertBefore, "false" for ThreadLocal
and AddressSpace for AddressSpace.  Spotted by gcc-4.5.

llvm-svn: 97563
2010-03-02 11:18:43 +00:00
Chris Lattner
2019e2922f Fix the xfail I added a couple of patches back. The issue
was that we weren't properly handling the case when interior
nodes of a matched pattern become dead after updating chain
and flag uses.  Now we handle this explicitly in 
UpdateChainsAndFlags.

llvm-svn: 97561
2010-03-02 07:50:03 +00:00
Chris Lattner
d23cbd049d I was confused about this, it turns out that MorphNodeTo
*does* delete ex-operands that become dead.

llvm-svn: 97559
2010-03-02 07:14:49 +00:00
Chris Lattner
bd1d913a9d factor node morphing out to its own helper method.
llvm-svn: 97558
2010-03-02 06:55:04 +00:00
Chris Lattner
1707a88a2c Sink InstructionSelect() out of each target into SDISel, and rename it
DoInstructionSelection.  Inline "SelectRoot" into it from DAGISelHeader.
Sink some other stuff out of DAGISelHeader into SDISel.

Eliminate the various 'Indent' stuff from various targets, which dates
to when isel was recursive.

 17 files changed, 114 insertions(+), 430 deletions(-)

llvm-svn: 97555
2010-03-02 06:34:30 +00:00
Eric Christopher
ca6b8de375 Only save vector registers if we've defined for the vector registers.
Fixes PR5309.

llvm-svn: 97554
2010-03-02 06:25:00 +00:00
Erick Tryzelaar
24ec58b50b Fix looking up MD names to not need a module.
llvm-svn: 97550
2010-03-02 05:32:52 +00:00
Eric Christopher
c62736d200 Add file to CMakeLists.txt
llvm-svn: 97545
2010-03-02 02:49:43 +00:00
Evan Cheng
291c815b10 Add skeleton of a machine level cse pass.
llvm-svn: 97543
2010-03-02 02:38:24 +00:00
Chris Lattner
9a28d163c2 Use the right induction variable.
llvm-svn: 97541
2010-03-02 02:37:23 +00:00
Chris Lattner
0b41a42411 Rewrite chain handling validation and input TokenFactor handling
stuff now that we don't care about emulating the old broken 
behavior of the old isel.  This eliminates the 
'CheckChainCompatible' check (along with IsChainCompatible) which
did an incorrect and inefficient scan *up* the chain nodes which
happened as the pattern was being formed and does the validation
at the end in HandleMergeInputChains when it forms a structural 
pattern.  This scans "down" the graph, which means that it is
quickly bounded by nodes already selected.  This also handles
token factors that get "trapped" in the dag.

Removing the CheckChainCompatible nodes also shrinks the 
generated tables by about 6K for X86 (down to 83K).

There are two pieces remaining before I can nuke PreprocessRMW:
1. I xfailed a test because we're now producing worse code in a 
   case that has nothing to do with the change: it turns out that
   our use of MorphNodeTo will leave dead nodes in the graph
   which (depending on how the graph is walked) end up causing
   bogus uses of chains and blocking matches.  This is really 
   bad for other reasons, so I'll fix this in a follow-up patch.

2. CheckFoldableChainNode needs to be improved to handle the TF.

llvm-svn: 97539
2010-03-02 02:22:10 +00:00
Dan Gohman
56a20fc5eb Fix several places to handle vector operands properly.
Based on a patch by Micah Villmow for PR6438.

llvm-svn: 97538
2010-03-02 02:14:38 +00:00
Dan Gohman
1625456786 Non-affine post-inc SCEV expansions have more code which must be
emitted after the increment. Make sure the insert position
reflects this. This fixes PR6453.

llvm-svn: 97537
2010-03-02 01:59:21 +00:00
Bill Wendling
5990930d72 Remove dead parameter passing.
llvm-svn: 97536
2010-03-02 01:55:18 +00:00
Devang Patel
8fffee565c Constructors and operators for anonymous aggregates does not names. Do not force empty AT_name attribute in such cases.
llvm-svn: 97533
2010-03-02 01:26:20 +00:00
Dan Gohman
37bf232609 Floating-point add, sub, and mul are now spelled fadd, fsub, and fmul,
respectively.

llvm-svn: 97531
2010-03-02 01:11:08 +00:00
Chris Lattner
53bd8b1717 remove dead code.
llvm-svn: 97529
2010-03-02 00:40:26 +00:00
Bob Wilson
12797a7a6c Don't attempt load PRE when there is no real redundancy (i.e., the load is in
a loop and is itself the only dependency).

llvm-svn: 97526
2010-03-02 00:09:29 +00:00
Chris Lattner
e6f86e288c refactor some code out of OPC_EmitMergeInputChains into a
new helper function.

llvm-svn: 97525
2010-03-02 00:00:03 +00:00
Bob Wilson
9207e3f81f When GVN needs to split critical edges for load PRE, check all of the
predecessors before returning.  Otherwise, if multiple predecessor edges need
splitting, we only get one of them per iteration.  This makes a small but
measurable compile time improvement with -enable-full-load-pre.

llvm-svn: 97521
2010-03-01 23:37:32 +00:00
Chris Lattner
745181da4b remove a little hack I did for the old isel, not needed
now that it is gone.

llvm-svn: 97516
2010-03-01 22:51:11 +00:00
Evan Cheng
c97b5fe4b9 MemoryDepAnalysis is not used if redundant load processing is disabled.
llvm-svn: 97512
2010-03-01 22:23:12 +00:00
Chris Lattner
4ecd0eb275 remove all but one version of SelectionDAG::MorphNodeTo
(the most general) the others are dead.

llvm-svn: 97511
2010-03-01 22:20:05 +00:00
Evan Cheng
c0a816fd16 Remove the optimize for code size limitation on r67917. Optimize 64-bit imul by constants into leas + shl regardless if optimizing for code size. The size saving from using imulq isn't worth it. Also, the lea and shl instructions may expose further optimization.
llvm-svn: 97507
2010-03-01 22:00:11 +00:00
Chris Lattner
fa3b904028 remove a terrible hack that disabled assertions from this file because of build time
problems.  rdar://7697850.

llvm-svn: 97500
2010-03-01 21:20:46 +00:00
Jakob Stoklund Olesen
fe3fae23e4 Use methods to determine if a LiveInterval is spillable.
Don't accidentally produce unspillable intervals for deeply nested loops.

llvm-svn: 97496
2010-03-01 20:59:38 +00:00
Ted Kremenek
328c095a12 Update CMake build.
llvm-svn: 97488
2010-03-01 19:42:47 +00:00
Chris Lattner
21ad1fd291 stop using generated sdnodexforms.
llvm-svn: 97485
2010-03-01 19:38:53 +00:00
Chris Lattner
ebb4fbf691 remove anders-aa from mainline, it isn't maintained and is
tantalyzing enough that people keep trying to use it.

llvm-svn: 97483
2010-03-01 19:24:17 +00:00
Johnny Chen
37f3172799 Added STRHT for disassembly only and fixed a bug in AI3sthpo class where the W
bit should be set to 0 instead of 1.

llvm-svn: 97481
2010-03-01 19:22:00 +00:00
Chris Lattner
b65ac4a796 Accelerate isel dispatch for tables that start with a top-level
OPC_SwitchOpcode to use a table lookup instead of having to go
through the interpreter for this.

llvm-svn: 97469
2010-03-01 18:47:11 +00:00
John McCall
e5b0ef9279 Don't potentially read past the end of the fill data when making a NaN from
an APInt.

llvm-svn: 97467
2010-03-01 18:38:45 +00:00
Dan Gohman
99c98139c7 Fix optimization of ISD::TRUNCATE on vector operands. Based on a patch
by Micah Villmow for PR6335.

llvm-svn: 97461
2010-03-01 17:59:21 +00:00
Dan Gohman
6b91ee1f38 Add explicit keywords.
llvm-svn: 97460
2010-03-01 17:56:46 +00:00
Dan Gohman
6d21428325 Add a comment.
llvm-svn: 97459
2010-03-01 17:56:04 +00:00
Dan Gohman
3691dbc5cf Add some debug output to LoopSimplify.
llvm-svn: 97458
2010-03-01 17:55:27 +00:00
Dan Gohman
c08c48c9f3 Spelling fixes.
llvm-svn: 97453
2010-03-01 17:49:51 +00:00
Dan Gohman
0d46f3e9e6 This is now done.
llvm-svn: 97450
2010-03-01 17:43:57 +00:00
Dan Gohman
47608d937a Fix a missing newline in debug output.
llvm-svn: 97449
2010-03-01 17:42:55 +00:00
Dan Gohman
25af6486ae Prune #includes.
llvm-svn: 97448
2010-03-01 17:42:17 +00:00
Dan Gohman
4fc1d1236f Don't print "Modified" for passes which haven't modified anything.
llvm-svn: 97446
2010-03-01 17:34:28 +00:00
Nathan Keynes
0226482410 Add JIT support to the TODO list (test commit)
llvm-svn: 97443
2010-03-01 10:40:41 +00:00
Chris Lattner
f62ad24616 some trivial microoptimizations.
llvm-svn: 97441
2010-03-01 07:43:08 +00:00
Chris Lattner
cdfa80eaaf eliminate the CheckMultiOpcodeMatcher code and have each
ComplexPattern at the root be generated multiple times, once
for each opcode they are part of.  This encourages factoring
because the opcode checks get treated just like everything
else in the matcher.

llvm-svn: 97439
2010-03-01 07:17:40 +00:00
Chris Lattner
8529ea0237 add a new OPC_SwitchOpcode which is semantically equivalent
to a scope where every child starts with a CheckOpcode, but
executes more efficiently.  Enhance DAGISelMatcherOpt to 
form it.

This also fixes a bug in CheckOpcode: apparently the SDNodeInfo
objects are not pointer comparable, we have to compare the
enum name.

llvm-svn: 97438
2010-03-01 06:59:22 +00:00
Mikhail Glushenkov
47b3719d4b 80-col violations/trailing whitespace.
llvm-svn: 97427
2010-02-28 22:54:30 +00:00
Chris Lattner
4408939f12 eliminate GetInt1/2
llvm-svn: 97426
2010-02-28 22:38:43 +00:00
Chris Lattner
afa7d2eacc hoist the new isel interpreter out of DAGISelHeader.h
(which gets #included into the middle of each 
target's DAGISel class) into a .cpp file where it is
only compiled once.

llvm-svn: 97425
2010-02-28 22:37:22 +00:00
Chris Lattner
61a0c6674e enhance the new isel to handle the 'node already exists'
case of MorphNodeTo directly.

llvm-svn: 97417
2010-02-28 21:36:14 +00:00
Chris Lattner
f6124c5583 simplify this code, return only ever has zero or one operands.
llvm-svn: 97408
2010-02-28 18:53:13 +00:00
John McCall
f3fa6eb2ad Properly clear all the extra bits in a significand when making a NaN from an
APInt.  Be certain to set the integer bit in an x87 extended-precision
significand so that we don't accidentally make a pseudo-NaN.

llvm-svn: 97382
2010-02-28 12:49:50 +00:00
John McCall
b6e6dd63ad Add an override to StringRef::getAsInteger which parses into an APInt.
It gets its own implementation totally divorced from the (presumably
performance-sensitive) routines which parse into a uint64_t.

Add APInt::operator|=(uint64_t), which is situationally much better than
using a full APInt.

llvm-svn: 97381
2010-02-28 09:55:58 +00:00
Erick Tryzelaar
c6e78e3503 Add support for global variables in an address space for llvm-c and ocaml.
llvm-svn: 97377
2010-02-28 09:46:13 +00:00
Erick Tryzelaar
08d9f8e8fe Add indirect br support to llvm-c and ocaml.
llvm-svn: 97376
2010-02-28 09:46:06 +00:00
Erick Tryzelaar
9401ea01cc Add metadata functions to llvm-c and ocaml.
llvm-svn: 97375
2010-02-28 09:45:59 +00:00
Chris Lattner
a6e6c1681f remove redundant instruction.
llvm-svn: 97374
2010-02-28 07:23:21 +00:00
Erick Tryzelaar
f7bbb83b17 Add the new builder arthmetic instructions to llvm-c and ocaml.
llvm-svn: 97372
2010-02-28 05:51:43 +00:00
Erick Tryzelaar
9c6bd15491 Add the new union arthmetic instructions to llvm-c and ocaml.
llvm-svn: 97371
2010-02-28 05:51:33 +00:00
Erick Tryzelaar
b405437c48 Add generic binary op and cast builder functions.
llvm-svn: 97370
2010-02-28 05:51:27 +00:00
Bob Wilson
6d8360b3d8 Revert r97245 which seems to be causing performance problems.
llvm-svn: 97366
2010-02-28 05:34:05 +00:00
John McCall
69bc985550 Teach APFloat how to create both QNaNs and SNaNs and with arbitrary-width
payloads.  APFloat's internal folding routines always make QNaNs now,
instead of sometimes making QNaNs and sometimes SNaNs depending on the
type.

llvm-svn: 97364
2010-02-28 02:51:25 +00:00
Dan Gohman
0799a41c48 Don't try to replace physical registers when doing CSE.
llvm-svn: 97360
2010-02-28 01:33:43 +00:00
Dan Gohman
4b0dac5a8d Add a flag to addPassesToEmit* to disable the Verifier pass run
after LSR, so that clients can opt in.

llvm-svn: 97357
2010-02-28 00:41:59 +00:00
Dan Gohman
3177cfd002 Implement XMM subregs.
Extracting the low element of a vector is now done with EXTRACT_SUBREG,
and the zero-extension performed by load movss is now modeled with
SUBREG_TO_REG, and so on.

Register-to-register movss and movsd are no longer considered copies;
they are two-address instructions which insert a scalar into a vector.

llvm-svn: 97354
2010-02-28 00:17:42 +00:00
Dan Gohman
303190c3a2 Don't unconditionally suppress hoisting of instructions with implicit
defs or uses. The regular def and use checking below covers them, and
can be more precise. It's safe to hoist an instruction with a dead
implicit def if the register isn't live into the loop header.

llvm-svn: 97352
2010-02-28 00:08:44 +00:00
Dan Gohman
99c6bcbc13 The mayHaveSideEffects flag is no longer used.
llvm-svn: 97348
2010-02-27 23:47:46 +00:00
Chris Lattner
a574e6c6cf remove a bogus pattern, which had the same pattern as STDU
but codegen'd differently.  This really wanted to use some
sort of subreg to get the low 4 bytes of the G8RC register
or something.  However, it's invalid and nothing is testing
it, so I'm just zapping the bogosity.

llvm-svn: 97345
2010-02-27 21:15:32 +00:00
Chris Lattner
d35abb1c89 fix an incorrect (overly conservative) predicate.
llvm-svn: 97316
2010-02-27 08:18:55 +00:00
Chris Lattner
ca018ea20b fix grammaro's pointed out by daniel
llvm-svn: 97313
2010-02-27 07:50:40 +00:00
Evan Cheng
94051bc37e Re-apply 97040 with fix. This survives a ppc self-host llvm-gcc bootstrap.
llvm-svn: 97310
2010-02-27 07:36:59 +00:00
Bill Wendling
eb07770194 The TType is always absptr on Mach-O...at least for now.
llvm-svn: 97295
2010-02-27 01:05:51 +00:00
Chris Lattner
93fd3ddf24 fix PR6414, a nondeterminism issue in IPSCCP which was because
of a subtle interation in a loop operating in densemap order.

llvm-svn: 97288
2010-02-27 00:07:42 +00:00
Chris Lattner
8e0bfd5ce0 Fix rdar://7694996 a miscompile of 183.equake from my patch yesterday,
confusing the old MAT variable with the new GlobalType one.  This caused
us to promote the @disp global pointer into:

@disp.body = internal global double*** undef

instead of:

@disp.body = internal global [3 x double**] undef

llvm-svn: 97285
2010-02-26 23:42:13 +00:00
Chris Lattner
995bac5839 remove dead code, by this point all uses of CI are gone.
llvm-svn: 97283
2010-02-26 23:35:25 +00:00
John McCall
bb9c3309b2 Make APFloat's string-parsing routines a bit safer against very large exponents.
llvm-svn: 97278
2010-02-26 22:20:41 +00:00
Bill Wendling
7b47904f6e A much cleaner (and less code!) way of inserting the correct amount of padding
for alignment into the LSDA. If the TType base offset is emitted, then put the
padding there. Otherwise, put it in the call site table length. There will be no
conflict between the two sites when placing the padding in one place.

llvm-svn: 97277
2010-02-26 22:17:52 +00:00
Johnny Chen
0f20ffea08 Added the follwoing 32-bit Thumb instructions for disassembly only:
o Parallel addition and subtraction, signed/unsigned
o Miscellaneous operations: QADD, QDADD, QSUB, QDSUB
o Unsigned sum of absolute differences [and accumulate]: USAD8, USADA8
o Signed/Unsigned saturate: SSAT, SSAT16, USAT, USAT16
o Signed multiply accumulate long (halfwords): SMLAL<x><y>
o Signed multiply accumulate/subtract [long] (dual): SMLAD[x], SMLALD[X], SMLSD[X], SMLSLD[X]
o Signed dual multiply add/subtract [long]: SMUAD[X], SMUSD[X]

llvm-svn: 97276
2010-02-26 22:04:29 +00:00
Jakob Stoklund Olesen
7221654c33 Merge PPC instructions FMRS and FMRD into a single FMR instruction.
This is possible because F8RC is a subclass of F4RC. We keep FMRSD around so
fextend has a pattern.

Also allow folding of memory operands on FMRSD.

llvm-svn: 97275
2010-02-26 21:53:24 +00:00
Bill Wendling
6928ef4c23 Comment typo.
llvm-svn: 97269
2010-02-26 21:31:01 +00:00
Jakob Stoklund Olesen
755ba2ee84 Use the right floating point load/store instructions in PPCInstrInfo::foldMemoryOperandImpl().
The PowerPC floating point registers can represent both f32 and f64 via the
two register classes F4RC and F8RC. F8RC is considered a subclass of F4RC to
allow cross-class coalescing. This coalescing only affects whether registers
are spilled as f32 or f64.

Spill slots must be accessed with load/store instructions corresponding to the
class of the spilled register. PPCInstrInfo::foldMemoryOperandImpl was looking
at the instruction opcode which is wrong.

X86 has similar floating point register classes, but doesn't try to fold
memory operands, so there is no problem there.

llvm-svn: 97262
2010-02-26 21:09:24 +00:00
Jakob Stoklund Olesen
5f10af3d88 Remove dead code
llvm-svn: 97261
2010-02-26 21:09:20 +00:00
Benjamin Kramer
db1d98a624 Replace a temporary std::string with SmallString.
llvm-svn: 97259
2010-02-26 20:28:29 +00:00
Dale Johannesen
516867fd79 Move dbg_value generation to target-independent FastISel,
as X86 is currently the only FastISel target.  Per review.

llvm-svn: 97255
2010-02-26 20:01:55 +00:00
Dale Johannesen
53dbd67b19 Add type printing for Metadata pseudo.
llvm-svn: 97251
2010-02-26 19:38:59 +00:00
Bob Wilson
139fdbd4d2 Move the EnableFullLoadPRE flag from a separate command-line option to an
argument of createGVNPass and set it automatically for -O3.

llvm-svn: 97245
2010-02-26 19:09:47 +00:00
Bob Wilson
cf20a07501 Remove unused "NoPRE" parameter in GVN and createGVNPass().
llvm-svn: 97235
2010-02-26 18:35:19 +00:00
Chris Lattner
2a0ccfc916 pass in more section kinds, enough to get the .align 0x90
stuff to emit optimal nops in the right places.

llvm-svn: 97233
2010-02-26 18:32:26 +00:00
Sanjiv Gupta
487b119dc9 The cloner has nothing to do if any of the main or ISR entrypoints are not
present in the module.

llvm-svn: 97232
2010-02-26 18:32:18 +00:00
Chris Lattner
3832b527d8 fix PR6435 another bug from the MallocInst elimination work.
llvm-svn: 97231
2010-02-26 18:23:13 +00:00
Sanjiv Gupta
8a971a1dc5 Reapply things reverted back in 97220, with the fixed test case.
llvm-svn: 97228
2010-02-26 17:59:28 +00:00
Dan Gohman
e382448355 movl is a cheaper way to materialize 0 without clobbering EFLAGS than movabsq.
llvm-svn: 97227
2010-02-26 16:49:27 +00:00
Richard Osborne
fe30a8a2c1 Fix XCoreTargetLowering::isLegalAddressingMode() to handle VoidTy.
Previously LoopStrengthReduce would sometimes be unable to find
a legal formula, causing an assertion failure.

llvm-svn: 97226
2010-02-26 16:44:51 +00:00
Chandler Carruth
78f5a17a0c Revert r97211 and r97213 to get the build green again.
llvm-svn: 97220
2010-02-26 08:43:09 +00:00
Sanjiv Gupta
56ab10dfb2 Currently in LLVM, names of libcalls are assigned during TargetLowering
object construction. There is no provision to change them when the 
code for a function generated. 
So we have to change these names while printing assembly.

llvm-svn: 97213
2010-02-26 07:31:15 +00:00
Sanjiv Gupta
7caf38490a Before converting an operand to mem, check if it is legal to do so.
llvm-svn: 97211
2010-02-26 07:27:35 +00:00
Dan Gohman
e794389ad0 Delete a bunch of redundant predicates.
llvm-svn: 97201
2010-02-26 01:14:30 +00:00
Bill Wendling
720095c22c Fix comments.
llvm-svn: 97200
2010-02-26 01:12:52 +00:00
Bill Wendling
173d797171 Add another (and hopefully the last) exception case, where once we recalculate
the alignment requirement, if it no longer makes the TType base offset overflow
into extra bytes, then we need to pad to those bytes ourselves.

llvm-svn: 97196
2010-02-26 00:43:54 +00:00
Bill Wendling
6c6c5e70e3 And should use the correct variable.
llvm-svn: 97193
2010-02-26 00:24:25 +00:00
Bill Wendling
30d82f42c4 Got assertion check backwards.
llvm-svn: 97192
2010-02-26 00:22:42 +00:00
Bill Wendling
788d3707a8 Catch a corner case where adding the padding to the "TType base offset" field
will eliminate the need for padding in the "Call site table length". E.g., if
we have this:

    GCC_except_table1:
    Lexception1:
        .byte   0xff  ## @LPStart Encoding = omit
        .byte   0x9b  ## @TType Encoding = indirect pcrel sdata4
        .byte   0x7f  ## @TType base offset
        .byte   0x03  ## Call site Encoding = udata4
        .byte   0x89  ## Call site table length

with padding of 1. We want to emit the padding like this:
 
    GCC_except_table1:
    Lexception1:
        .byte   0xff  ## @LPStart Encoding = omit
        .byte   0x9b  ## @TType Encoding = indirect pcrel sdata4
        .byte   0xff  ## @TType base offset
        .space  1,0   ## Padding
        .byte   0x03  ## Call site Encoding = udata4
        .byte   0x89  ## Call site table length

and not with padding on the "Call site table length" entry.

llvm-svn: 97183
2010-02-25 23:52:44 +00:00
Chris Lattner
8cb1dc746d rewrite OptimizeGlobalAddressOfMalloc to fix PR6422, some bugs
introduced when mallocinst was eliminated. 

llvm-svn: 97178
2010-02-25 22:33:52 +00:00
Bill Wendling
dd2bd801a2 Make comment more meaningful.
llvm-svn: 97169
2010-02-25 21:19:47 +00:00
Dan Gohman
17447493ea Fix ExpandVectorBuildThroughStack for the case where the
operands are themselves vectors. Based on a patch by
Micah Villmow for PR6338.

llvm-svn: 97165
2010-02-25 20:30:49 +00:00
Johnny Chen
47fd2a4774 Added the following 32-bit Thumb instructions for disassembly only: SMC, RFE,
and SRS.

llvm-svn: 97164
2010-02-25 20:25:24 +00:00
Johnny Chen
8737e46553 Added the 32-bit Thumb instructions (BXJ) for disassembly only.
llvm-svn: 97163
2010-02-25 19:05:29 +00:00
Johnny Chen
b05edcba36 Added the 32-bit Thumb instructions (MRS and MSR) for disassembly only.
llvm-svn: 97159
2010-02-25 18:46:43 +00:00
Kevin Enderby
11cce486ac This is a patch to the assembler frontend to detect when aligning a text
section with TextAlignFillValue and calls EmitCodeAlignment() instead of
calling EmitValueToAlignment().  This allows x86 assembly code to be aligned
with optimal nops.

llvm-svn: 97158
2010-02-25 18:46:04 +00:00
Daniel Dunbar
7448368e5b Fix TextAlignFillValue in a few places
llvm-svn: 97151
2010-02-25 18:07:10 +00:00
Johnny Chen
30a910f458 Added the following 16-bit Thumb instructions for disassembly only: YIELD, WFE,
WFI, SEV, SETEND.

llvm-svn: 97149
2010-02-25 17:51:03 +00:00
Dan Gohman
a15e497d94 Teach the constant folder about union types.
llvm-svn: 97142
2010-02-25 16:45:19 +00:00
Dan Gohman
f42f098d1d Remove code which assumes it knows how vectors are stored in memory.
llvm-svn: 97141
2010-02-25 16:05:33 +00:00
Dan Gohman
084112437d Revert r97064. Duncan pointed out that bitcasts are defined in
terms of store and load, which means bitcasting between scalar
integer and vector has endian-specific results, which undermines
this whole approach.

llvm-svn: 97137
2010-02-25 15:20:39 +00:00
Nick Lewycky
3fb5927aea Make the side-numbering of instructions used by metadata (which is needed to
keep track of instructions that return void) per-function. This fixes PR5278.

This breaks backwards compatibility with the metadata format. That's okay
because we haven't released the metadata bitcode yet.

llvm-svn: 97132
2010-02-25 08:30:17 +00:00
Dan Gohman
52ed61204b Make LoopSimplify change conditional branches in loop exiting blocks
which branch on undef to branch on a boolean constant for the edge
exiting the loop. This helps ScalarEvolution compute trip counts for
loops.

Teach ScalarEvolution to recognize single-value PHIs, when safe, and
ForgetSymbolicName to forget such single-value PHI nodes as apprpriate
in ForgetSymbolicName.

llvm-svn: 97126
2010-02-25 06:57:05 +00:00
Nick Lewycky
c443274bc1 Dump the presence of attached metadata even if we don't know what it is. This
format is not parsable, even if the module is legal. To get parsable output,
dump the module instead of the function or smaller, since metadata kind are
attached to the module (not the context).

llvm-svn: 97124
2010-02-25 06:53:04 +00:00
Nick Lewycky
e0601cb7f8 Modernize comment.
llvm-svn: 97121
2010-02-25 06:39:10 +00:00
Nick Lewycky
772e9deb48 Correct whitespace.
llvm-svn: 97120
2010-02-25 06:38:51 +00:00
Sanjiv Gupta
11798e6c79 Each field of auxiliary debug entry is only 1 byte long.
llvm-svn: 97108
2010-02-25 03:54:49 +00:00
Johnny Chen
bbe3592817 Added tNOP for disassembly only.
llvm-svn: 97105
2010-02-25 03:28:51 +00:00
Dan Gohman
8a2f0a6cd1 Truncate from i64 to i32 is "free" on x86-32, because it involves
just discarding one of the registers.

llvm-svn: 97100
2010-02-25 03:04:36 +00:00
Scott Michel
54b21d97ec Revert this patch for the time being. Needs more testing.
llvm-svn: 97099
2010-02-25 02:32:54 +00:00
Johnny Chen
13b9bd479f Added tSVC and tTRAP for disassembly only.
llvm-svn: 97098
2010-02-25 02:21:11 +00:00
Scott Michel
e76255b080 Large stack frame patch for the CellSPU: handle stack frames that exceed 8176
(511*16) bytes register displacement (D-form).

NOTE: This is a potential headache, given the SPU's local core limitations,
allowing the software developer to commit stack overrun suicide unknowingly.
Also, large SPU stack frames will cause code size explosion. But, one presumes
that the software developer knows what they're doing...

Contributed by Kalle.Raiskila@nokia.com, edited slightly before commit.

llvm-svn: 97091
2010-02-25 01:53:17 +00:00
Bill Wendling
1be1ea831e MC'ize padding when padding the ULEB128 value.
llvm-svn: 97087
2010-02-25 00:24:52 +00:00
Bill Wendling
e22e8b7621 LLVM puts padding bytes in the __gcc_except_tab section after the
GCC_except_table label but before the Lexception, which the FDE references.
This causes problems as the FDE does not point to the start of an LSDA chunk.

Use an unnormalized uleb128 for the call-site table length that includes the
padding.

llvm-svn: 97078
2010-02-24 23:34:35 +00:00
Chris Lattner
5ca790deef clean up various VT manipulations, patch by Micah Villmow! PR6337
llvm-svn: 97072
2010-02-24 22:44:06 +00:00
Jakob Stoklund Olesen
2b93d17560 Create a stack frame on ARM when
- Function uses all scratch registers AND
- Function does not use any callee saved registers AND
- Stack size is too big to address with immediate offsets.

In this case a register must be scavenged to calculate the address of a stack
object, and the scavenger needs a spare register or emergency spill slot.

llvm-svn: 97071
2010-02-24 22:43:17 +00:00
Bob Wilson
4ffb88d388 Check for comparisons of +/- zero when optimizing less-than-or-equal and
greater-than-or-equal SELECT_CCs to NEON vmin/vmax instructions.  This is
only allowed when UnsafeFPMath is set or when at least one of the operands
is known to be nonzero.

llvm-svn: 97065
2010-02-24 22:15:53 +00:00
Dan Gohman
424e8f22d0 Make getTypeSizeInBits work correctly for array types; it should return
the number of value bits, not the number of bits of allocation for in-memory
storage.

Make getTypeStoreSize and getTypeAllocSize work consistently for arrays and
vectors.

Fix several places in CodeGen which compute offsets into in-memory vectors
to use TargetData information.

This fixes PR1784.

llvm-svn: 97064
2010-02-24 22:05:23 +00:00
Chris Lattner
75062cedf7 convert cycle checker to smallptrset, add comments and make it
more elegant.

llvm-svn: 97059
2010-02-24 21:34:04 +00:00
Chris Lattner
fbafa903b5 revert david's patch which does not even build.
llvm-svn: 97057
2010-02-24 21:25:08 +00:00
David Greene
68c9ece3da Use a SmallPtrSet as suggested by Chris.
llvm-svn: 97056
2010-02-24 20:59:49 +00:00
Wesley Peck
63932c105a Adding function "lookupGCCName" to MBlazeIntrinsicInfo
Adding the function "lookupGCCName" to the MBlazeIntrinsicInfo
class to support the Clang MicroBlaze target.

Additionally, minor fixes which remove some unused PIC code 
(PIC is not supported yet in the MicroBlaze backend) and
removed some unused variables.

llvm-svn: 97054
2010-02-24 20:16:27 +00:00
Johnny Chen
41ab970549 Added Vector Swap (VSWPd and VSWPq) instructions for disassembly only.
A8.6.405

llvm-svn: 97052
2010-02-24 20:06:07 +00:00
Dan Gohman
4d65bd9c6a ConstantFoldInstOperands can theoretically return null if it
didn't fold anything.

llvm-svn: 97049
2010-02-24 19:31:47 +00:00
Dan Gohman
fa19b098dc Simplify this code; these casts aren't necessary.
llvm-svn: 97048
2010-02-24 19:31:06 +00:00
Jakob Stoklund Olesen
249caada0e Stay away from str <undef> in ARMLoadStoreOpt. This pass does not understand
<undef> operands, and can cause scavenger failures when it translates
<kill,undef> to <kill>.

llvm-svn: 97046
2010-02-24 18:57:08 +00:00
Johnny Chen
71bf8b1466 Fixed typo of opcodestr, should be "vst1", not "vld1".
llvm-svn: 97044
2010-02-24 18:00:40 +00:00
Dan Gohman
6aacf4728c Convert a few more backedge-taken count functions to use BackedgeTakenInfo.
llvm-svn: 97042
2010-02-24 17:31:30 +00:00
Daniel Dunbar
24c99e027e Speculatively revert r97011, "Re-apply 96540 and 96556 with fixes.", again in
the hopes of fixing PPC bootstrap.

llvm-svn: 97040
2010-02-24 17:05:47 +00:00
Daniel Dunbar
8adb7774dc Reapply r97010, the speculative revert failed.
llvm-svn: 97036
2010-02-24 08:48:04 +00:00
Daniel Dunbar
8b33ce41d0 Speculatively revert r97010, "Add an argument to PHITranslateValue to specify
the DominatorTree. ...", in hopes of restoring poor old PPC bootstrap.

llvm-svn: 97027
2010-02-24 06:55:22 +00:00
Dan Gohman
c0c6077fed When forming SSE min and max nodes for UGE and ULE comparisons, it's
necessary to swap the operands to handle NaN and negative zero properly.

Also, reintroduce logic for checking for NaN conditions when forming
SSE min and max instructions, fixed to take into consideration NaNs and
negative zeros. This allows forming min and max instructions in more
cases.

llvm-svn: 97025
2010-02-24 06:52:40 +00:00
Dan Gohman
c97d42a5d5 Fix indentation.
llvm-svn: 97024
2010-02-24 06:46:09 +00:00
Chris Lattner
52a02205d8 Change the scheduler from adding nodes in allnodes order
to adding them in a determinstic order (bottom up from 
the root) based on the structure of the graph itself.

This updates tests for some random changes, interesting
bits: CodeGen/Blackfin/promote-logic.ll no longer crashes.
I have no idea why, but that's good right?

CodeGen/X86/2009-07-16-LoadFoldingBug.ll also fails, but
now compiles to have one fewer constant pool entry, making
the expected load that was being folded disappear.  Since it
is an unreduced mass of gnast, I just removed it.

This fixes PR6370

llvm-svn: 97023
2010-02-24 06:11:37 +00:00
Chandler Carruth
541c3f0bcc Remove an unused variable. Was this intentional?
llvm-svn: 97022
2010-02-24 06:09:03 +00:00
Chris Lattner
b1b5df8a16 add node #'s to debug dumps.
llvm-svn: 97019
2010-02-24 04:24:44 +00:00
Johnny Chen
c31a44dd8b Added for disassembly VST1 (multiple single elements) which stores elements to
memory from three or four registers and VST2 (multiple two-element structures)
which stores to memory from two double-spaced registers.

A8.6.391 & A8.6.393

llvm-svn: 97018
2010-02-24 02:57:20 +00:00
Jim Grosbach
3eacf455a0 handle very large call frames when require SPAdj != 0 for Thumb1
llvm-svn: 97013
2010-02-24 02:15:43 +00:00
Jim Grosbach
6f72657d6e LowerCall() should always do getCopyFromReg() to reference the stack pointer.
Machine instruction selection is much happier when operands are in virtual
registers.

llvm-svn: 97012
2010-02-24 01:43:03 +00:00
Evan Cheng
5787cd9349 Re-apply 96540 and 96556 with fixes.
llvm-svn: 97011
2010-02-24 01:42:31 +00:00
Bob Wilson
437d85dd57 Add an argument to PHITranslateValue to specify the DominatorTree. If this
argument is non-null, pass it along to PHITranslateSubExpr so that it can
prefer using existing values that dominate the PredBB, instead of just
blindly picking the first equivalent value that it finds on a uselist.
Also when the DominatorTree is specified, have PHITranslateValue filter
out any result that does not dominate the PredBB.  This is basically just
refactoring the check that used to be in GetAvailablePHITranslatedSubExpr
and also in GVN.

Despite my initial expectations, this change does not affect the results
of GVN for any testcases that I could find, but it should help compile time.
Before this change, if PHITranslateSubExpr picked a value that does not
dominate, PHITranslateWithInsertion would then insert a new value, which GVN
would later determine to be redundant and would replace.  By picking a good
value to begin with, we save GVN the extra work of inserting and then
replacing a new value.

llvm-svn: 97010
2010-02-24 01:39:00 +00:00
Jakob Stoklund Olesen
a946f9eb7d DIV8r must define %AX since X86DAGToDAGISel::Select() sometimes uses it
instead of %AL/%AH.

llvm-svn: 97006
2010-02-24 00:39:35 +00:00
Chris Lattner
80c14ff96b make selectnodeto set the nodeid to -1. This makes it more akin to
creating a new node then replacing uses.

llvm-svn: 97000
2010-02-23 23:01:35 +00:00
Jakob Stoklund Olesen
3406ec2f57 Remember to handle sub-registers when moving imp-defs to a rematted instruction.
llvm-svn: 96995
2010-02-23 22:44:02 +00:00
Jakob Stoklund Olesen
cf29251712 Keep track of phi join registers explicitly in LiveVariables.
Previously, LiveIntervalAnalysis would infer phi joins by looking for multiply
defined registers. That doesn't work if the phi join is implicitly defined in
all but one of the predecessors.

llvm-svn: 96994
2010-02-23 22:43:58 +00:00
Evan Cheng
d1d1755a44 Fix rev 96389 by restricting the xform to mask that's either signbit or max signed value.
llvm-svn: 96990
2010-02-23 21:51:54 +00:00
Kevin Enderby
69d643ba20 This is the second patch to allow x86 code to be aligned with optimal nops.
With the compiler changed to use EmitCodeAlignment() it does change the
functionality.  But X86 assembly code assembled with llvm-mc does not change
its output.  For that we will eventually change the assembler frontend to
detect a '.align x, 0x90' when used in a section that 'hasInstructions' and use
EmitCodeAlignment, but will wait until we have better target hooks.

llvm-svn: 96988
2010-02-23 21:41:24 +00:00
Richard Osborne
92fb0be76b Don't mark call instruction as a barrier.
llvm-svn: 96983
2010-02-23 21:08:11 +00:00
Johnny Chen
7e4227c8e1 Added for disassembly VLD1 (multiple single elements) which loads memory into
three or four registers and VLD2 (multiple two-element structures) which loads
memory into two double-spaced registers.

A8.6.307 & A8.6.310

llvm-svn: 96980
2010-02-23 20:51:23 +00:00
Nicolas Geoffray
8b11b7ce2b Use the module's context instead of the global context.
llvm-svn: 96977
2010-02-23 19:42:44 +00:00
Chris Lattner
74715dd299 no need to override IsLegalToFold, the base implementation
disables load folding at -O0.

llvm-svn: 96973
2010-02-23 19:33:11 +00:00
Chris Lattner
f6e9f39042 fix a bug in findNonImmUse (used by IsLegalToFold) where nodes with
no id's would cause early exit allowing IsLegalToFold to return true
instead of false, producing a cyclic dag.

This was striking the new isel because it isn't using SelectNodeTo yet,
which theoretically is just an optimization.

llvm-svn: 96972
2010-02-23 19:32:27 +00:00
Chris Lattner
4d568129c4 Print node ID's in dumps and views if set.
llvm-svn: 96971
2010-02-23 19:31:18 +00:00
Wesley Peck
94cdac52e5 Adding the MicroBlaze backend.
The MicroBlaze is a highly configurable 32-bit soft-microprocessor for
use on Xilinx FPGAs. For more information see:
http://www.xilinx.com/tools/microblaze.htm
http://en.wikipedia.org/wiki/MicroBlaze

The current LLVM MicroBlaze backend generates assembly which can be
compiled using the an appropriate binutils assembler.

llvm-svn: 96969
2010-02-23 19:15:24 +00:00
Chris Lattner
45a2c36ddc use OutStreamer.EmitCodeAlignment for alignment in the text
segment.

llvm-svn: 96967
2010-02-23 18:46:22 +00:00
Chris Lattner
405e4a1d63 genericize MCAsmStreamer::EmitCodeAlignment to support other targets
so that it doesn't break them when the code generator starts using it.

llvm-svn: 96966
2010-02-23 18:44:31 +00:00
Richard Osborne
eb0446c12a ECALLF, ECALLT shouldn't be marked as barriers.
llvm-svn: 96964
2010-02-23 18:29:49 +00:00
Kevin Enderby
c11390f758 This is the first patch to put the needed bits in place to eventually allow code
to be aligned with optimal nops.  This patch does not change any functionality
and when the compiler is changed to use EmitCodeAlignment() it should also not
change the resulting output.  Once the compiler change is made and everything
looks good the next patch with the table of optimal X86 nops will be added to
WriteNopData() changing the output.  There are many FIXMEs in this patch which
will be removed when we have better target hooks (coming soon I hear).

llvm-svn: 96963
2010-02-23 18:26:34 +00:00
Richard Osborne
9abd3b3ca7 Mark unconditional branches as barriers. Found using -verify-machineinstrs
llvm-svn: 96960
2010-02-23 18:13:38 +00:00
David Greene
dad0944642 Speed up cycle checking significantly by caching results.
llvm-svn: 96956
2010-02-23 17:37:50 +00:00
Dan Gohman
b3bf4992c5 Don't do (X != Y) ? X : Y -> X for floating-point values; it doesn't
handle NaN properly.

Do (X une Y) ? X : Y  -> X if one of X and Y is not zero.

llvm-svn: 96955
2010-02-23 17:17:57 +00:00
Jim Grosbach
0525cd8596 Spelling. s/suppor /support /
llvm-svn: 96954
2010-02-23 17:16:27 +00:00
Dan Gohman
5a6b9ad7db Remove the code which constant-folded ptrtoint(inttoptr(x)+c) to
getelementptr. Despite only doing so in the case where x is a known
array object and c can be converted to an index within range, this
could still be invalid if c is actually the address of an object
allocated outside of LLVM. Also, SCEVExpander, the original motivation
for this code, has since been improved to avoid inttoptr+ptroint in
more cases.

llvm-svn: 96950
2010-02-23 16:35:41 +00:00
Richard Osborne
ff660d72eb Remove unused lowering function LowerJumpTable
llvm-svn: 96943
2010-02-23 14:17:20 +00:00
Richard Osborne
7387249531 Lower BR_JT on the XCore to a jump into a series of jump instructions.
llvm-svn: 96942
2010-02-23 13:25:07 +00:00
Mikhail Glushenkov
3cd3e0df5f Input files with empty suffixes must be passed to linker.
llvm-svn: 96927
2010-02-23 09:05:21 +00:00
Mikhail Glushenkov
ce7b3292dd Temporary disable response files.
They are giving us problems on Mac.

llvm-svn: 96925
2010-02-23 09:05:10 +00:00
Mikhail Glushenkov
c47f951a86 Implement order-preserving option forwarding.
Needed to correctly handle things like 'llvmc -framework Foo foo.o -framework
Bar bar.o' - before this commit all '-framework' options would've been grouped
together in the beginning.

Due to our dependence on CommandLine this turned out to be a giant hack; we will
migrate away from CommandLine eventually.

llvm-svn: 96922
2010-02-23 09:04:57 +00:00
Mikhail Glushenkov
232ae779ee Correct option forwarding: initial implementation.
Does not work, but the infrastructure changes are in place.

llvm-svn: 96920
2010-02-23 09:04:44 +00:00
Mikhail Glushenkov
d030cced3d New experimental/undocumented feature: 'works_on_empty'.
For now, just enough support to make -filelist work.

llvm-svn: 96918
2010-02-23 09:04:28 +00:00
Chris Lattner
e7f90b31ad disable two patterns that are using non-sensical result pattern types.
llvm-svn: 96903
2010-02-23 07:21:15 +00:00
Chris Lattner
684559d2ef remove a confused pattern that is trying to match an address
then use it as an MMX register (!?).

llvm-svn: 96901
2010-02-23 07:16:12 +00:00
Chris Lattner
03b5f3e853 remove a bunch of dead named arguments in input patterns,
though some look dubious afaict, these are all ok.

llvm-svn: 96899
2010-02-23 06:54:29 +00:00
Chris Lattner
4fb7a4c1c2 fix a type mismatch in this pattern, where we were using an i64 imm in a
place where an i32 imm was required, the old isel just got lucky.

This fixes CodeGen/X86/x86-64-and-mask.ll

llvm-svn: 96894
2010-02-23 06:09:57 +00:00
Bob Wilson
b3640f8018 Update memdep when load PRE inserts a new load, and add some debug output.
I don't have a small testcase for this.

llvm-svn: 96890
2010-02-23 05:55:00 +00:00
Chris Lattner
8a5eea0929 reapply my cellspu changes with a fix to not break the old isel.
llvm-svn: 96885
2010-02-23 05:30:43 +00:00
Dan Gohman
f1ac231d17 Revert 96854, 96852, and 96849, unbreaking test/CodeGen/CellSPU/i64ops.ll.
llvm-svn: 96871
2010-02-23 02:33:29 +00:00
Chris Lattner
42f0bd1d2c X86InstrInfoSSE.td declares PINSRW as having type v8i16,
don't alis it in the MMX .td file with a different width,
split into two X86ISD opcodes.  This fixes an x86 testcase.

llvm-svn: 96859
2010-02-23 02:07:48 +00:00
Johnny Chen
9077a6f901 Added versions of VCGE, VCGT, VCLE, and VCLT NEON instructions which compare to
(immediate #0) for disassembly only.

A8.6.283, A8.6.285, A8.6.287, A8.6.290

llvm-svn: 96856
2010-02-23 01:42:58 +00:00
Chris Lattner
cffb96542a fix hte last cellspu failure.
llvm-svn: 96854
2010-02-23 01:37:39 +00:00
Chris Lattner
0872bdfb41 hack around more crimes in instruction selection.
llvm-svn: 96852
2010-02-23 01:33:17 +00:00
Chris Lattner
c175e45976 the cell backend is making all sorts of unsafe and incorrect assumptions
about ownership and update policies.  It isn't clear why it is doing all
this lowering at isel time instead of in legalize.  This fixes fcmp64.ll

llvm-svn: 96849
2010-02-23 01:20:00 +00:00
Johnny Chen
b35408e8df Added VCEQ (immediate #0) NEON instruction for disassembly only.
A8.6.281

llvm-svn: 96838
2010-02-23 00:33:12 +00:00
Jakob Stoklund Olesen
890a5e50fc Dead code elimination
llvm-svn: 96837
2010-02-23 00:28:53 +00:00
Jeffrey Yasskin
d5509ca6a2 Fix viewCFG on Linux.
llvm-svn: 96834
2010-02-23 00:04:53 +00:00
Evan Cheng
d9816ef946 Instcombine constant folding can normalize gep with negative index to index with large offset. When instcombine objsize checking transformation sees these geps where the offset seemingly point out of bound, it should just return "i don't know" rather than asserting.
llvm-svn: 96825
2010-02-22 23:34:00 +00:00
Jim Grosbach
c4ab116a90 Updated version of r96634 (which was reverted due to failing 176.gcc and
126.gcc nightly tests. These failures uncovered latent bugs that machine DCE
could remove one half of a stack adjust down/up pair, causing PEI to assert.
This update fixes that, and the tests now pass.

llvm-svn: 96822
2010-02-22 23:10:38 +00:00
Jim Grosbach
4aea6e93c8 Clean up a bit and fix for when SPAdj != 0
llvm-svn: 96818
2010-02-22 22:54:55 +00:00
Jim Grosbach
8ae3bf1f1e The predicate index isn't fixed, so scan for it to make sure we get the proper
value.

Thumb2 uses the tADJCALLSTACK* instructions, and doesn't need t2 versions, so
remove the FIXME entry.

llvm-svn: 96817
2010-02-22 22:47:46 +00:00
Dan Gohman
97481fb5e0 Canonicalize ConstantInts to the right operand of commutative
operators.

The test difference is just due to the multiplication operands
being commuted (and thus requiring a more elaborate match). In
optimized code, that expression would be folded.

llvm-svn: 96816
2010-02-22 22:43:23 +00:00
Chris Lattner
4b14d5146f remove dupes now.
llvm-svn: 96811
2010-02-22 22:15:05 +00:00
Chris Lattner
d9ac0d21f4 move #includes earlier.
llvm-svn: 96810
2010-02-22 22:14:47 +00:00
Daniel Dunbar
2097684f80 MC/Mach-O: Remove non-sensical comment, and add a missing AddValueSymbols call.
llvm-svn: 96809
2010-02-22 22:08:57 +00:00
Dan Gohman
90cc88c00f Minor formatting cleanup.
llvm-svn: 96808
2010-02-22 22:07:27 +00:00
Dan Gohman
0a0f1d2ee2 Use Instruction::isCommutative instead of duplicating it.
llvm-svn: 96807
2010-02-22 22:05:18 +00:00
Johnny Chen
0e6c232f0e Added SEL, SXTB16, SXTAB16, UXTAB16, SMMULR, SMMLAR, SMMLSR, SMUAD, and SMUSD,
for disassembly only.

llvm-svn: 96806
2010-02-22 21:50:40 +00:00
Bob Wilson
e075edf725 Erase deleted instructions from GVN's ValueTable. This fixes assertion
failures from ValueTable::verifyRemoved() when using -debug.

llvm-svn: 96805
2010-02-22 21:39:41 +00:00
Johnny Chen
bdb1fdccfb Added a bunch of instructions for disassembly only:
o signed/unsigned add/subtract
o signed/unsigned halving add/subtract
o unsigned sum of absolute difference [and accumulate]
o signed/unsigned saturate
o signed multiply accumulate/subtract [long] dual

llvm-svn: 96795
2010-02-22 18:50:54 +00:00
Arnold Schwaighofer
8427969f9c Mark the return address stack slot as mutable when moving the return address
during a tail call. A parameter might overwrite this stack slot during the tail
call. 

The sequence during a tail call is:
1.) load return address to temp reg
2.) move parameters (might involve storing to return address stack slot)
3.) store return address to new location from temp reg

If the stack location is marked immutable CodeGen can colocate load (1) with the
store (3).

This fixes bug 6225.

llvm-svn: 96783
2010-02-22 16:18:09 +00:00
Dan Gohman
2575392bf1 Remove unused variables and parameters.
llvm-svn: 96780
2010-02-22 04:11:59 +00:00
Dan Gohman
835086ef52 Fix various doxygen warnings.
llvm-svn: 96779
2010-02-22 04:10:52 +00:00
Dan Gohman
733388cdcf Fix a typo in a comment.
llvm-svn: 96778
2010-02-22 04:09:26 +00:00
Dan Gohman
dcc3634e46 Constant-fold certain comparisons with infinity and negative infinity.
llvm-svn: 96777
2010-02-22 04:06:03 +00:00
Dan Gohman
c281a5da15 Remove the logic for reasoning about NaNs from the code that forms
SSE min and max instructions. The real thing this code needs to be
concerned about is negative zero.

Update the sse-minmax.ll test accordingly, and add tests for
-enable-unsafe-fp-math mode as well.

llvm-svn: 96775
2010-02-22 04:03:39 +00:00
Dan Gohman
c44dee5fbd When emitting an instruction which depends on both a post-incremented
induction variable value and a loop-variant value, don't force the
insert position to be at the post-increment position, because it may
not be dominated by the loop-variant value. This fixes a
use-before-def problem noticed on PPC.

llvm-svn: 96774
2010-02-22 03:59:54 +00:00
Dan Gohman
8c51905154 This cast<Instruction> is unnecessary.
llvm-svn: 96771
2010-02-22 02:07:36 +00:00
Chris Lattner
a739bef2eb fix an incorrect VT: eflags is always i32. The bug was causing us to
create an X86ISD::Cmp node with result type i64 on the 
CodeGen/X86/shift-i256.ll testcase and the new isel was assert on it
downstream.

llvm-svn: 96768
2010-02-22 00:28:59 +00:00
Daniel Dunbar
a6d1ef6ee9 MC/X86: Add stub AsmBackend.
llvm-svn: 96763
2010-02-21 21:54:14 +00:00
Daniel Dunbar
b6b58bff88 MC: Sketch registry support for target specific assembler backends.
llvm-svn: 96762
2010-02-21 21:53:53 +00:00
Anton Korobeynikov
0b402e1a61 It turned out that we failed to emit proper symbol stubs on non-x86/darwin for ages (we emitted a reference to a stub, but no stub was emitted). The code inside x86-32/macho target objfile lowering should actually be the generic one - move it there.
This (I really, really hope) should fix EH issues on ppc/darwin
and arm/darwin.

llvm-svn: 96755
2010-02-21 20:28:15 +00:00
Duncan Sands
23f728e995 Remove a bunch of duplicated code, where there was one version taking a std::ostream
and another taking a raw_ostream, but otherwise identical.  Use raw_ostream everywhere.

llvm-svn: 96746
2010-02-21 19:15:19 +00:00
Jakob Stoklund Olesen
3a434bf60d Enable assertion to detect cyclic valno references.
This changes the stack overflow in PR6363 to an assertion failure.

llvm-svn: 96744
2010-02-21 18:51:48 +00:00
Anton Korobeynikov
fe0d6453ec IT turns out that during jumpless setcc lowering eq and ne were swapped.
This fixes PR6348

llvm-svn: 96734
2010-02-21 12:28:58 +00:00
Chris Lattner
b328c57aa4 fix and un-xfail X86/vec_ss_load_fold.ll
llvm-svn: 96720
2010-02-21 04:53:34 +00:00
Johnny Chen
abea29dc85 Undo r96654. The printing of ARM shift instructions in canonical forms can be
handled in ARMInstPrinter.cpp.

And added PLD/PLDW/PLI (Preload Data/Instruction) for disassembly only.

llvm-svn: 96719
2010-02-21 04:42:01 +00:00
Chris Lattner
fe81834e6e rename SelectScalarSSELoad -> SelectScalarSSELoadXXX and rewrite
it to follow the mode needed by the new isel.  Instead of returning
the input and output chains, it just returns the (currently only one,
which is a silly limitation) node that has input and output chains.

Since we want the old thing to still work, add a new 
SelectScalarSSELoad to emulate the old interface.  The XXX suffix
and the wrapper will eventually go away.

llvm-svn: 96715
2010-02-21 03:17:59 +00:00
Chris Lattner
ce7be2638a Eliminate some uses of immAllOnes, just use -1, it does
the same thing and is more efficient for the matcher.

llvm-svn: 96712
2010-02-21 03:12:16 +00:00
Dan Gohman
220c2212c1 Rename getSDiv to getExactSDiv to reflect its behavior in cases where
the division would have a remainder.

llvm-svn: 96693
2010-02-19 19:35:48 +00:00
Dan Gohman
9db0689627 Check for overflow when scaling up an add or an addrec for
scaled reuse.

llvm-svn: 96692
2010-02-19 19:32:49 +00:00
Bob Wilson
df432a30b2 Revert 96634. It causes assertion failures for 126.gcc and 176.gcc in
the armv6 nightly tests.

llvm-svn: 96691
2010-02-19 18:59:53 +00:00
Dan Gohman
39b7e5961e Add a comment.
llvm-svn: 96688
2010-02-19 18:49:22 +00:00
Charles Davis
a64fc8c41b Add support for the 'alignstack' attribute to the x86 backend. Fixes PR5254.
Also, FileCheck'ize a test.

llvm-svn: 96686
2010-02-19 18:17:13 +00:00
Dan Gohman
9268d67079 Teach ScalarEvolution how to compute a tripcount for a loop with
true or false as its exit condition. These are usually eliminated by
SimplifyCFG, but the may be left around during a pass which wishes
to preserve the CFG.

llvm-svn: 96683
2010-02-19 18:12:07 +00:00
Bob Wilson
c03fbf812d Revert Anton's most recent EH patch (r96637), since it breaks a lot of
ARM and Thumb tests.

llvm-svn: 96680
2010-02-19 17:10:59 +00:00
Duncan Sands
5d5cce2e19 Revert commits 96556 and 96640, because commit 96556 breaks the
dragonegg self-host build.  I reverted 96640 in order to revert
96556 (96640 goes on top of 96556), but it also looks like with
both of them applied the breakage happens even earlier.  The
symptom of the 96556 miscompile is the following crash:

  llvm[3]: Compiling AlphaISelLowering.cpp for Release build
  cc1plus: /home/duncan/tmp/tmp/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:4982: void llvm::SelectionDAG::ReplaceAllUsesWith(llvm::SDNode*, llvm::SDNode*, llvm::SelectionDAG::DAGUpdateListener*): Assertion `(!From->hasAnyUseOfValue(i) || From->getValueType(i) == To->getValueType(i)) && "Cannot use this version of ReplaceAllUsesWith!"' failed.
  Stack dump:
  0.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@_ZN4llvm19AlphaTargetLowering14LowerOperationENS_7SDValueERNS_12SelectionDAGE'
  g++: Internal error: Aborted (program cc1plus)

This occurs when building LLVM using LLVM built by LLVM (via
dragonegg).  Probably LLVM has miscompiled itself, though it
may have miscompiled GCC and/or dragonegg itself: at this point
of the self-host build, all of GCC, LLVM and dragonegg were built
using LLVM.  Unfortunately this kind of thing is extremely hard
to debug, and while I did rummage around a bit I didn't find any
smoking guns, aka obviously miscompiled code.

Found by bisection.

r96556 | evancheng | 2010-02-18 03:13:50 +0100 (Thu, 18 Feb 2010) | 5 lines

Some dag combiner goodness:
Transform br (xor (x, y)) -> br (x != y)
Transform br (xor (xor (x,y), 1)) -> br (x == y)
Also normalize (and (X, 1) == / != 1 -> (and (X, 1)) != / == 0 to match to "test on x86" and "tst on arm"

r96640 | evancheng | 2010-02-19 01:34:39 +0100 (Fri, 19 Feb 2010) | 16 lines

Transform (xor (setcc), (setcc)) == / != 1 to
(xor (setcc), (setcc)) != / == 1.

e.g. On x86_64
  %0 = icmp eq i32 %x, 0
  %1 = icmp eq i32 %y, 0
  %2 = xor i1 %1, %0
  br i1 %2, label %bb, label %return
=>
	testl   %edi, %edi
	sete    %al
	testl   %esi, %esi
	sete    %cl
	cmpb    %al, %cl
	je      LBB1_2

llvm-svn: 96672
2010-02-19 11:30:41 +00:00
Dale Johannesen
0f58c73229 recommit 96626, evidence that it broke things appears
to be spurious

llvm-svn: 96662
2010-02-19 07:14:22 +00:00
Johnny Chen
2a3db5ee3d Added entries for ASR, LSL, LSR, ROR, and RRX so that the disassembler prints
out the canonical form (A8.6.98) instead of the pseudo-instruction as provided
via MOVs.

DBG_ARM_DISASM=YES llvm-mc -triple=arm-unknown-unknown --disassemble
0xc0 0x00 0xa0 0xe1
Opcode=29 Name=ASR Format=ARM_FORMAT_LDMISCFRM
 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0 
-------------------------------------------------------------------------------------------------
| 1: 1: 1: 0| 0: 0: 0: 1| 1: 0: 1: 0| 0: 0: 0: 0| 0: 0: 0: 0| 0: 0: 0: 0| 1: 1: 0: 0| 0: 0: 0: 0|
-------------------------------------------------------------------------------------------------

	asr	r0, r0, #1

llvm-svn: 96654
2010-02-19 02:12:06 +00:00