Commit Graph

62625 Commits

Author SHA1 Message Date
Daniel Dunbar 2a2c6cf5f9 MC/AsmParser: Hide the AsmParser implementation.
llvm-svn: 108646
2010-07-18 18:31:38 +00:00
Daniel Dunbar 7f5bf5ae2a MC: Move several clients to using AsmParser constructor function.
llvm-svn: 108645
2010-07-18 18:31:33 +00:00
Daniel Dunbar 7a85f9cf4d llvm-mc: Fix llvm-mc -as-lex.
llvm-svn: 108644
2010-07-18 18:31:28 +00:00
Douglas Gregor 8ff89f5c02 Fix struct/class mismatch
llvm-svn: 108642
2010-07-18 11:47:56 +00:00
Owen Anderson 41670a11a8 Add a testcase for r108639.
llvm-svn: 108640
2010-07-18 08:57:19 +00:00
Owen Anderson f7f9c8a2f7 Add a DAGCombine xform to fold away redundant float->double->float conversions around sqrt instructions.
I am assured by people more knowledgeable than me that there are no rounding issues in eliminating this.

This fixed <rdar://problem/8197504>.

llvm-svn: 108639
2010-07-18 08:47:54 +00:00
Lang Hames 1392b8eb79 Added -pbqp-pre-coalescing flag to PBQP. If enabled this will cause PBQP to require
LoopSplitter be run prior to register allocation.

Entirely for testing purposes at the moment.

llvm-svn: 108634
2010-07-18 00:57:59 +00:00
Gabor Greif 2960987ddb fullStopTag cannot happen here, it is handled above
llvm-svn: 108631
2010-07-17 20:52:46 +00:00
Duncan Sands 2155e6539e Fix what seems like a clear buffer overflow, noticed by cppcheck.
llvm-svn: 108629
2010-07-17 20:23:37 +00:00
Bill Wendling ac67e99d53 Use isPrologLabel() instead of checking the opcode directly.
llvm-svn: 108628
2010-07-17 19:18:44 +00:00
Chris Lattner 5218343970 the stackifier is global!
llvm-svn: 108626
2010-07-17 17:42:04 +00:00
Chris Lattner 8f440bb9b0 doxygenify some comments.
llvm-svn: 108625
2010-07-17 17:40:51 +00:00
Zhongxing Xu b653ce648d update CMakeLists.txt
llvm-svn: 108620
2010-07-17 12:12:42 +00:00
Lang Hames 5864012cc0 Removed unused inRange variable.
llvm-svn: 108618
2010-07-17 11:43:07 +00:00
Lang Hames 0eda30d65f Switched to array_pod_sort as per Chris's suggestion.
llvm-svn: 108616
2010-07-17 09:21:53 +00:00
Lang Hames 225977d4f9 LoopSplitter - intended to split live intervals over loop boundaries.
Still very much under development. Comments and fixes will be forthcoming.

(This commit includes some small tweaks to LiveIntervals & LoopInfo to support the splitter)

llvm-svn: 108615
2010-07-17 07:34:01 +00:00
Owen Anderson 7d2818b073 Another attempt at getting the clang self-host to like my instcombine patch.
llvm-svn: 108614
2010-07-17 06:56:35 +00:00
Lang Hames 211e7ce7e7 Iterating over sets of pointers in a heuristic was a bad idea. Switching
any command line paramater changed the register allocation produced by
PBQP.

Turns out variety is not the spice of life.

Fixed some comparators, added others. All good now.

llvm-svn: 108613
2010-07-17 06:31:41 +00:00
Eli Friedman 9de5967244 Start of .sleb128/.uleb128 parsing support.
llvm-svn: 108612
2010-07-17 06:27:28 +00:00
Chris Lattner 3c93d12916 unit test to go along with r108610
llvm-svn: 108611
2010-07-17 06:14:03 +00:00
Chris Lattner 718da70ca2 Fix PR7658, a problem where type refinement can trigger
constant replacement which was botching its handling of
types.  Use of getType() instead of getRawType() was causing
the type map in constant folding to be updated wrong.

llvm-svn: 108610
2010-07-17 06:13:52 +00:00
Eli Friedman 9e36dd001a Work-in-progress parsing for ELF .section directive.
llvm-svn: 108609
2010-07-17 04:29:04 +00:00
Jim Grosbach b97e2bbe32 Add combiner patterns to more effectively utilize the BFI (bitfield insert)
instruction for non-constant operands. This includes the case referenced
in the README.txt regarding a bitfield copy.

llvm-svn: 108608
2010-07-17 03:30:54 +00:00
Eli Friedman ceb16a5ce9 Test for ELF .size directive.
llvm-svn: 108607
2010-07-17 03:15:24 +00:00
Eli Friedman 56178a07bf Add support for parsing .size directives for ELF.
llvm-svn: 108606
2010-07-17 03:09:18 +00:00
Daniel Dunbar 01e3607d70 MC/AsmParser: Lift Run() and TargetParser to base class.
Also, add constructor function for creating AsmParser instances.

llvm-svn: 108604
2010-07-17 02:26:10 +00:00
Jim Grosbach 6e3b5fa91c add BFI to getTargetNodeName()
llvm-svn: 108603
2010-07-17 01:50:57 +00:00
Jim Grosbach adc81f8ee8 Fix logic think-o
llvm-svn: 108601
2010-07-17 01:22:19 +00:00
Eric Christopher 83f250f005 Remove unnecessary check that was subsumed into canRealignStack.
llvm-svn: 108588
2010-07-17 00:33:04 +00:00
Eric Christopher 0baaa9bcc1 Propagate alloca alignment information via variable size object frame
information.

