Commit Graph

20221 Commits

Author SHA1 Message Date
Devang Patel 2181b8e86a Swap exit condition operands if it works.
llvm-svn: 41817
2007-09-10 23:34:06 +00:00
Chris Lattner 740d8049f4 regenerate
llvm-svn: 41816
2007-09-10 23:24:14 +00:00
Chris Lattner dae70d4d36 Fix PR1645 by resolving forward alias references.
llvm-svn: 41815
2007-09-10 23:23:53 +00:00
Evan Cheng f948772f9e 80 col.
llvm-svn: 41812
2007-09-10 22:22:23 +00:00
Evan Cheng 8c3c198499 New entry.
llvm-svn: 41810
2007-09-10 22:16:37 +00:00
Evan Cheng 3b9f777f47 Observation of rematerialization.
llvm-svn: 41809
2007-09-10 22:11:18 +00:00
Chris Lattner 6777b72659 Add some notes about better flag handling.
llvm-svn: 41808
2007-09-10 21:43:18 +00:00
Chris Lattner 58c227bd09 Emit:
cmpl    %eax, %ecx
        setae   %al
        movzbl  %al, %eax

instead of:

        cmpl    %eax, %ecx
        setb    %al
        xorb    $1, %al
        movzbl  %al, %eax

when using logical not of a C comparison.

llvm-svn: 41807
2007-09-10 21:39:07 +00:00
Chris Lattner 33a7f51412 1. Don't call Value::getName(), which is slow.
2. Lower calls to fabs and friends to FABS nodes etc unless the function has
   internal linkage.  Before we wouldn't lower if it had a definition, which
   is incorrect.  This allows us to compile:

define double @fabs(double %f) {
        %tmp2 = tail call double @fabs( double %f )
        ret double %tmp2
}

into:

_fabs:
        fabs f1, f1
        blr 

llvm-svn: 41805
2007-09-10 21:15:22 +00:00
Chris Lattner c75cbe6473 Prevent tailcallelim from breaking "recursive" calls to builtins.
llvm-svn: 41804
2007-09-10 20:58:55 +00:00
Evan Cheng 637395e6bd It's not safe to rematerialize MOV32r0 etc. by simply cloning the original
instruction. These are implemented with xor which will modify the conditional
code. They should be rematerialized as move instructions.

llvm-svn: 41802
2007-09-10 20:48:53 +00:00
Devang Patel f8ab0a9acc Filter exit conditions which are not yet handled.
llvm-svn: 41800
2007-09-10 18:33:42 +00:00
Devang Patel d7409fdce5 Require SCEV before LCSSA.
llvm-svn: 41798
2007-09-10 18:08:23 +00:00
Owen Anderson 82e4fa1020 Remove an un-needed dependence query. This improves compile time marginally on 401.bzip2.
llvm-svn: 41792
2007-09-09 21:43:49 +00:00
Dale Johannesen 29e6ac4281 Implement misaligned FP loads and stores.
llvm-svn: 41786
2007-09-08 19:29:23 +00:00
Evan Cheng ee8d9a0e81 Smarter Reset(). Instead of deallocating all memory regions and reallocate the
first region, just deallocate all but the last region in the list.

llvm-svn: 41782
2007-09-08 00:02:17 +00:00
Evan Cheng cef2c0efcc TableGen no longer emit CopyFromReg nodes for implicit results in physical
registers. The scheduler is now responsible for emitting them.

llvm-svn: 41781
2007-09-07 23:59:02 +00:00
Bill Wendling 9929bc403d Add missing index versions of instructions to the map.
llvm-svn: 41776
2007-09-07 22:01:02 +00:00
Dan Gohman a95cbb0007 Avoid storing and reloading zeros and other constants from stack slots
by flagging the associated instructions as being trivially rematerializable.

llvm-svn: 41775
2007-09-07 21:32:51 +00:00
Dale Johannesen 9e70086c8f Apply feedback from previous patch.
llvm-svn: 41774
2007-09-07 21:07:57 +00:00
Dale Johannesen b6d795c1fc Revert previous change to IR.
llvm-svn: 41769
2007-09-07 18:31:50 +00:00
Rafael Espindola 1de0c86717 Add support for having different alignment for objects on call frames.
The x86-64 ABI states that objects passed on the stack have
8 byte alignment. Implement that.

llvm-svn: 41768
2007-09-07 14:52:14 +00:00
Anton Korobeynikov 122bf4be7e Split eh.select / eh.typeid.for intrinsics into i32/i64 versions. This is needed, because they just "mark" register
liveins and we let frontend solve type issue, not lowering code :)

llvm-svn: 41763
2007-09-07 11:39:35 +00:00
Chris Lattner 85a51e0060 Don't zap back to back volatile load/stores
llvm-svn: 41759
2007-09-07 05:33:03 +00:00
Owen Anderson e2f23a3abf Add lengthof and endof templates that hide a lot of sizeof computations.
Patch by Sterling Stein!

llvm-svn: 41758
2007-09-07 04:06:50 +00:00
David Greene 517d5d8ebe Constify to catch bugs.
llvm-svn: 41751
2007-09-06 19:46:46 +00:00
Dale Johannesen bed9dc423c Next round of APFloat changes.
Use APFloat in UpgradeParser and AsmParser.
Change all references to ConstantFP to use the
APFloat interface rather than double.  Remove
the ConstantFP double interfaces.
Use APFloat functions for constant folding arithmetic
and comparisons.
(There are still way too many places APFloat is
just a wrapper around host float/double, but we're
getting there.)

llvm-svn: 41747
2007-09-06 18:13:44 +00:00
Anton Korobeynikov a07765b8f4 Proper handle case, when aliasee is external weak symbol referenced only by alias itself.
Also, fix a case, when target doesn't have weak symbols supported.

llvm-svn: 41746
2007-09-06 17:21:48 +00:00
David Greene a6d5d2a6a0 Add instruction dump output. This helps find bugs.
llvm-svn: 41744
2007-09-06 16:36:39 +00:00
David Greene 65d2a697dc Pluggable coalescers inplementation.
llvm-svn: 41743
2007-09-06 16:18:45 +00:00
Nick Lewycky 0c5c47944a Use isTrueWhenEqual. Thanks Chris!
llvm-svn: 41741
2007-09-06 02:40:25 +00:00
Nick Lewycky b0b066eaaa When the two operands of an icmp are equal, there are five possible predicates
that would make the icmp true. Fixes PR1637.

llvm-svn: 41740
2007-09-06 01:10:22 +00:00
Evan Cheng d059eed1c1 Fix a memory leak.
llvm-svn: 41739
2007-09-06 01:07:24 +00:00
Evan Cheng 189df733ed Fix a bug in X86InstrInfo::convertToThreeAddress that caused it to codegen:
leal    (,%rcx,8), %rcx
It should be
leal    (,%rcx,8), %ecx

llvm-svn: 41735
2007-09-06 00:14:41 +00:00
Bill Wendling b65ef38590 LVXL and STVXL are also a load and store resp.
llvm-svn: 41733
2007-09-05 23:47:12 +00:00
Evan Cheng db53aef53e Use pool allocator for all the VNInfo's to improve memory access locality. This reduces coalescing time on siod Mac OS X PPC by 35%. Also remove the back ptr from VNInfo to LiveInterval and other tweaks.
llvm-svn: 41729
2007-09-05 21:46:51 +00:00
Evan Cheng 3dba41bf37 Added Reset() to free all allocated memory regions and reset state to be the same as right after ctor.
llvm-svn: 41728
2007-09-05 21:41:34 +00:00
Evan Cheng 19ce37a1cd Missing break. Patch by Wojciech Matyjewicz.
llvm-svn: 41727
2007-09-05 21:36:14 +00:00
Dale Johannesen 728687c423 Fix mod so it actually works. Fix conversions to
native types to handle denormals correctly.