No functional change yet.

llvm-svn: 108583
2010-07-17 00:28:22 +00:00
Eric Christopher 24e3aa011a Make more explicit and add some currently disabled error messages for
stack realignment on ARM.

Also check for function attributes as we do on X86 as well as
make explicit that we're checking can as well as needs in this function.

llvm-svn: 108582
2010-07-17 00:27:24 +00:00
Eric Christopher c0be37287c Make comment a bit more clear as well as return statement since
needsStackRealignment is currently checking the can conditions as well.

llvm-svn: 108581
2010-07-17 00:25:41 +00:00
Bill Wendling 004d772558 Update comment.
llvm-svn: 108571
2010-07-16 23:10:00 +00:00
Jim Grosbach 11013eda5a Add basic support to code-gen the ARM/Thumb2 bit-field insert (BFI) instruction
and a combine pattern to use it for setting a bit-field to a constant
value. More to come for non-constant stores.

llvm-svn: 108570
2010-07-16 23:05:05 +00:00
Dan Gohman 9a54c17582 Fix whitespace.
llvm-svn: 108569
2010-07-16 22:58:39 +00:00
Bill Wendling bf8370ff36 Consider this function:
void foo() { __builtin_unreachable(); }

It will output the following on Darwin X86:

_func1:
Leh_func_begin0:
        pushq %rbp
Ltmp0:
        movq %rsp, %rbp
Ltmp1:
Leh_func_end0:

This prolog adds a new Call Frame Information (CFI) row to the FDE with an
address that is not within the address range of the code it describes -- part is
equal to the end of the function -- and therefore results in an invalid EH
frame. If we emit a nop in this situation, then the CFI row is now within the
address range.

llvm-svn: 108568
2010-07-16 22:51:10 +00:00
Jakob Stoklund Olesen 8289f78569 Remove the isMoveInstr() hook.
llvm-svn: 108567
2010-07-16 22:35:46 +00:00
Jakob Stoklund Olesen 8e767bde16 Avoid isMoveInstr when printing XCore pseudo-moves.
llvm-svn: 108566
2010-07-16 22:35:37 +00:00
Jakob Stoklund Olesen 2c130b8ead Use MI.isCopy.
llvm-svn: 108565
2010-07-16 22:35:34 +00:00
Jakob Stoklund Olesen 54bcf5049e Use a small local function for a single remaining late isMoveInstr call in
Thumb2ITBlockPass.

llvm-svn: 108564
2010-07-16 22:35:32 +00:00
Bill Wendling 499f797cdd Rename DBG_LABEL PROLOG_LABEL, because it's only used during prolog emission and
thus is a much more meaningful name.

llvm-svn: 108563
2010-07-16 22:20:36 +00:00
Jakob Stoklund Olesen 8d51149102 Keep valgrind quiet.
The isLive() method can read uninitialized memory, but it still gives correct
results.

llvm-svn: 108561
2010-07-16 22:00:33 +00:00
Chris Lattner c9c22862d4 tidy up
llvm-svn: 108560
2010-07-16 21:20:46 +00:00
Jakob Stoklund Olesen b15cbd343c Remove remaining calls to TII::isMoveInstr.
llvm-svn: 108556
2010-07-16 21:03:55 +00:00
Jakob Stoklund Olesen 44629eb81b Emit COPY instead of FMR/FMSD instructions for floating point conversion on
PowerPC.

llvm-svn: 108555
2010-07-16 21:03:52 +00:00
Chris Lattner 27e997a168 eliminate unlockedRefineAbstractTypeTo, types are all per-llvmcontext,
so there is no locking involved in type refinement.

llvm-svn: 108553
2010-07-16 20:50:13 +00:00
Gabor Greif fee4dafbd0 get the first few tags from a precomputed table (count can be increased if desired)
llvm-svn: 108549
2010-07-16 20:35:19 +00:00
Eli Friedman ba9b25a6ba Add missing attributes to cpp backend.
llvm-svn: 108547
2010-07-16 18:47:20 +00:00
Dale Johannesen da3e05db70 Accept registers with P modifier. PR 5314.
llvm-svn: 108545
2010-07-16 18:35:46 +00:00
Dan Gohman aa28801f6a Make llvm-bcanalyzer print out the full enum name for all metadata
code ids, not just some of them.

llvm-svn: 108543
2010-07-16 18:28:07 +00:00
Jakob Stoklund Olesen 6353e534ec Teach PPCInstrInfo::storeRegToStackSlot and loadRegFromStackSlot to add memory
operands.

Hopefully this fixes the llvm-gcc-powerpc-darwin9 buildbot. It really shouldn't
since missing memoperands should not affect correctness.

llvm-svn: 108540
2010-07-16 18:22:00 +00:00
Dan Gohman efd7f9c360 Reorder the contents of various getAnalysisUsage functions, eliminating
a redundant loopsimplify run from the default -O2 sequence.

llvm-svn: 108539
2010-07-16 17:58:45 +00:00
Dan Gohman 1e936277c3 Revert r108369, sorting llvm.dbg.declare information by source position,
since it doesn't work for front-ends which don't emit column information
(which includes llvm-gcc in its present configuration), and doesn't
work for clang for K&R style variables where the variables are declared
in a different order from the parameter list.

Instead, make a separate pass through the instructions to collect the
llvm.dbg.declare instructions in order. This ensures that the debug
information for variables is emitted in this order.

llvm-svn: 108538
2010-07-16 17:54:27 +00:00
Jakob Stoklund Olesen c30b4ddc58 Remove the X86::FP_REG_KILL pseudo-instruction and the X86FloatingPointRegKill
pass that inserted it.

It is no longer necessary to limit the live ranges of FP registers to a single
basic block.

llvm-svn: 108536
2010-07-16 17:41:44 +00:00
Jakob Stoklund Olesen f0af236874 Search for a free FP register instead of just assuming FP7 is not in use.
llvm-svn: 108535
2010-07-16 17:41:40 +00:00
Owen Anderson 8a39c807e2 Remove the rest of my instcombine changes. Back to the drawing board on this one.
llvm-svn: 108530
2010-07-16 16:39:00 +00:00
Jakob Stoklund Olesen 0e5fb020a0 Allow x87 FP registers to be alive globally in a function.
FP_REG_KILL instructions are still inserted, but can be disabled by passing
-live-x87 to llc. The X87FPRegKillInserterPass is going to be removed shortly.

CFG edges are partioned into bundles where the x87 stack must be allocated
identically. Code is insertad at the end of each basic block that shuffles the
live FP registers to match the outgoing bundles expectations.

This fix is in preparation for some upcoming register allocator improvements
that may extend the live range of registers beyond a basic block, similar to
LICM. It also provides a nice runtime speedup if you are building with
-mfpmath=387.

llvm-svn: 108529
2010-07-16 16:38:12 +00:00
Douglas Gregor a279658672 Remove extraneous semicolons after member functions
llvm-svn: 108525
2010-07-16 15:03:23 +00:00
Benjamin Kramer 50729ad717 Feed the right output into FileCheck.
llvm-svn: 108523
2010-07-16 10:58:02 +00:00
Gabor Greif 6d673953e3 eliminate CallInst::ArgOffset
llvm-svn: 108522
2010-07-16 09:38:02 +00:00
Eli Friedman 17c5a23559 Get rid of a bunch of duplicated ELF enum values.
llvm-svn: 108520
2010-07-16 07:53:29 +00:00
Eli Friedman ad543ecaa9 A few more minor additions to ELF.h.
llvm-svn: 108519
2010-07-16 07:48:07 +00:00
Eric Christopher 08928d8e23 Remove bogus link.
llvm-svn: 108518
2010-07-16 06:33:36 +00:00
Nick Lewycky 375efe3157 Arrays and vectors with different numbers of elements are not equivalent.
llvm-svn: 108517
2010-07-16 06:31:12 +00:00
Eric Christopher 55f321426d Remove unnecessary conditional.
llvm-svn: 108516
2010-07-16 06:13:24 +00:00
Tobias Grosser 3d84c9c793 LoopSimplify does not update domfrontier correctly.
This fixes PR7649.

llvm-svn: 108513
2010-07-16 05:59:45 +00:00
Tobias Grosser bd7c9f701b Add dump() to DominanceFrontier
llvm-svn: 108512
2010-07-16 05:59:39 +00:00
Jakob Stoklund Olesen 37c42a3d02 Remove many calls to TII::isMoveInstr. Targets should be producing COPY anyway.
TII::isMoveInstr is going tobe completely removed.

llvm-svn: 108507
2010-07-16 04:45:42 +00:00
Jakob Stoklund Olesen b1671271ab Add forgotten test case.
llvm-svn: 108506
2010-07-16 04:45:35 +00:00
Dan Gohman 103c4ebea5 Use the source-order scheduler instead of the "fast" scheduler at -O0,
because it's more likely to keep debug line information in its original
order.

llvm-svn: 108496
2010-07-16 02:01:19 +00:00
Daniel Dunbar bdb298912b build/Darwin: Add an LLVM_LTO_VERSION_OFFSET make variable to allow offsetting
the libLTO library version from the actual build version.

llvm-svn: 108495
2010-07-16 01:41:38 +00:00
Eric Christopher 15a81cddb4 Also revert 108422, it's causing some test failures.
Working on testcases for Owen.

llvm-svn: 108494
2010-07-16 01:36:12 +00:00
Daniel Dunbar c88e2ccdd3 build/Clang: Build and install libLTO as part of clang-only/install-clang targets.
llvm-svn: 108493
2010-07-16 01:29:50 +00:00
Dan Gohman c6eefe4d4e Fix this test.
llvm-svn: 108491
2010-07-16 01:28:45 +00:00
Dale Johannesen bfd4fd7bb7 The SelectionDAGBuilder's handling of debug info, on rare
occasions, caused code to be generated in a different order.
All cases I've seen involved float softening in the type
legalizer, and this could be perhaps be fixed there, but
it's better not to generate things differently in the first
place.  7797940 (6/29/2010..7/15/2010).

llvm-svn: 108484
2010-07-16 00:02:08 +00:00
Bill Wendling 4bda1c8e68 Revert. This isn't the correct way to go.
llvm-svn: 108478
2010-07-15 23:42:21 +00:00
Dan Gohman fbbdfcaea7 Fix the order that SCEVExpander considers add operands in so that
it doesn't miss an opportunity to form a GEP, regardless of the
relative loop depths of the operands. This fixes rdar://8197217.