llvm-svn: 41726
2007-09-05 20:39:49 +00:00
Chuck Rose III 2320323647 Forgot to obey 80 column rule. Fixing that.
llvm-svn: 41725
2007-09-05 20:36:41 +00:00
Chuck Rose III e58572233d Added default parameters to GetElementPtrInstr constructor call. Visual Studio 2k5 was getting confused and was unable to compile it. Suspected compiler error.
llvm-svn: 41721
2007-09-05 16:54:38 +00:00
Duncan Sands 2c0a0fb725 Due to label merging, the last label for an invoke
may be the same as the first label for the following
invoke.  Remove a micro-optimization which was wrong
in this case.

llvm-svn: 41720
2007-09-05 14:12:46 +00:00
Duncan Sands 3c1b7fc056 Fix PR1628. When exception handling is turned on,
labels are generated bracketing each call (not just
invokes).  This is used to generate entries in
the exception table required by the C++ personality.
However it gets in the way of tail-merging.  This
patch solves the problem by no longer placing labels
around ordinary calls.  Instead we generate entries
in the exception table that cover every instruction
in the function that wasn't covered by an invoke
range (the range given by the labels around the invoke).
As an optimization, such entries are only generated for
parts of the function that contain a call, since for
the moment those are the only instructions that can
throw an exception [1].  As a happy consequence, we
now get a smaller exception table, since the same
region can cover many calls.  While there, I also
implemented folding of invoke ranges - successive
ranges are merged when safe to do so.  Finally, if
a selector contains only a cleanup, there's a special
shorthand for it - place a 0 in the call-site entry.
I implemented this while there.  As a result, the
exception table output (excluding filters) is now
optimal - it cannot be made smaller [2].  The
problem with throw filters is that folding them
optimally is hard, and the benefit of folding them is
minimal.

[1] I tested that having trapping instructions (eg
divide by zero) in such a region doesn't cause trouble.
[2] It could be made smaller with the help of higher
layers, eg by having branch folding reorder basic blocks
ending in invokes with the same landing pad so they
follow each other.  I don't know if this is worth doing.

llvm-svn: 41718
2007-09-05 11:27:52 +00:00
Bill Wendling b9bf812ba5 Add the 64-bit versions of the DS* Altivec instructions.
llvm-svn: 41717
2007-09-05 04:05:20 +00:00
Devang Patel f6ef552f3d Insert cloned loop basic blocks before original loop header.
llvm-svn: 41713
2007-09-04 20:46:35 +00:00
Evan Cheng e0cb6bb8da Fix for PR1632. EHSELECTION always produces a i32 value.
llvm-svn: 41712
2007-09-04 20:39:26 +00:00
Evan Cheng 4dbd9f254a Fix for PR1613: added 64-bit rotate left PPC instructions and patterns.
llvm-svn: 41711
2007-09-04 20:20:29 +00:00
David Greene 85948d7474 Update generated files.
llvm-svn: 41706
2007-09-04 18:46:50 +00:00
Evan Cheng 623dd88775 Mac OS X X86-64 ABI is same as the standard.
llvm-svn: 41700
2007-09-04 16:44:41 +00:00
David Greene c656cbb8c2 Update GEP constructors to use an iterator interface to fix
GLIBCXX_DEBUG issues.

llvm-svn: 41697
2007-09-04 15:46:09 +00:00
Anton Korobeynikov 50ab26e835 Reapply r41578 with proper fix
llvm-svn: 41680
2007-09-03 00:36:06 +00:00
Anton Korobeynikov 35322d745c Silence warning while compiling with gcc 4.2
llvm-svn: 41676
2007-09-02 22:11:14 +00:00
Anton Korobeynikov 38ce90fd44 Emit proper "secrel" directive, where possible. This fixes invalid asm syntax of debug info on mingw32. Also, cleanup
some stuff.

llvm-svn: 41675
2007-09-02 22:07:21 +00:00
Evan Cheng 2089a21360 More tweaks to improve compile time.
llvm-svn: 41669
2007-09-01 02:03:17 +00:00
Evan Cheng ffac17a223 Fix a gcroot lowering bug.
llvm-svn: 41668
2007-09-01 02:00:51 +00:00
Dale Johannesen 689d17d282 Oops, should be part of 41664; won't work very well without this piece.
llvm-svn: 41665
2007-08-31 23:35:31 +00:00
Dale Johannesen 446b900192 Add mod, copysign, abs operations to APFloat.
Implement some constant folding in SelectionDAG and
DAGCombiner using APFloat.  Remove double versions
of constructor and getValue from ConstantFPSDNode.

llvm-svn: 41664
2007-08-31 23:34:27 +00:00
Evan Cheng 7bef79a1c3 std::map -> DenseMap for slight compile time benefit.
llvm-svn: 41650
2007-08-31 21:23:06 +00:00
Dale Johannesen da7469f2b5 Revise per review of previous patch.
llvm-svn: 41645
2007-08-31 17:03:33 +00:00
Rafael Espindola e636fc05d6 Initial support for calling functions with byval arguments on x86-64
llvm-svn: 41643
2007-08-31 15:06:30 +00:00
Rafael Espindola bb8a5cff67 Align i64 and f64 at 8 byte on x86-64.
This is mandated table 3.1 at
http://www.x86-64.org/documentation/abi.pdf

llvm-svn: 41642
2007-08-31 12:23:58 +00:00
Evan Cheng 91becf4ffa Remove an unnecessary element, saving 4 bytes per LiveInterval.
llvm-svn: 41641
2007-08-31 08:26:44 +00:00
Evan Cheng 262596e76a Use std::map instead of a (potentially very sparse) array to track val# defined by copy from the other live range. Minor compile time win when number of val# is large.
llvm-svn: 41640
2007-08-31 08:04:17 +00:00
Dale Johannesen 3cf889f75e Enhance APFloat to retain bits of NaNs (fixes oggenc).
Use APFloat interfaces for more references, mostly
of ConstantFPSDNode.

llvm-svn: 41632
2007-08-31 04:03:46 +00:00
Raul Herbster ab871baaf8 Instruction formats added used to generate multiply instructions of V5TE.
llvm-svn: 41629
2007-08-30 23:34:14 +00:00
Raul Herbster ff32b62942 Unused relocation type reloc_arm_absolute removed.
llvm-svn: 41628
2007-08-30 23:31:35 +00:00
Raul Herbster 1457b2b3b1 Comments added. It now generates V5TE multiply instructions. However, it is still necessary to model PUWLSH bits more clearly.
llvm-svn: 41627
2007-08-30 23:29:26 +00:00
Raul Herbster 73489273ae ARM instruction table was modified by adding information to generate multiply instruction of V5TE.
llvm-svn: 41626
2007-08-30 23:25:47 +00:00
Raul Herbster ae1b924c79 JITInfo now resolves function addrs and also relocations. It always emits a stub.
llvm-svn: 41625
2007-08-30 23:21:27 +00:00
Evan Cheng ebb8540067 Added support to fold X86 load / store instructions. This allow rematerialized loads to be folded into their uses.
llvm-svn: 41599
2007-08-30 05:54:07 +00:00
Evan Cheng 32a0a995c6 Try fold re-materialized load instructions into its uses.
llvm-svn: 41598
2007-08-30 05:53:02 +00:00
Evan Cheng 9a25d98c86 Add a variant of foldMemoryOperand to fold any load / store, not just load / store from / to stack slots.
llvm-svn: 41597
2007-08-30 05:52:20 +00:00
Evan Cheng c2081fe573 Mark load instructions with isLoad = 1.
llvm-svn: 41595
2007-08-30 05:49:43 +00:00
Bill Wendling 10e18dea2a Use i64 on a PPC64 machine
llvm-svn: 41590
2007-08-30 00:59:19 +00:00
Dale Johannesen d246b2ca5c Change LegalFPImmediates to use APFloat.
Add APFloat interfaces to ConstantFP, SelectionDAG.
Fix integer bit in double->APFloat conversion.
Convert LegalizeDAG to use APFloat interface in
ConstantFPSDNode uses.