llvm-svn: 108475
2010-07-15 23:38:13 +00:00
Bill Wendling 973dc3b1d8 Handle code gen for the unreachable instruction if it's the only instruction in
the function. We'll just turn it into a "trap" instruction instead.

The problem with not handling this is that it might generate a prologue without
the equivalent epilogue to go with it:

$ cat t.ll
define void @foo() {
entry:
  unreachable
}
$ llc -o - t.ll -relocation-model=pic -disable-fp-elim -unwind-tables
        .section        __TEXT,__text,regular,pure_instructions
        .globl  _foo
        .align  4, 0x90
_foo:                                   ## @foo
Leh_func_begin0:
## BB#0:                                ## %entry
        pushq   %rbp
Ltmp0:
        movq    %rsp, %rbp
Ltmp1:
Leh_func_end0:
...

The unwind tables then have bad data in them causing all sorts of problems.

Fixes <rdar://problem/8096481>.

llvm-svn: 108473
2010-07-15 23:32:40 +00:00
Evan Cheng 55f0c6b9fc Split -enable-finite-only-fp-math to two options:
-enable-no-nans-fp-math and -enable-no-infs-fp-math. All of the current codegen fp math optimizations only care whether the fp arithmetics arguments and results can never be NaN.

llvm-svn: 108465
2010-07-15 22:07:12 +00:00
Daniel Dunbar 0a2f1bafb6 build/Darwin: Add a missing directory dependency.
llvm-svn: 108463
2010-07-15 21:51:52 +00:00
Chris Lattner f71de7f538 remove some unneeded overloads that were causing
ambiguity problems on some systems.

llvm-svn: 108462
2010-07-15 21:24:02 +00:00
Chris Lattner 60b131654b fix the definitions of ConstTextCoalSection/ConstDataCoalSection
to keep "Text" in sync with the "pure instructions" section attribute.
Lack of this attribute was preventing the assembler from emitting
multibyte noops instructions for templates (and inlines, and other
coalesced stuff) and was causing the assembler to mismatch .o files.

This fixes rdar://8018335

llvm-svn: 108461
2010-07-15 21:22:00 +00:00
Chris Lattner c2b3675f8b fix indentation and 80 cols
llvm-svn: 108460
2010-07-15 21:19:31 +00:00
Devang Patel cedf95623b Revert 108456. i.e. bring back r108444.
llvm-svn: 108458
2010-07-15 20:57:09 +00:00
Devang Patel 8f59ff6b23 Revert 108444. It breaks a build.
llvm-svn: 108456
2010-07-15 20:25:51 +00:00
Dan Gohman 1415208292 Don't merge uses when they are targetting fixup sites with
different widths. In a use with a narrower fixup, formulae
may be wider than the fixup, in which case the high bits
aren't necessarily meaningful, so it isn't safe to reuse
them for uses with wider fixups.

This fixes PR7618, though the testcase is too large for a
reasonable regression test, since it heavily dependes on
hitting LSR's heuristics in a certain way.

llvm-svn: 108455
2010-07-15 20:24:58 +00:00
Chris Lattner 620693806a fix the encoding of MMX_MOVFR642Qrr, it starts with 0xF2 not 0xF3,
this fixes rdar://8192860.  Unfortunately it can only be triggered
with llc because llvm-mc matches another (correctly encoded) version
of this, so no testcase.

llvm-svn: 108454
2010-07-15 20:13:34 +00:00
Dan Gohman a1501b9c50 Use dbgs() instead of errs() in a DEBUG.
llvm-svn: 108453
2010-07-15 20:12:42 +00:00
Bill Wendling 2da75ef315 Use std::vector instead of TargetRegisterInfo::FirstVirtualRegister.
llvm-svn: 108452
2010-07-15 20:04:36 +00:00
Dan Gohman 64b1e82a7c Teach ScalarEvolution how to fold trunc(undef) and anyext(undef) to undef.
This helps LSR behave more consistently on bugpoint-reduced testcases.

llvm-svn: 108451
2010-07-15 20:02:11 +00:00
Bill Wendling dd5e9d8faf Use std::vector instead of TargetRegisterInfo::FirstVirtualRegister.
llvm-svn: 108450
2010-07-15 20:01:02 +00:00
Bill Wendling 51a9c0a1b3 Use std::vector instead of TargetRegisterInfo::FirstVirtualRegister. This time
make sure to allocate enough space in the std::vector.

llvm-svn: 108449
2010-07-15 19:58:14 +00:00
Bill Wendling 5a8d15c553 Reserve a goodly amount of room for the vectors.
llvm-svn: 108448
2010-07-15 19:41:20 +00:00
Daniel Dunbar 83fc06783c build/Darwin: Add support for embedding version information in tool executables.
llvm-svn: 108444
2010-07-15 19:33:38 +00:00
Devang Patel df09db62e2 Fix crash reported in PR7653.
llvm-svn: 108441
2010-07-15 18:45:27 +00:00
Bill Wendling 030b0286ec Use std::vector instead of TargetRegisterInfo::FirstVirtualRegister.
llvm-svn: 108440
2010-07-15 18:43:09 +00:00
Bill Wendling 57681404b0 Use std::vector instead of TargetRegisterInfo::FirstVirtualRegister.
llvm-svn: 108438
2010-07-15 18:40:50 +00:00
Owen Anderson eaf64d5c1e Speculatively revert r108429 to fix the clang self-host.
llvm-svn: 108436
2010-07-15 18:18:57 +00:00
Owen Anderson eb08d01061 Per Chris' suggestion, get rid of the select canonicalization and just add
the corresponding or-icmp-and pattern.  This has the added benefit of doing
the matching earlier, and thus being less susceptible to being confused by
earlier transforms.