llvm-svn: 41587
2007-08-30 00:23:21 +00:00
Anton Korobeynikov 2bdec2a5ee Fix use of declaration inside case block
llvm-svn: 41584
2007-08-29 23:18:48 +00:00
Evan Cheng 1ad4a6117b Change LiveRange so it keeps a pointer to the VNInfo rather than an index.
Changes related modules so VNInfo's are not copied. This decrease
copy coalescing time by 45% and overall compilation time by 10% on siod.

llvm-svn: 41579
2007-08-29 20:45:00 +00:00
Anton Korobeynikov 830b1cb4e9 Lower FRAME_TO_ADDR_OFFSET to zero by default (if not custom lowered)
llvm-svn: 41578
2007-08-29 19:28:29 +00:00
Duncan Sands 7741427a09 Move getX86RegNum into X86RegisterInfo and use it
in the trampoline lowering.  Lookup the jump and
mov opcodes for the trampoline rather than hard
coding them.

llvm-svn: 41577
2007-08-29 19:01:20 +00:00
Chris Lattner 8d22b4e18a update these
llvm-svn: 41565
2007-08-29 16:15:23 +00:00
Dan Gohman 81b62e1218 Add an option, -view-sunit-dags, for viewing the actual SUnit DAGs used by
scheduling.

llvm-svn: 41556
2007-08-28 20:32:58 +00:00
Evan Cheng a5b10b334f Recover most of the compile time regression due to recent live interval changes.
1. Eliminate the costly live interval "swapping".
2. Change ValueNumberInfo container from SmallVector to std::vector. The former
   performs slowly when the vector size is very large.

llvm-svn: 41536
2007-08-28 08:28:51 +00:00
Bruno Cardoso Lopes 43318839c9 Added method to get Mips register numbers
Changed the stack frame layout, StackGrowsUp fits better to Mips strange stack.
Stack offset calculation bug fixed!

llvm-svn: 41529
2007-08-28 05:13:42 +00:00
Bruno Cardoso Lopes 14033fb5cb Changed stack allocation On LowerFORMAL_ARGUMENTS.
Added comments about new stack allocation.
Expand SelectCC for i32 results

llvm-svn: 41527
2007-08-28 05:08:16 +00:00
Bruno Cardoso Lopes cfd1638e2d Mask directive completed with CalleeSave info
Comments for Mips directives added.

llvm-svn: 41526
2007-08-28 05:06:17 +00:00
Bruno Cardoso Lopes f55a785e56 Added methods to record SPOffsets from LowerFORMAL_ARGUMENTS
llvm-svn: 41525
2007-08-28 05:04:41 +00:00
Chris Lattner 0e258b8518 Cut off crazy computation. This helps PR1622 slightly.
llvm-svn: 41522
2007-08-28 04:23:55 +00:00
Devang Patel d2456a171d Use simpler test to filter loops.
llvm-svn: 41516
2007-08-27 21:34:31 +00:00
David Greene 703623d571 Update InvokeInst to work like CallInst
llvm-svn: 41506
2007-08-27 19:04:21 +00:00
Rafael Espindola b602461f48 Add a comment about using libc memset/memcpy or generating inline code.
llvm-svn: 41502
2007-08-27 17:48:26 +00:00
Dan Gohman 9625d812c9 Make DAGCombiner's global alias analysis query more precise in the case
where both pointers have non-zero offsets.

llvm-svn: 41491
2007-08-27 16:32:11 +00:00
Dan Gohman 8dc0b93151 If the source and destination pointers in an llvm.memmove are known
to not alias each other, it can be translated as an llvm.memcpy.