llvm-svn: 108429
2010-07-15 17:24:23 +00:00
Owen Anderson 13700ebb02 Remove unneeded check, and correct style.
llvm-svn: 108427
2010-07-15 16:38:22 +00:00
Dan Gohman 4afd412d6b Watch out for a constant offset cancelling out a base register, forming
a zero. This situation arrises in Fortran code with induction variables
that start at 1 instead of 0. This fixes PR7651.

llvm-svn: 108424
2010-07-15 15:14:45 +00:00
Owen Anderson 7151dfd48a Reapply r108378, with bugfixes, testcase, and improved comment formatting.
This now passes LIT, nighty test, and llvm-gcc bootstrap on my machine.

llvm-svn: 108422
2010-07-15 15:00:23 +00:00
Gabor Greif 26ec65ac3c cache another dereferenced iterator
llvm-svn: 108421
2010-07-15 10:19:23 +00:00
Eric Christopher 0f470ab104 80-col.
llvm-svn: 108420
2010-07-15 07:49:30 +00:00
Chris Lattner c48adb60ca revert bill's patches in an attempt to fix the buildbot.
llvm-svn: 108419
2010-07-15 06:51:46 +00:00
Nick Lewycky 485ce5a49c This is a full sentence.
llvm-svn: 108418
2010-07-15 06:51:22 +00:00
Nick Lewycky e6f3287cbb Disable aliases on all platforms.
llvm-svn: 108417
2010-07-15 06:48:56 +00:00
Ted Kremenek 34231228ff Correctly set rpath on Mac OS X for executable tools. Note that I am not certain this is the best fix; the code immediately above looks confused, as it first checks to see if we are NOT on Darwin and then checks the Darwin version number. This fix allows c-index-test (in Clang) to run outside of running the regression test suite. I would appreciate if someone reviewed this.
llvm-svn: 108416
2010-07-15 06:36:57 +00:00
Chris Lattner 19eff2a9f6 Fix PR7647, handling the case when 'To' ends up being
mutated by recursive simplification.  This also enhances
ReplaceAndSimplifyAllUses to actually do a real RAUW
at the end of it, which updates any value handles
pointing to "From" to start pointing to "To".  This
seems useful for debug info and random other VH users.

llvm-svn: 108415
2010-07-15 06:36:08 +00:00
Chris Lattner e41ab07c61 make various clients of ReplaceAndSimplifyAllUses tolerate
it *changing* the things it replaces, not just causing them
to drop to null.  There is no functionality change yet, but 
this is required for a subsequent patch.

llvm-svn: 108414
2010-07-15 06:06:04 +00:00
Bill Wendling 1f7071a3e4 Fix headers.
llvm-svn: 108413
2010-07-15 06:05:18 +00:00
Bill Wendling e7e6ca5c57 Use std::vector instead of a hard-coded array. The length of that array could
get *very* large, but we only need it to be the size of the number of pregs.

llvm-svn: 108412
2010-07-15 06:04:38 +00:00
Bill Wendling d5b390189d Use std::vector instead of a hard-coded array. The length of that array could
get *very* large, but we only need it to be the size of thenumber of pregs.