llvm-svn: 41489
2007-08-27 16:26:13 +00:00
Dan Gohman 71eaf62e5f Change comments to refer to @malloc and @free instead of %malloc and %free.
llvm-svn: 41488
2007-08-27 16:11:48 +00:00
Duncan Sands ef5a654216 There is an impedance matching problem between LLVM and
gcc exception handling: if an exception unwinds through
an invoke, then execution must branch to the invoke's
unwind target.  We previously tried to enforce this by
appending a cleanup action to every selector, however
this does not always work correctly due to an optimization
in the C++ unwinding runtime: if only cleanups would be
run while unwinding an exception, then the program just
terminates without actually executing the cleanups, as
invoke semantics would require.  I was hoping this
wouldn't be a problem, but in fact it turns out to be the
cause of all the remaining failures in the LLVM testsuite
(these also fail with -enable-correct-eh-support, so turning
on -enable-eh didn't make things worse!).  Instead we need
to append a full-blown catch-all to the end of each
selector.  The correct way of doing this depends on the
personality function, i.e. it is language dependent, so
can only be done by gcc.  Thus this patch which generalizes
the eh.selector intrinsic so that it can handle all possible
kinds of action table entries (before it didn't accomodate
cleanups): now 0 indicates a cleanup, and filters have to be
specified using the number of type infos plus one rather than
the number of type infos.  Related gcc patches will cause
Ada to pass a cleanup (0) to force the selector to always
fire, while C++ will use a C++ catch-all (null).

llvm-svn: 41484
2007-08-27 15:47:50 +00:00
Dan Gohman 032d89828e Add explicit keywords and remove spurious trailing semicolons.
llvm-svn: 41482
2007-08-27 14:50:10 +00:00
Rafael Espindola ff33241e16 call libc memcpy/memset if array size is bigger then threshold.
Coping 100MB array (after a warmup) shows that glibc 2.6.1 implementation on
x86-64 (core 2) is 30% faster (from 0.270917s to 0.188079s)

llvm-svn: 41479
2007-08-27 10:18:20 +00:00
Anton Korobeynikov 24fb6b2f8c Don't promote volatile loads/stores. This is needed (for example) to handle setjmp/longjmp properly.
This fixes PR1520.

llvm-svn: 41461
2007-08-26 21:43:30 +00:00
Owen Anderson 2b9ec7ff33 Don't DSe volatile stores.
llvm-svn: 41456
2007-08-26 21:14:47 +00:00
Dale Johannesen b6d2bec418 Revise per review comments.
llvm-svn: 41409
2007-08-26 01:18:27 +00:00
Dale Johannesen 2cfcf70f82 Add APFloat interface to ConstantFPSDNode. Change
over uses in DAGCombiner.  Fix interfaces to work
with APFloats.

llvm-svn: 41407
2007-08-25 22:10:57 +00:00
Devang Patel 6114751544 Move exit condition and exit branch from exiting block into loop header and dominator info. This avoid execution of dead iteration. Loop is already filter in the beginning such that this change is safe.
llvm-svn: 41394
2007-08-25 02:39:24 +00:00
Devang Patel c1ef32ef3d Constant split values needs upper bound and lower bound check, just like any other split value.
llvm-svn: 41389
2007-08-25 01:09:14 +00:00
Chris Lattner 2ed652f11d Allow target constants to be illegal types. The target should
know how to handle them.  This fixes 
test/CodeGen/Generic/asm-large-immediate.ll

llvm-svn: 41388
2007-08-25 01:00:22 +00:00
Devang Patel 4e63e1f5b5 While calculating upper loop bound for first loop and lower loop bound for second loop, take care of edge cases.
llvm-svn: 41387
2007-08-25 00:56:38 +00:00
Chris Lattner dbfc4e4b07 Teach the dag scheduler to handle inline asm nodes with multi-value immediate operands.
llvm-svn: 41386
2007-08-25 00:53:07 +00:00
Bill Wendling 48597b4ff8 The personality function might need to be declared as:
.set  Lset0,___gxx_personality_v0-.
    .long Lset0

on some targets. Make it so!

llvm-svn: 41385
2007-08-25 00:51:55 +00:00
Chris Lattner d8c9cb9182 rename isOperandValidForConstraint to LowerAsmOperandForConstraint,
changing the interface to allow for future changes.

llvm-svn: 41384
2007-08-25 00:47:38 +00:00
Dale Johannesen bdea32d812 Poison APFloat::operator==. Replace existing uses with bitwiseIsEqual.
This means backing out the preceding change to Constants.cpp, alas.

llvm-svn: 41378
2007-08-24 22:09:56 +00:00
Dale Johannesen 7891d8edf0 Use APFloat internally for ConstantFPSDNode.
llvm-svn: 41372
2007-08-24 20:59:15 +00:00
Chris Lattner 0b490b0d38 sink clone() down the class hierarchy from CmpInst into ICmpInst/FCmpInst.
This eliminates a conditional on that path, and ensures ICmpInst/FCmpInst
both have an out-of-line virtual method to home the class.

llvm-svn: 41371
2007-08-24 20:48:18 +00:00
Devang Patel f5a01bf025 Fix regression that I caused yesterday night while adding logic to select appropriate split condition branch.
llvm-svn: 41365
2007-08-24 19:32:26 +00:00
Chris Lattner a124f69c52 Disable EH generation until PPC works 100%.
llvm-svn: 41360
2007-08-24 16:00:15 +00:00
Chris Lattner 51883acec1 add a note
llvm-svn: 41359
2007-08-24 15:17:59 +00:00
Devang Patel 4bc9298f2a It is not safe to execute split condition's true branch first all the time. If split
condition predicate is GT or GE then execute false branch first.

llvm-svn: 41358
2007-08-24 06:17:19 +00:00
Devang Patel 4be56a5d12 Reject ICMP_NE as index split condition.
llvm-svn: 41357
2007-08-24 06:02:25 +00:00
Devang Patel 5e46fac6de Tightenup loop filter.
llvm-svn: 41356
2007-08-24 05:36:56 +00:00
Devang Patel 504dc0aaed Remove incomplete cost analysis.
llvm-svn: 41354
2007-08-24 05:21:13 +00:00
Dale Johannesen 918c33c67a Revised per review feedback from previous patch.
llvm-svn: 41353
2007-08-24 05:08:11 +00:00
Chris Lattner 3da18eb22a silence some warnings in an optimized build.
llvm-svn: 41352
2007-08-24 03:02:34 +00:00
Dale Johannesen a719a60609 Change internal representation of ConstantFP to use APFloat.
Interface to rest of the compiler unchanged, as yet.

llvm-svn: 41348
2007-08-24 00:56:33 +00:00
Chris Lattner 33800d1428 add some notes on really poor codegen.
llvm-svn: 41319
2007-08-23 15:22:07 +00:00
Chris Lattner 92c6a65d4e new example
llvm-svn: 41318
2007-08-23 15:16:03 +00:00
Anton Korobeynikov 97cdac8d19 Perform correct codegen for eh_dwarf_cfa intrinsic.
llvm-svn: 41316
2007-08-23 07:21:06 +00:00
Chris Lattner b0f158cfdf rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned()
Add an APSInt::toString() method.

llvm-svn: 41309
2007-08-23 05:15:32 +00:00
Devang Patel 887db2d832 Remove dead code.
llvm-svn: 41295
2007-08-22 21:07:41 +00:00
Devang Patel 6f4f23320d Fix typo.
llvm-svn: 41292
2007-08-22 20:55:18 +00:00
Devang Patel 31206b56d5 Cosmetic change
"True Loop" and "False Loop" naming terminology to refer two loops
after loop cloning is confusing. Instead just use A_Loop and B_Loop.

llvm-svn: 41287
2007-08-22 19:33:29 +00:00
Andrew Lenharth beb80a9832 move this check. ppc outputs .no_dead_strip properly
llvm-svn: 41286
2007-08-22 19:33:11 +00:00
Bill Wendling 862afea91e Add the PCSymbol for Darwin x86 platforms.
llvm-svn: 41284
2007-08-22 18:44:05 +00:00
Devang Patel 90da534987 Refactor loop condition check in a separate function.
llvm-svn: 41282
2007-08-22 18:27:01 +00:00
Devang Patel cd8beb7645 Fix thinko.
Starting value of second loop's induction variable can not be lower 
then starting value of original loop's induction variable.

llvm-svn: 41280
2007-08-22 18:07:47 +00:00
Devang Patel a12000d572 Rename bunch of variables.
llvm-svn: 41250
2007-08-21 21:12:02 +00:00
Devang Patel f98db5e62a Preserve LCSSA.
llvm-svn: 41246
2007-08-21 19:47:46 +00:00
Devang Patel f5e520d892 Use SmallVector.
llvm-svn: 41230
2007-08-21 16:54:51 +00:00
Devang Patel a9e7c4f827 No need to hardcode SmallVector size.
llvm-svn: 41228
2007-08-21 16:39:43 +00:00
Bruno Cardoso Lopes b10580ac1e InlineAsm asm support for integer registers added
llvm-svn: 41225
2007-08-21 16:09:25 +00:00
Bruno Cardoso Lopes d4b9945a21 Instruction Itinerary attribution fixed
llvm-svn: 41224
2007-08-21 16:06:45 +00:00
Chris Lattner 913849b5df Fix potentially N^2 behavior handling arrays with many of the
same value which get RAUW'd.  This speeds up reading the .bc
file in PR1616 from 852s to 0.19s on my G5 with a debug build.

llvm-svn: 41209
2007-08-21 00:55:23 +00:00
Anton Korobeynikov f335679b52 Use only 1 knob to enable exceptions on Darwin :).
llvm-svn: 41208
2007-08-21 00:31:30 +00:00
Devang Patel b5933bbbd5 Use SmallVector instead of std::vector.
llvm-svn: 41207
2007-08-21 00:31:24 +00:00
Chris Lattner 8e5b2c27a3 simplify code, improve a comment.
llvm-svn: 41205
2007-08-21 00:21:07 +00:00
Devang Patel 8f4228d619 s/ExitBlock/ExitingBlock/g
llvm-svn: 41204
2007-08-20 23:51:18 +00:00
Chris Lattner fe02c1f97f initial checkin of Neil's APFloat work.
llvm-svn: 41203
2007-08-20 22:49:32 +00:00
Anton Korobeynikov 5849a625ff - Use correct header for SCEV inside LoopPass.cpp
- Move SCEVExpander::expand() out-of-line workarounding possible toolchain bug

llvm-svn: 41197
2007-08-20 21:17:26 +00:00
Devang Patel 49c4f9a889 Replace indunction variable with split value in loop body.
This fixes art miscompile.

llvm-svn: 41195
2007-08-20 20:49:01 +00:00
Devang Patel c2e2d15f45 Do not split loops rejected by processOneIterationLoop().
llvm-svn: 41194
2007-08-20 20:24:15 +00:00
Dan Gohman 54a187ea8b Minor cleanups to reduce some spurious differences between different
scheduler implementations.

llvm-svn: 41191
2007-08-20 19:28:38 +00:00
Dan Gohman f63668e655 Add Type::isIntOrIntVector, like Type::isFPOrFPVector.
llvm-svn: 41190
2007-08-20 19:25:59 +00:00
Dan Gohman 3a0714836e When Intrinsic::getName is constructing names for overloaded intrinsics,
use the ValueType name instead of the llvm type name, to match what the
verifier expects. For integers these are the same, but for floating-point
values the intrinsics use f32/f64 instead of float/double.

llvm-svn: 41189
2007-08-20 19:23:34 +00:00
Rafael Espindola 9c3d20d823 Partial implementation of calling functions with byval arguments:
*) The needed information is propagated to the DAG
 *) The X86-64 backend detects it and aborts

llvm-svn: 41179
2007-08-20 15:18:24 +00:00
Chris Lattner 78846b69ae add a note
llvm-svn: 41178
2007-08-20 02:14:33 +00:00
Chris Lattner 1cc79985cd Fix PR1611 - Visibility should be ignored for a declaration
when a definition's visibility is different.  Likewise, the
visibility of two declarations mismatching is not an error.

llvm-svn: 41174
2007-08-19 22:22:54 +00:00
Chris Lattner 10f03a644a simplify code and print visibility for declarations.
llvm-svn: 41173
2007-08-19 22:15:26 +00:00
Nick Lewycky bfa9499a88 Oops, remove assert that wasn't meant to be committed.
llvm-svn: 41170
2007-08-18 23:21:28 +00:00
Nick Lewycky 5b5b1ab9e0 Never insert duplicate edges.
llvm-svn: 41169
2007-08-18 23:18:03 +00:00
Nick Lewycky a0d49dac26 Typo.
llvm-svn: 41168
2007-08-18 15:08:56 +00:00
Chris Lattner e2de908a28 Compute the argument list as lazily as possible. This ensures that clients
that don't use it don't have to pay the memory cost for the arguments.  This
allows us to avoid creating Argument nodes for many prototypes and for clients
who lazily deserialize code from a bytecode file.

llvm-svn: 41166
2007-08-18 06:14:52 +00:00
Chris Lattner 45ffa21cb3 use a nicer accessor.
llvm-svn: 41165
2007-08-18 06:13:19 +00:00
Evan Cheng f5a23abf37 Fold C ? 0 : 1 to ~C or zext(~C) or trunc(~C) depending the types.
llvm-svn: 41163
2007-08-18 05:57:05 +00:00
Bruno Cardoso Lopes 9fbef51078 MipsHi now has ouput flag
MipsAdd SDNode created to add support to an Add opcode which supports input flag
Added an instruction itinerary to all instruction classes
Added branches with zero cond codes
Now call clobbers all non-callee saved registers
Call w/ register support added
Added DelaySlot to branch and load instructions
Added patterns to handle all setcc, brcond/setcc and MipsAdd instructions

llvm-svn: 41161
2007-08-18 02:37:46 +00:00
Bruno Cardoso Lopes eabe61b080 Fixed stack frame addressing bug
llvm-svn: 41160
2007-08-18 02:19:09 +00:00
Bruno Cardoso Lopes f3c55807f2 support for Schedule included on Mips.td
llvm-svn: 41159
2007-08-18 02:18:07 +00:00
Bruno Cardoso Lopes 4bd7f4db9f Removed LowerRETURADDR, fixed small bug into LowerRET, LowerGlobalAddress
fixed to generate instructions (add, lui) glued!

llvm-svn: 41158
2007-08-18 02:16:30 +00:00
Bruno Cardoso Lopes 833a1f9b55 Couple of small changes. Delay Slot handle header declared.
Newline added after macros at function init on generated asm!

llvm-svn: 41157
2007-08-18 02:05:24 +00:00
Bruno Cardoso Lopes 5792189590 Added InstrItinClass support for instruction formats
llvm-svn: 41156
2007-08-18 02:01:28 +00:00
Bruno Cardoso Lopes 0c530638c7 Branch Analysis and InsertNoop inserted into header files
llvm-svn: 41155
2007-08-18 01:59:45 +00:00
Bruno Cardoso Lopes a746512fc5 createMipsDelaySlotFillerPass added to mips codegen runtime
llvm-svn: 41154
2007-08-18 01:58:15 +00:00
Bruno Cardoso Lopes 7b616f5742 Added Branch Analysis support
Added InsertNoop support

llvm-svn: 41153
2007-08-18 01:56:48 +00:00
Bruno Cardoso Lopes e8d1c52cd4 LowerRETURNADDR removed since it was wrong and does not have utility yet!
MipsAdd opcode added

llvm-svn: 41152
2007-08-18 01:54:09 +00:00
Bruno Cardoso Lopes 87beec9afb InstrItineraryData support on added.
Added Mips3 ISA feature (needed when supporting R4000 machines)

llvm-svn: 41151
2007-08-18 01:52:27 +00:00
Bruno Cardoso Lopes 0b97ce752c A Pass to insert Nops on intructions with DelaySlot
llvm-svn: 41150
2007-08-18 01:50:47 +00:00
Bruno Cardoso Lopes 415ded5d5a Mips generic fallback instruction schedule support!
llvm-svn: 41149
2007-08-18 01:46:44 +00:00
Devang Patel 1282b6e181 Avoid spliting loops where two split condition branches are not independent.
llvm-svn: 41148
2007-08-18 00:00:32 +00:00
Devang Patel d1fcfcc76c When one branch of condition is eliminated then head of the other
branch is not necessary immediate dominators of merge blcok in all cases.

llvm-svn: 41144
2007-08-17 21:59:16 +00:00
Evan Cheng cb6d65e1bf Avoid issue on 64-bit hosts.
llvm-svn: 41143
2007-08-17 18:02:22 +00:00
David Greene 81db5acab0 Fix GLIBCXX_DEBUG error of comparing two singular iterators
llvm-svn: 41139
2007-08-17 15:13:55 +00:00
Evan Cheng 631ccc6144 If dynamic_stackalloc alignment is > stack alignment, first issue an instruction to align the stack ptr before the decrement.
llvm-svn: 41133
2007-08-16 23:50:06 +00:00
Evan Cheng 95667c532c - If a dynamic_stackalloc alignment requirement is <= stack alignment, then the alignment argument is ignored.
- *Always* round up the size of the allocation to multiples of stack
alignment to ensure the stack ptr is never left in an invalid state after a dynamic_stackalloc.

llvm-svn: 41132
2007-08-16 23:46:29 +00:00
Owen Anderson f5023a7a84 Factor out some code into a helper function.
llvm-svn: 41131
2007-08-16 22:51:56 +00:00
Dan Gohman 88ac781644 Fix the verification for overloaded intrinsic types. Check that they are
what they're supposed to be before using them.

llvm-svn: 41130
2007-08-16 22:06:45 +00:00
Owen Anderson 221a43604e Add some more comments to GVN.
llvm-svn: 41129
2007-08-16 22:02:55 +00:00
Dan Gohman febf946ea7 Add MVT::fAny for overloading intrinsics on floating-point types.
llvm-svn: 41128
2007-08-16 21:57:19 +00:00
Owen Anderson 5f208bea91 Cache non-local memory dependence analysis. This is a significant compile
time performance win in most cases.

llvm-svn: 41126
2007-08-16 21:27:05 +00:00
Chris Lattner 6b69568f85 This adds a bunch of static functions that implement unsigned
two's complement bignum arithmetic.  They could be used to
implement much of APInt, but the idea is they are enough to
implement APFloat as well, which the current APInt interface
is not suited for.

Patch by Neil Booth!

llvm-svn: 41124
2007-08-16 15:56:55 +00:00
Reid Spencer 19c21c593f Improve error handling in the linker by:
1. Eliminate redundant error messages. LinkInFile and LinkInArchive
   already call the error() method in each case so there's no use
   telling the user again that an item couldn't be linked in.

2. Improve the formatting of error messages (separating content).

3. Change the wording for the warning about unrecognized files. Make
   it clear that the file is being ignored.

llvm-svn: 41121
2007-08-16 07:47:30 +00:00
Evan Cheng 70c2de7bf1 Fix some kill info update bugs; add hidden option -disable-rematerialization to turn off remat for debugging.
llvm-svn: 41118
2007-08-16 07:24:22 +00:00
Reid Spencer e97fee7188 Ensure that error messages a propagated from calls to LinkInModule so they get
reported to the end user.

llvm-svn: 41117
2007-08-16 07:23:37 +00:00
Lauro Ramos Venancio a392cd2fde Implement FPOWI ExpandOp.
Fix PR1287.