llvm-svn: 108411
2010-07-15 05:56:32 +00:00
Chris Lattner e985a63bbf see comment.
llvm-svn: 108409
2010-07-15 05:17:36 +00:00
Chris Lattner 96748161c5 add an accessor.
llvm-svn: 108408
2010-07-15 05:14:01 +00:00
Eli Friedman 8b3a17e613 Revert r108401; it breaks bootstrap :(
llvm-svn: 108407
2010-07-15 05:09:31 +00:00
Eli Friedman fd473a746c Add AssertingVH which makes PR7647 break consistently.
llvm-svn: 108401
2010-07-15 04:46:14 +00:00
Eli Friedman e4be4308a9 Random note about bswap.
llvm-svn: 108396
2010-07-15 02:20:38 +00:00
Chris Lattner 28fd6785bc a more graceful fix for test/Other/inline-asm-newline-terminator.ll,
follow on to r103765

llvm-svn: 108390
2010-07-15 00:37:34 +00:00
Eli Friedman a8b4e3732b Speculatively revert r108378; may be causing bootstrap failures.
llvm-svn: 108389
2010-07-15 00:33:00 +00:00
Jakob Stoklund Olesen 8b1bb8cfbd Last COPY conversion.
llvm-svn: 108387
2010-07-14 23:58:21 +00:00
Bob Wilson 0b9aafddc5 Remove restriction on NEON alignment values. Some of the NEON ld/st
instructions use different values (e.g., 2-byte or 4-byte alignment).
Also fix ARMInstPrinter to print these alignments as bits instead of bytes.

llvm-svn: 108386
2010-07-14 23:54:43 +00:00
Jakob Stoklund Olesen 9b449d5a92 Use TargetOpcode::COPY instead of X86-native register copy instructions when
lowering atomics. This will allow those copies to still be coalesced after
TII::isMoveInstr is removed.

llvm-svn: 108385
2010-07-14 23:50:27 +00:00
Bob Wilson 5d2c1218f1 Remove the entire docs directory from Apple-style builds.
This fixes a "usr_junk" verification failure when installing into /usr.

llvm-svn: 108384
2010-07-14 23:49:18 +00:00
Bob Wilson 6f4f3612cc Try to get embedded build of llvmCore to pass verification.
Simplify some things in the process.

llvm-svn: 108382
2010-07-14 23:41:58 +00:00
Eric Christopher 474e56a2bf 80-col.
llvm-svn: 108381
2010-07-14 23:41:32 +00:00
Owen Anderson 37d91d84af Add instcombine transforms to optimize tests of multiple bits of the same value into a single larger comparison.
llvm-svn: 108378
2010-07-14 23:33:51 +00:00
Eric Christopher 25e72a8920 Temporarily disable this test.
llvm-svn: 108371
2010-07-14 23:12:58 +00:00
Devang Patel 29168baf4b Make it a .ll test case.
llvm-svn: 108370
2010-07-14 23:12:52 +00:00
Dan Gohman f10cd5c6cb Make the order in which variables are described in debug information
independent of the order that isel happens to visit the dbg_declare
intrinsics. This fixes a bug in which the formal arguments were
being printed in reverse order, now that fast isel is going bottom up.

llvm-svn: 108369
2010-07-14 23:08:16 +00:00
Chris Lattner 769aedd523 fix indentation
llvm-svn: 108368
2010-07-14 23:04:59 +00:00
Bob Wilson f1a6d7abc3 Remove some broken code to check the DISABLE_EDIS flag (edis is now in the
DIRS list, so it does no good to filter it from PARALLEL_DIRS), and replace
it with a check to disable building the shared library version of edis when
the flag is set.  Disabling it entirely does not work because MC uses it now.

llvm-svn: 108367
2010-07-14 22:41:51 +00:00
Benjamin Kramer 92d8998348 Don't pass StringRef by reference.
llvm-svn: 108366
2010-07-14 22:38:02 +00:00
Eric Christopher e34b383e71 Add a testcase for the vla and stack realignment warning.
llvm-svn: 108365
2010-07-14 22:26:35 +00:00
Dan Gohman c12a6731c5 Properly restore DebugLoc after leaving the local constant area.
llvm-svn: 108364
2010-07-14 22:01:31 +00:00
Dale Johannesen 6fe8c37a01 Tests for llvm-gcc commit 108360.
llvm-svn: 108362
2010-07-14 21:22:35 +00:00
Dan Gohman 1513217e27 Just use getParent() instead of getModuleFromVal when the value is a Function.
llvm-svn: 108358
2010-07-14 21:12:44 +00:00
Dan Gohman efb8dbb3f1 Rename WriteConstantInt to WriteConstantInternal, to avoid confusion.
llvm-svn: 108357
2010-07-14 20:57:55 +00:00
Owen Anderson 2cfe91379b Extend SimplifyCFG's common-destination folding heuristic to allow a single
"bonus" instruction to be speculatively executed.  Add a heuristic to
ensure we're not tripping up out-of-order execution by checking that this bonus
instruction only uses values that were already guaranteed to be available.

This allows us to eliminate the short circuit in (x&1)&&(x&2).

llvm-svn: 108351
2010-07-14 19:52:16 +00:00
Dan Gohman 8939ba337d Factor out metadata parsing into a separate function.
llvm-svn: 108343
2010-07-14 18:26:50 +00:00
Chris Lattner 254858031a Merge lib/Target/X86/X86COFF.h into include/llvm/Support/COFF.h,
patch by Michael Spencer!

llvm-svn: 108342
2010-07-14 18:14:33 +00:00
Jim Grosbach a90af1ba38 Improve 64-subtraction of immediates when parts of the immediate can fit
in the literal field of an instruction. E.g.,
long long foo(long long a) {
  return a - 734439407618LL;
}

rdar://7038284

llvm-svn: 108339
2010-07-14 17:45:16 +00:00
Dan Gohman 042523340b Delete fast-isel's trivial load optimization; it breaks debugging because
it can look past points where a debugger might modify user variables.

llvm-svn: 108336
2010-07-14 17:25:37 +00:00
Bob Wilson bb57896f8e Fix test to appease the buildbots.
llvm-svn: 108334
2010-07-14 16:43:47 +00:00
Bob Wilson 1aef53403f Add missing address register update to t2LDM_RET instruction.
Patch by Brian Lucas. PR7636.

llvm-svn: 108332
2010-07-14 16:02:13 +00:00
Duncan Sands 7a68cd094b Rather than using an ifdef on the target to zero out fields,
just use memset to zero the entire struct.

llvm-svn: 108330
2010-07-14 14:32:33 +00:00
Eli Friedman c4d70125ee A couple potential optimizations inspired by comment 4 in PR6773.
llvm-svn: 108328
2010-07-14 06:58:26 +00:00
Evan Cheng a8e8874552 Fix for PR7193 was overly conservative. The only case where sibcall callee
address cannot be allocated a register is in 32-bit mode where the first
three arguments are marked inreg. In that case EAX, EDX, and ECX will be
used for argument passing.

This fixes PR7610.

llvm-svn: 108327
2010-07-14 06:44:01 +00:00
Bob Wilson bad47f62f6 Add support for NEON VMVN immediate instructions.
llvm-svn: 108324
2010-07-14 06:31:50 +00:00
Bob Wilson bd54a53628 The bits in the cmode field of 32-bit VMOV immediate instructions all depend
of the value of the immediate.

llvm-svn: 108323
2010-07-14 06:30:44 +00:00
Chris Lattner ec0e7b1643 revert r108320, I see the failures now...
llvm-svn: 108322
2010-07-14 06:16:35 +00:00
Chris Lattner 658680b2f5 reapply benjamin's instcombine patch, I don't see anything wrong with it and can't repro any problems with a manual self-host.
llvm-svn: 108320
2010-07-14 05:59:13 +00:00
Evan Cheng c893115312 Re-enable the test with fix.
llvm-svn: 108319
2010-07-14 05:49:23 +00:00
Chris Lattner 711338fb04 temporarily disable to test to fix buildbots.
llvm-svn: 108310
2010-07-14 02:21:59 +00:00
Chris Lattner 164a0775bb fix a bug found by a warning I added to clang this morning.
llvm-svn: 108309
2010-07-14 01:57:17 +00:00
Evan Cheng d542414945 Teach ProcessImplicitDefs to transform more COPY instructions into IMPLICIT_DEF (and subsequently eliminate them). This allows machine LICM to hoist IMPLICIT_DEF's. PR7620.
llvm-svn: 108304
2010-07-14 01:22:19 +00:00
Bob Wilson 103a0dcfe1 Add an ARM-specific DAG combining to avoid redundant VDUPLANE nodes.
Radar 7373643.

llvm-svn: 108303
2010-07-14 01:22:12 +00:00
Dan Gohman 1f471435f8 Don't propagate debug locations to instructions for materializing
constants, since they may not be emited near the other instructions
which get the same line, and this confuses debug info.

llvm-svn: 108302
2010-07-14 01:07:44 +00:00
Bruno Cardoso Lopes 6c6c14a55c Add AVX 256-bit compare instructions and a bunch of testcases
llvm-svn: 108286
2010-07-13 22:06:38 +00:00
Jakob Stoklund Olesen 50bcf13a7b Remove vestigial decl.
llvm-svn: 108278
2010-07-13 21:19:08 +00:00
Jakob Stoklund Olesen cd7a40f4ec Print VNInfo flags.
llvm-svn: 108277
2010-07-13 21:19:05 +00:00
Bob Wilson a3f1901531 Use a target-specific VMOVIMM DAG node instead of BUILD_VECTOR to represent
NEON VMOV-immediate instructions.  This simplifies some things.

llvm-svn: 108275
2010-07-13 21:16:48 +00:00
Bruno Cardoso Lopes fd8bfcd6e1 AVX 256-bit conversion instructions
Add the x86 VEX_L form to handle special cases where VEX_L must be set.

llvm-svn: 108274
2010-07-13 21:07:28 +00:00
Evan Cheng f0b175328f Update comment.
llvm-svn: 108272
2010-07-13 21:03:14 +00:00
Dale Johannesen caca5488dc In inline asm treat indirect 'X' constraint as 'm'.
This may not be right in all cases, but it's better
than asserting which it was doing before.  PR 7528.

llvm-svn: 108268
2010-07-13 20:17:05 +00:00
Kevin Enderby 76a6b663a3 Added a check that pusha cannot be encoded in 64-bit mode.
llvm-svn: 108265
2010-07-13 20:05:41 +00:00
Jakob Stoklund Olesen fc4b8b8e80 Add an assertion to make PR7542 fail consistently.
LiveInterval::overlapsFrom dereferences end() if it is called on an empty
interval.

It would be reasonable to just return false - an empty interval doesn't overlap
anything, but I want to know who is doing it first.

llvm-svn: 108264
2010-07-13 19:56:28 +00:00
Dan Gohman 58cd65f2fe Fix the Named Metadata example to make it clear which specific
construct is the named metadata.

llvm-svn: 108263
2010-07-13 19:48:13 +00:00
Dan Gohman afd69cf5b7 Add support for empty named metadata too. This isn't particularly
useful, but it is nice for consistency.

llvm-svn: 108262
2010-07-13 19:42:44 +00:00
Jakob Stoklund Olesen b43455feaf Fix LiveInterval::overlaps so it doesn't claim touching intervals overlap.
Also, one binary search is enough.

llvm-svn: 108261
2010-07-13 19:42:20 +00:00
Dan Gohman 1e0213a758 Add support for empty metadata nodes: !{}.
llvm-svn: 108259
2010-07-13 19:33:27 +00:00
Evan Cheng 0cc4ad983d Extend the r107852 optimization which turns some fp compare to code sequence using only i32 operations. It now optimize some f64 compares when fp compare is exceptionally slow (e.g. cortex-a8). It also catches comparison against 0.0.
llvm-svn: 108258
2010-07-13 19:27:42 +00:00
Evan Cheng 58066e337d Add an ARM "feature". Cortex-a8 fp comparison is very slow (> 20 cycles).
llvm-svn: 108256
2010-07-13 19:21:50 +00:00
Greg Clayton f9d177622e Patched Makefile.rules to allow objective C and objective C++ compilation.
This allows LLDB (llvm/tools/lldb) to build on Mac OS X.

llvm-svn: 108255
2010-07-13 18:47:09 +00:00
Evan Cheng f43961007c -enable-unsafe-fp-math should not imply -enable-finite-only-fp-math.
llvm-svn: 108254
2010-07-13 18:46:14 +00:00
Eric Christopher ea282034b6 Grammar.
llvm-svn: 108252
2010-07-13 18:27:13 +00:00
Dale Johannesen f241d4626c Fix PR number.
llvm-svn: 108251
2010-07-13 18:14:47 +00:00
Chandler Carruth bc3e8a7c93 Switch from EXPECT_EQ({true,false, ...) to the more canonical
EXPECT_{TRUE,FALSE}(...) macros. This also prevents suprious warnings about
bool-to-pointer conversion that occurs withit EXPECT_EQ.

llvm-svn: 108248
2010-07-13 17:28:05 +00:00
Devang Patel 4a7904d652 Fix compile unit in example. Thanks Renato Golin!
llvm-svn: 108246
2010-07-13 16:53:20 +00:00
Duncan Sands f88a284579 Handle the case of a tail recursion in which the tail call is followed
by a return that returns a constant, while elsewhere in the function
another return instruction returns a different constant.  This is a
special case of accumulator recursion, so just generalize the existing
logic a bit.

llvm-svn: 108241
2010-07-13 15:41:41 +00:00
Gabor Greif 03e7e68caa rotate CallInst operands
with this commit the callee moves to the end of
the operand array (from the start) and the call
arguments now start at index 0 (formerly 1)

this ordering is now consistent with InvokeInst

this commit only flips the switch,
functionally it is equivalent to
r101465

I intend to commit several cleanups after a few
days of soak period

llvm-svn: 108240
2010-07-13 15:31:36 +00:00
Benjamin Kramer 79698be162 HTML cleanup and validation.
llvm-svn: 108239
2010-07-13 12:26:09 +00:00
Duncan Sands a522e563a8 When doing sext/zext of constants, the target type must be strictly
wider than the source type.  Correct LangRef.

llvm-svn: 108238
2010-07-13 12:06:14 +00:00
Chris Lattner 9b5561f4db use a typedef instead of its expansion, patch by Michael Spencer
llvm-svn: 108229
2010-07-13 05:52:36 +00:00
Eric Christopher 9ac75957e2 80-columns
llvm-svn: 108228
2010-07-13 05:50:08 +00:00
Bob Wilson c1c6f4796e Move NEON "modified immediate" encode/decode into ARMAddressingModes.h to
avoid replicated code.

llvm-svn: 108227
2010-07-13 04:44:34 +00:00
Chris Lattner 55595fb291 my work on adding segment registers to LEA missed the
disassembler.  Remove some code from the disassembler to
compensate, unbreaking disassembly of lea's.

llvm-svn: 108226
2010-07-13 04:23:55 +00:00
Bruno Cardoso Lopes dff283e146 Add AVX 256-bit packed logical forms
llvm-svn: 108224
2010-07-13 02:38:35 +00:00
Bruno Cardoso Lopes 36b32aeaa5 Add AVX 256-bit unop arithmetic instructions
llvm-svn: 108223
2010-07-13 01:53:31 +00:00
Bruno Cardoso Lopes 77a3c4462f Since AVX is a superset of all SSE versions, only use HasAVX for AVX instructions
llvm-svn: 108222
2010-07-13 00:38:47 +00:00
Stephen Wilson 08d1c71c94 Bring ELF64 on par with ELF32, add a few magic constants and support ".dynamic"
section entries.

llvm-svn: 108221
2010-07-13 00:24:59 +00:00
Jakob Stoklund Olesen 54e620d2c7 Don't add memory operands to storeRegToStackSlot / loadRegFromStackSlot results,
they already have one.

This fixes the himenobmtxpa miscompilation on ARM.

The PostRA scheduler got confused by the double memoperand and hoisted a stack
slot load above a store to the same slot.

llvm-svn: 108219
2010-07-13 00:23:30 +00:00
David Greene 03264efe30 Move some SIMD fragment code into X86InstrFragmentsSIMD so that the
utility classes can be used from multiple files.  This will aid
transitioning to a new refactored x86 SIMD specification.

llvm-svn: 108213
2010-07-12 23:41:28 +00:00
Bruno Cardoso Lopes 8e67a0482e Add AVX 256 binary arithmetic instructions
llvm-svn: 108207
2010-07-12 23:04:15 +00:00
Bruno Cardoso Lopes 91806311c9 More refactoring of basic SSE arith instructions. Open room for 256-bit instructions
llvm-svn: 108204
2010-07-12 22:41:32 +00:00
Stephen Wilson cc1d334373 Simple format/style fixes.
llvm-svn: 108203
2010-07-12 22:36:08 +00:00
Stephen Wilson 1a8c928a24 Test commit.
llvm-svn: 108197
2010-07-12 21:34:37 +00:00
Daniel Dunbar ab058b83e0 MC/AsmParser: Move ELF specific parser to ELFAsmParser.cpp.
llvm-svn: 108196
2010-07-12 21:23:32 +00:00
Daniel Dunbar 0cb91cfc74 MC/AsmParser: Move Darwin specific parse to DarwinAsmParser.cpp.
llvm-svn: 108193
2010-07-12 20:51:51 +00:00
Argyrios Kyrtzidis c7ff023de4 Add convenience method FoldingSetImpl::InsertNode(Node *N) that asserts if the node is already inserted.
llvm-svn: 108192
2010-07-12 20:47:08 +00:00