llvm-svn: 41112
2007-08-15 22:13:27 +00:00
Anton Korobeynikov b61c63ecd0 Properly use const qualifiers
llvm-svn: 41111
2007-08-15 21:12:30 +00:00
Evan Cheng 958cf3d43e If the source of a move is in spill slot, the reload may be folded to essentially a load from stack slot. It's ok to mark the stack slot value as available for reuse. But it should not be clobbered since the destination of the move is live.
llvm-svn: 41109
2007-08-15 20:20:34 +00:00
Anton Korobeynikov 597c8b77e4 Move ReturnAddrIndex variable to X86MachineFunctionInfo structure. This fixed
hard to catch bugs with retaddr lowering

llvm-svn: 41104
2007-08-15 17:12:32 +00:00
Chris Lattner db8adb9941 add a note.
llvm-svn: 41103
2007-08-15 16:58:38 +00:00
Devang Patel 3640e78057 Dominance frontier is now required.
llvm-svn: 41096
2007-08-15 03:34:53 +00:00
Devang Patel b81bcbde09 Cleanup removeBlocks.
Use dominance frontier to fixup incoming edges of successor blocks not domianted by DeadBB.
Use df_iterator to walk and delete basic blocks dominated by DeadBB.

llvm-svn: 41095
2007-08-15 03:31:47 +00:00
Reid Spencer 0db035567c Remove unneeded header file.
llvm-svn: 41094
2007-08-15 03:01:04 +00:00
Devang Patel f55b79fa71 Avoid triangle loops.
llvm-svn: 41093
2007-08-15 02:14:55 +00:00
Devang Patel 22c7993ecf Break infinite loop.
llvm-svn: 41091
2007-08-14 23:59:17 +00:00
Devang Patel 7cad917160 Avoid nested loops at the moment.
llvm-svn: 41090
2007-08-14 23:53:57 +00:00
Evan Cheng 3f22fffe94 - If a def is dead, do not spill it.
- If the defs of a spilled rematerializable MI are dead after the spill store is deleted, delete
  the def MI as well.

llvm-svn: 41086
2007-08-14 23:25:37 +00:00
Evan Cheng 94168a4ed0 Fix for PR1596: AdjustCopiesBackFrom() should conservatively check if any of its sub-registers may overlap with the interval of the copy that's being coalesced.
llvm-svn: 41084
2007-08-14 23:19:28 +00:00
Evan Cheng 6cb9fd7be5 If a MI's def is remat as well as spilled, and the store is later deemed dead, mark the def operand as isDead.
llvm-svn: 41083
2007-08-14 20:23:13 +00:00
Devang Patel 33ba97d747 Fix dominance frontier update while removing blocks.
llvm-svn: 41082
2007-08-14 18:35:57 +00:00
Owen Anderson bc271a02fd Eliminate PHI nodes with constant values during normal GVN processing, even when
they're not related to eliminating a load.

llvm-svn: 41081
2007-08-14 18:33:27 +00:00
Owen Anderson 398602a6eb Be more aggressive in pruning unnecessary PHI nodes when doing PHI construction.
llvm-svn: 41080
2007-08-14 18:16:29 +00:00
Owen Anderson 676070d503 Make GVN iterative.
llvm-svn: 41078
2007-08-14 18:04:11 +00:00
Owen Anderson a7b220f23a Fix a case where GVN was failing to return true when it had, in fact, modified
the function.

llvm-svn: 41077
2007-08-14 17:59:48 +00:00
Devang Patel 367260c0df Assert sooner. Fix wordings.
llvm-svn: 41075
2007-08-14 16:53:52 +00:00
Evan Cheng 234386509b If a spilled value is being reused and the use is a kill, that means there are
no more uses within the MBB and the spilled value isn't live out of the MBB.
Then it's safe to delete the spill store.

llvm-svn: 41069
2007-08-14 09:11:18 +00:00
Evan Cheng 78a8806f4f If a rematerializable def is not deleted, i.e. it is also spilled, check if the
spilled value is available for reuse.

llvm-svn: 41067
2007-08-14 05:42:54 +00:00
Evan Cheng 74c69f7588 Kill info update bugs.
llvm-svn: 41064
2007-08-14 01:56:58 +00:00
Devang Patel dbe8497d45 Handle last value assignments.
llvm-svn: 41063
2007-08-14 01:30:57 +00:00
Devang Patel f74ccbb4e8 StartValue is already calculated.
llvm-svn: 41062
2007-08-14 00:15:45 +00:00
Evan Cheng 33820da1da Re-implement trivial rematerialization. This allows def MIs whose live intervals that are coalesced to be rematerialized.
llvm-svn: 41060
2007-08-13 23:45:17 +00:00
Evan Cheng b2823dac69 Fix a typo pointd out by Maarten ter Huurne.
llvm-svn: 41059
2007-08-13 23:27:11 +00:00
Devang Patel 948653915f Preserve simple analysis.
llvm-svn: 41054
2007-08-13 22:22:13 +00:00
Devang Patel b8a41bb4f1 Preserve dominator info.
llvm-svn: 41053
2007-08-13 22:13:24 +00:00
Devang Patel c0fa0c52b3 Add methods to erase basic block entry.
llvm-svn: 41052
2007-08-13 22:10:29 +00:00
Devang Patel da48cf40db If NewBB dominates DestBB then DestBB is not part of NewBB's dominance frontier.
llvm-svn: 41051
2007-08-13 21:59:17 +00:00
Chris Lattner 2b40caa861 move assertion into mutex guard, a partial fix for PR1606.
llvm-svn: 41050
2007-08-13 20:08:16 +00:00
Dan Gohman ccb3611881 When x86 addresses matching exceeds its recursion limit, check to
see if the base register is already occupied before assuming it can be
used. This fixes bogus code generation in the accompanying testcase.

llvm-svn: 41049
2007-08-13 20:03:06 +00:00
Chris Lattner 4e7f673f65 Fix PR1607
llvm-svn: 41048
2007-08-13 18:42:37 +00:00
Chris Lattner aadc778782 Constant fold: getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1)
Into: inttoptr (i64 0 to i8*)  -> null

This occurs in the example in PR1602.  With this fixed, we now compile
the example in PR1602 into fully "devirtualized" code:

define void @_Z1g1S(%struct.S* noalias  %s) {
entry:        %tmp131415 = getelementptr %struct.S* %s, i32 0, i32 0          ; <i32 (...)***> [#uses=1]        %tmp16 = load i32 (...)*** %tmp131415, align 4          ; <i32 (...)**> [#uses=1]
        %tmp26277 = load i32 (...)** %tmp16             ; <i32 (...)*> [#uses=1]
        %tmp2829 = bitcast i32 (...)* %tmp26277 to void (%struct.S*)*           ; <void (%struct.S*)*> [#uses=1]
        tail call void %tmp2829( %struct.S* %s )
        ret void
}

This still has the vtable dispatch (as required) but does not have any pointer
to method cruft left.

llvm-svn: 41046
2007-08-13 17:09:08 +00:00
Evan Cheng 5ca98c657d Kill info update bugs.
llvm-svn: 41043
2007-08-13 07:12:23 +00:00
Devang Patel f258578206 Split loops and do CFG cleanup.
llvm-svn: 41029
2007-08-12 07:02:51 +00:00
Reid Spencer 9f90f965de Remove unused variables.
llvm-svn: 41028
2007-08-12 04:45:36 +00:00
Evan Cheng af21e9550e No need to remove dead range from soon-to-be-dead live interval. Its val# may be out of whack.
llvm-svn: 41024
2007-08-12 01:26:19 +00:00
Chris Lattner 460e34afed constant fold ptrtoint(inttoptr) with target data when available. This allows
us to fold the entry block of PR1602 to false instead of:

br i1 icmp eq (i32 and (i32 ptrtoint (void (%struct.S*)* inttoptr (i64
1 to void (%struct.S*)*) to i32), i32 1), i32 0), label %cond_next, label
%cond_true

llvm-svn: 41023
2007-08-11 23:49:01 +00:00
Chris Lattner 99c8ee2977 Transform a load from an undef/zero global into an undef/global even if we
have complex pointer manipulation going on.  This allows us to compile
stuff like this:

__m128i foo(__m128i x){
                static const unsigned int c_0[4] = { 0, 0, 0, 0 };
                __m128i v_Zero = _mm_loadu_si128((__m128i*)c_0);
                x  = _mm_unpacklo_epi8(x,  v_Zero);
                return x;
}

into:

_foo:
        xorps   %xmm1, %xmm1
        punpcklbw       %xmm1, %xmm0
        ret

llvm-svn: 41022
2007-08-11 18:48:48 +00:00
Chris Lattner 750b3dfcf5 expand a note
llvm-svn: 41021
2007-08-11 18:19:07 +00:00
Chris Lattner ee44ab5b5f With evan's explicit flag representation, hopefully we will finally be
able to 3-addressify away stuff like this:

        movl    %ecx, %eax
        decl    %eax

llvm-svn: 41020
2007-08-11 18:16:46 +00:00
Reid Spencer 2dc9f13278 Fix a comment typo noticed by Sandro Magi.
llvm-svn: 41018
2007-08-11 15:57:56 +00:00
Bill Wendling cdbd82ee37 64-bit SSSE3 ops that use MMX registers don't require 16-byte alignment.
Make a 'memop' pattern just for them.

llvm-svn: 41017
2007-08-11 09:52:53 +00:00
Evan Cheng 05cc486c7b Code to maintain kill information during register coalescing.
llvm-svn: 41016
2007-08-11 00:59:19 +00:00
Christopher Lamb 44e79f8aba Use subregs to improve any_extend code generation when feasible.
llvm-svn: 41013
2007-08-10 22:22:41 +00:00
Christopher Lamb b372abab14 Increase efficiency of sign_extend_inreg by using subregisters for truncation. As the README suggests sign_extend_subreg is selected to (sext(trunc)).
llvm-svn: 41010
2007-08-10 21:48:46 +00:00
Christopher Lamb f0c236fb8a Edit README in light of previous LEA16 commit.
llvm-svn: 41009
2007-08-10 21:29:05 +00:00
Christopher Lamb d36d30b53c Add 2-addr to 3-addr promotion code that allows 32-bit LEA to be used via subregisters when 16-bit LEA is disabled.
llvm-svn: 41007
2007-08-10 21:18:25 +00:00
Christopher Lamb e081928f49 Move isSubRegOf into MRegisterInfo. Fix a missed move elimination in LowerSubregs and add more debugging output there.
llvm-svn: 41005
2007-08-10 21:11:55 +00:00
Devang Patel d305c404be Do not overuse std::string. Pass around char * directly.
llvm-svn: 41001
2007-08-10 18:29:32 +00:00
Devang Patel f417c2cc34 Clone loop.
llvm-svn: 40998
2007-08-10 18:07:13 +00:00
Devang Patel aa36a43908 Add utility to clone loops.
llvm-svn: 40997
2007-08-10 17:59:47 +00:00
Chris Lattner 5109a88ac3 add Value::getNameStart/getNameLen() accessors.
llvm-svn: 40989
2007-08-10 15:34:35 +00:00
Dan Gohman a17799a3bd Fix EXTRACT_ELEMENT, EXTRACT_SUBVECTOR, and EXTRACT_VECTOR_ELT to
use an intptr ValueType instead of i32 for the index operand in
getCopyToParts.

llvm-svn: 40987
2007-08-10 14:59:38 +00:00
Rafael Espindola 66011c17d5 propagate struct size and alignment of byval arguments to the DAG
llvm-svn: 40986
2007-08-10 14:44:42 +00:00
Bill Wendling 7014615087 For kicks, I though it would be fun to use the correct opcode.
llvm-svn: 40985
2007-08-10 09:00:17 +00:00
Bill Wendling 2377206923 Adding SSSE3 intrinsics.
llvm-svn: 40982
2007-08-10 06:22:27 +00:00
Chris Lattner de2aa65877 minor simplifications.
llvm-svn: 40981
2007-08-10 06:22:25 +00:00
Chris Lattner dd6304f6b1 avoid copying strings.
llvm-svn: 40980
2007-08-10 06:17:04 +00:00
Devang Patel 9a4761464f Remove unncessary duplication.
llvm-svn: 40979
2007-08-10 00:59:03 +00:00
Devang Patel 7bdf4531bb Calculate exit and start value of true loop and false loop respectively.
llvm-svn: 40978
2007-08-10 00:53:35 +00:00
Devang Patel 67af6cd7ea ExitCondition and Induction variable are loop constraints
not split condition constraints.

llvm-svn: 40977
2007-08-10 00:33:50 +00:00
Chris Lattner 2b9fe84b07 unbreak the build
llvm-svn: 40976
2007-08-09 23:55:17 +00:00
Evan Cheng 1115a2b412 Bug fix. ~1U marks the val# dead.
llvm-svn: 40975
2007-08-09 23:14:39 +00:00
Dale Johannesen bdad80977b Patch 10 for long double. Doing constants right needs expanding ConstantFP
to handle values bigger than double.  If we assume host==target and host
long double works correctly, this is not too bad, but we don't want to
have that limitation longterm.  I could implement accepting double
constants as long double or something like that, which would lead to
incorrect codegen with no errors; the more I think about that the worse
it seems.  Rather than do such a hack that would be backed out later,
I'm settling for giving reasonable error messages, for now.

llvm-svn: 40974
2007-08-09 22:51:36 +00:00
Evan Cheng f855b626e8 Temporarily backing out this change until we know why some dejagnu tests are failing.
llvm-svn: 40973
2007-08-09 22:25:35 +00:00
Evan Cheng e32e923a6a divb / mulb outputs to ah. Under x86-64 it's not legal to read ah if the instruction requires a rex prefix (i.e. outputs to r8b, etc.). So issue shift right by 8 on AX and then truncate it to 8 bits instead.
llvm-svn: 40972
2007-08-09 21:59:35 +00:00
Chris Lattner a8e4b4bc7b when we see a unaligned load from an insufficiently aligned global or
alloca, increase the alignment of the load, turning it into an aligned load.

This allows us to compile:

#include <xmmintrin.h>
__m128i foo(__m128i x){
 static const unsigned int c_0[4] = { 0, 0, 0, 0 };
	  __m128i v_Zero = _mm_loadu_si128((__m128i*)c_0);
  x  = _mm_unpacklo_epi8(x,  v_Zero);
  return x;
}

into:

_foo:
	punpcklbw	_c_0.5944, %xmm0
	ret
	.data
	.lcomm	_c_0.5944,16,4		# c_0.5944

instead of:

_foo:
	movdqu	_c_0.5944, %xmm1
	punpcklbw	%xmm1, %xmm0
	ret
	.data
	.lcomm	_c_0.5944,16,2		# c_0.5944

llvm-svn: 40971
2007-08-09 19:05:49 +00:00
Evan Cheng a05ec4dc52 GR16_ sub-register class should be GR8_, not GR8. That is, it should only be 8-bit registers in 32-bit mode. Ditto for GR32_.
llvm-svn: 40970
2007-08-09 18:05:17 +00:00
Dale Johannesen c339e45274 Update per review comments.
llvm-svn: 40965
2007-08-09 17:27:48 +00:00
Owen Anderson 9b1cc8cac0 Make NonLocal and None const in the right way. :-)
llvm-svn: 40961
2007-08-09 04:42:44 +00:00
Devang Patel 42e3e5bec1 Traverse loop blocks' terminators to find split candidates.
llvm-svn: 40960
2007-08-09 01:39:01 +00:00
Dale Johannesen ba1a98a4e0 long double 9 of N. This finishes up the X86-32 bits
(constants are still not handled).  Adds ConvertActions
to control fp-to-fp conversions (these are currently
defaulted for all other targets, so no changes there).

llvm-svn: 40958
2007-08-09 01:04:01 +00:00
Dale Johannesen f5124b36e4 Fix arguments for some Altivec instructions. From SWB.
llvm-svn: 40957
2007-08-09 00:49:19 +00:00
Scott Michel 9d09c5ccda If a target really needs to custom lower constants, it should be allowed
to do so.

llvm-svn: 40955
2007-08-08 23:23:31 +00:00
Owen Anderson 2b21c3c7a8 Add more comments to memdep.
llvm-svn: 40953
2007-08-08 22:26:03 +00:00
Devang Patel 0183c797c4 Add cost analysis.
llvm-svn: 40952
2007-08-08 22:25:28 +00:00
Owen Anderson fa788358d5 Make memdep fit in 80 cols.
llvm-svn: 40950
2007-08-08 22:01:54 +00:00
Devang Patel 0e34ee25ab Preserve dom info while processing one iteration loop.
llvm-svn: 40947
2007-08-08 21:39:47 +00:00
Owen Anderson b84d3b1c92 Change the None and NonLocal markers in memdep to be const.
llvm-svn: 40946
2007-08-08 21:39:39 +00:00
Devang Patel 8abc5c82b7 Clear split info.
llvm-svn: 40944
2007-08-08 21:18:27 +00:00
Devang Patel 593bf9ceb3 Handle multiple split conditions.
llvm-svn: 40941
2007-08-08 21:02:17 +00:00
Reid Spencer 155533cf73 Make getSTDIN return null if the standard input is empty, as the header file
documentation implies and as its uses depend.

llvm-svn: 40939
2007-08-08 20:01:58 +00:00
Reid Spencer 8609c06956 Allow the filename "-" to be a place holder for stdin. This allows directing
stdin through llvm-ld and llvm-link.

llvm-svn: 40938
2007-08-08 19:52:29 +00:00
Owen Anderson 680862880d Global values also don't undead-ify pointers in our dead alloca's set.
llvm-svn: 40936
2007-08-08 19:12:31 +00:00
Owen Anderson ddf4aee543 Make handleEndBlock significantly faster with one trivial improvement,
and one hack to avoid hitting a bad case when the alias analysis is imprecise.

llvm-svn: 40935
2007-08-08 18:38:28 +00:00
Owen Anderson 50df9685b0 Small improvement: if a function doesn't access memory, we don't need to scan
it for potentially undeading pointers.

llvm-svn: 40933
2007-08-08 17:58:56 +00:00
Owen Anderson 52aaabf74d Add some comments, remove a dead argument, and simplify some control flow.
No functionality change.

llvm-svn: 40932
2007-08-08 17:50:09 +00:00
Chris Lattner d1fd0db2ae eliminate redundant conditions from the signless types conversion.
llvm-svn: 40927
2007-08-08 16:19:57 +00:00
Chris Lattner 7574ef3ac4 Handle functions with no name better.
llvm-svn: 40926
2007-08-08 16:07:23 +00:00
Evan Cheng d771b793fe Adding kill info to val#.
llvm-svn: 40925
2007-08-08 07:03:29 +00:00
Chris Lattner 785f9986bd significantly speed up constant folding of calls (and thus all clients that use
ConstantFoldInstruction on calls) by avoiding Value::getName().  getName() constructs
and returns an std::string, which does heap allocation stuff.  This slightly speeds up
instcombine.

llvm-svn: 40924
2007-08-08 06:55:43 +00:00
Chris Lattner 415750e132 Speed up updateDFSNumbers with two observations:
1. domtree is a tree, not a graph.  There is no need to avoid revisiting nodes with a set.
2. the worklist can contain the child iterator pointers so we don't get N^2 rescanning of children.

This speeds up updateDFSNumbers significantly, making it basically free.  On the testcase in PR1432,
this speeds up loopsimplify by another 3x, dropping it from the 12th most expensive pass to the to
the 30th. :)  It used to be #1.

llvm-svn: 40923
2007-08-08 06:24:20 +00:00
Owen Anderson b17ab03081 A few more small cleanups.
llvm-svn: 40922
2007-08-08 06:06:02 +00:00
Evan Cheng 103947125c Clean up and bug fix.
llvm-svn: 40921
2007-08-08 05:56:18 +00:00
Chris Lattner c63d4c2e4e reimplement dfs number computation to be significantly faster. This speeds up
natural loop canonicalization (which does many cfg xforms) by 4.3x, for 
example.  This also fixes a bug in postdom dfnumber computation.

llvm-svn: 40920
2007-08-08 05:51:24 +00:00
Owen Anderson 0aecf0ebef First round of cleanups from Chris' feedback.
llvm-svn: 40919
2007-08-08 04:52:29 +00:00
Evan Cheng a8c2f38617 - Each val# can have multiple kills.
- Fix some minor bugs related to special markers on val# def. ~0U means
  undefined, ~1U means dead val#.

llvm-svn: 40916
2007-08-08 03:00:28 +00:00
Devang Patel 68de1ae816 Embrace patch review feedback.
llvm-svn: 40915
2007-08-08 01:51:27 +00:00
Evan Cheng c236617ea0 Remove a dead assertion.
llvm-svn: 40914
2007-08-08 01:00:21 +00:00
Evan Cheng 0d0fee269a - LiveInterval value#'s now have 3 components: def instruction #,
kill instruction #, and source register number (iff the value# is defined by a
copy).
- Now def instruction # is set for every value#, not just for copy defined ones.
- Update some outdated code related inactive live ranges.
- Kill info not yet set. That's next patch.

llvm-svn: 40913
2007-08-07 23:49:57 +00:00
Devang Patel c7e53bdcfd Fix new compare instruction's signness. Caught by Chris during review.
llvm-svn: 40912
2007-08-07 23:17:52 +00:00
Owen Anderson 0cc1a76283 Don't insert nearly as many redundant phi nodes.
llvm-svn: 40909
2007-08-07 23:12:31 +00:00
Dale Johannesen 4e7ff3593c Fix spelling of mtvscr and mfvscr.
llvm-svn: 40908
2007-08-07 23:08:00 +00:00
Dale Johannesen a47f7d7cfd Long double patch 8 of N: make it partially work in
SSE mode (all but conversions <-> other FP types, I think):
>>Do not mark all-80-bit operations as "Requires[FPStack]"
(which really means "not SSE").
>>Refactor load-and-extend to facilitate this.
>>Update comments.
>>Handle long double in SSE when computing FP_REG_KILL.

llvm-svn: 40906
2007-08-07 20:29:26 +00:00
Devang Patel 19211b6528 Use eraseFromParent().
llvm-svn: 40903
2007-08-07 17:45:35 +00:00
David Greene bacdbaa0da Fix comment typo
llvm-svn: 40898
2007-08-07 16:52:03 +00:00
David Greene 816a190cdf Fix GLIBCXX_DEBUG error triggered by incrementing erased iterator.
llvm-svn: 40897
2007-08-07 16:44:38 +00:00
David Greene 99905f16f8 Add a missing forward declaration.
llvm-svn: 40896
2007-08-07 16:34:05 +00:00
Evan Cheng f7c6effc44 Initial JIT support for ARM by Raul Fernandes Herbster.
llvm-svn: 40887
2007-08-07 01:37:15 +00:00
Dale Johannesen 57c6ac5fe5 Long double patch 7 of N, unless I lost count:).
Last x87 bits for full functionality (not
thoroughly tested, and long doubles do not work
in SSE modes at all - use -mcpu=i486 for now)

llvm-svn: 40886
2007-08-07 01:17:37 +00:00