Commit Graph

19671 Commits

Author SHA1 Message Date
Devang Patel 004937bbd9 Add facility to dump pass manager structure
to make it easier to understand failure.

llvm-svn: 40567
2007-07-27 20:06:09 +00:00
Duncan Sands ce38853cc6 Trampoline codegen support for X86-32.
llvm-svn: 40566
2007-07-27 20:02:49 +00:00
Devang Patel 381a2a26e9 Fix edge cases in handling basic block split.
llvm-svn: 40564
2007-07-27 19:13:43 +00:00
Devang Patel e3206cb425 Use SmallPtrSet.
llvm-svn: 40560
2007-07-27 18:34:27 +00:00
Chuck Rose III 1a39a2d13d VStudio compiler errors and placing Function*->ExFunc map under ManagedStatic control.
This commit fixes two things.  One is a pair of VStudio compiler errors stemming from variables
which defined within the for loop statement and also within the body of the for loop.  I fixed these 
by renaming one of the two variables.  Additionally, I've made the Function*->ExFunc map in 
ExternalFunctions.cpp a ManagedStatic object, so that cleanup will be done on llvm_shutdown.  In repeated
uses of the interpreter, where the same Function* address may get used for completely differnet functions,
this was causing a crash.

llvm-svn: 40558
2007-07-27 18:26:35 +00:00
Owen Anderson 49f037ac29 Allow SmallPtrSet to hold pointers to const data.
llvm-svn: 40556
2007-07-27 18:07:02 +00:00
Dan Gohman 4788552deb Re-apply 40504, but with a fix for the segfault it caused in oggenc:
Make the alignedload and alignedstore patterns always require 16-byte
alignment. This way when they are used in the "Fs" instructions, in which
a vector instruction is used for a scalar purpose, they can still require
the full vector alignment. And add a regression test for this.

llvm-svn: 40555
2007-07-27 17:16:43 +00:00
Duncan Sands 5d49bcdce0 It seems logical that InReg should be incompatible
with StructReturn and ByVal, so make it so.

llvm-svn: 40554
2007-07-27 16:45:18 +00:00
Duncan Sands 07c9066238 As the number of parameter attributes increases,
Verifier::visitFunction is suffering a combinatorial
explosion due to the number of mutually incompatible
attributes.  This patch tidies the whole thing up
using attribute masks.  While there I fixed some
small bugs: (1) the ByVal attribute tests cast a
type to a pointer type, which can fail.  Yes, the
fact it is of a pointer type is checked before,
but a failing check does not cause the program
to exit, it continues on outputting further errors;
(2) Nothing was checking that an sret attribute is
on the first parameter; (3) nothing was checking that
a function for which isStructReturn() is true has a
parameter with the sret attribute and vice-versa (I
don't think it is possible for this to go wrong, but
it seems right to check it).

llvm-svn: 40553
2007-07-27 15:09:54 +00:00
Duncan Sands 644f917358 Support for trampolines, except for X86 codegen which is
still under discussion.

llvm-svn: 40549
2007-07-27 12:58:54 +00:00
Christopher Lamb 14bbb15f07 Move subreg lowering pass to be right after regalloc, per feedback.
llvm-svn: 40548
2007-07-27 07:36:14 +00:00
Evan Cheng 931de40afa Reverting 40504 for now. It's breaking oggenc.
llvm-svn: 40547
2007-07-27 01:37:47 +00:00
Devang Patel a51e0a3d8d Fix thinko. Update return status appropriately.
llvm-svn: 40546
2007-07-26 20:21:42 +00:00
Owen Anderson 0f692f27a3 Fix a bug introduced in my last commit.
llvm-svn: 40542
2007-07-26 18:57:04 +00:00
Owen Anderson dbf23ccaa0 Fix a couple more bugs in the phi construction by pulling in code that does
almost the same things from LCSSA.

llvm-svn: 40540
2007-07-26 18:26:51 +00:00
Evan Cheng d204d08b97 Make sure epilogue esp adjustment is placed before any terminator and pop instructions.
llvm-svn: 40538
2007-07-26 17:45:41 +00:00
Evan Cheng 936d17aa1b Don't pollute the meaning of isUnpredicatedTerminator.
llvm-svn: 40537
2007-07-26 17:32:14 +00:00
Evan Cheng ca6e041903 Minor bug.
llvm-svn: 40535
2007-07-26 17:02:45 +00:00
Dan Gohman 30f060be80 Fix the alias analysis query in DAGCombiner to not add in two
offsets. The SrcValueOffset values are the real offsets from the
SrcValue base pointers.

llvm-svn: 40534
2007-07-26 16:14:06 +00:00
Dan Gohman 6e853bc73f Move the GET_SIDE_EFFECT_INFO logic from isInstructionTriviallyDead
to Instruction::mayWriteToMemory, fixing a FIXME, and helping
various places that call mayWriteToMemory directly.

llvm-svn: 40533
2007-07-26 16:06:08 +00:00
Dan Gohman eb47d9213c Remove a bogus return statement, what appears to have been a pasto
from Relation::contradicts in Relation::incorporate.

llvm-svn: 40531
2007-07-26 15:29:35 +00:00
Dan Gohman f2af2bb6aa DummyInst's member functions don't need to be virtual.
llvm-svn: 40530
2007-07-26 15:25:08 +00:00
Dan Gohman c9edd977ea In the .loc directive, print the fields as "debug" fields, so they
don't get decorated as if for immediate fields for instructions.

llvm-svn: 40529
2007-07-26 15:24:15 +00:00
Dan Gohman cecd4b3793 Fix a whitespace difference between CMPSSrr and CMPSDrr.
llvm-svn: 40528
2007-07-26 15:11:50 +00:00
Christopher Lamb e9d738cefc Add a MachineFunction pass, which runs post register allocation, that turns subreg insert/extract instruction into register copies. This ensures correct code gen if the coalescer isn't able to remove all subreg instructions.
llvm-svn: 40521
2007-07-26 08:18:32 +00:00
Christopher Lamb 18603b03e1 Teach DAG scheduling how to properly emit subreg insert/extract machine instructions. PR1350
llvm-svn: 40520
2007-07-26 08:12:07 +00:00
Christopher Lamb cde0ee5221 Add target independent MachineInstr's to represent subreg insert/extract in MBB's. PR1350
llvm-svn: 40518
2007-07-26 07:48:21 +00:00
Evan Cheng ce5185b181 Same goes for constantpool, etc.
llvm-svn: 40517
2007-07-26 07:35:15 +00:00
Christopher Lamb a8fc0e527b Add selection DAG nodes for subreg insert/extract. PR1350
llvm-svn: 40516
2007-07-26 07:34:40 +00:00
Christopher Lamb 0dbc152d2e Remove subreg index from MachineInstr's and also keep vregs as unsigned when adding operands.
llvm-svn: 40514
2007-07-26 07:00:46 +00:00
Christopher Lamb 3fead96121 Fix infinite recursion for when extract_vector_elt is legal. Unfortunately no public targets use this code-path, so no test.
llvm-svn: 40510
2007-07-26 03:33:13 +00:00
Christopher Lamb cd97a21064 Add support for 3 element 32-bit vector ValueTypes.
llvm-svn: 40506
2007-07-26 01:46:52 +00:00
Dan Gohman 8455bd3fae Remove X86ISD::LOAD_PACK and X86ISD::LOAD_UA and associated code from the
x86 target, replacing them with the new alignment attributes on memory
references.

llvm-svn: 40504
2007-07-26 00:31:09 +00:00
Owen Anderson 3b8cc30a61 Fix what is _hopefully_ the last corner case for loops.
llvm-svn: 40503
2007-07-25 23:54:42 +00:00
Evan Cheng 630c1f75b8 Mac OS X x86-64 lower 4G address is not available.
llvm-svn: 40502
2007-07-25 23:41:36 +00:00
Evan Cheng 952aa6988b Mac OS X should use 0x90 to fill in gaps to satisfy function alignment requirements.
llvm-svn: 40501
2007-07-25 23:36:05 +00:00
Evan Cheng 86eb3fd97d EmitAlignment() also emits optional fill value.
llvm-svn: 40500
2007-07-25 23:35:07 +00:00
Evan Cheng 5c6a31e9a0 Functions with LinkOnce and weak linkage still need to be aligned. Doh.
llvm-svn: 40499
2007-07-25 22:28:16 +00:00
Owen Anderson 8707412593 My last commit was not correct for nested loops. Fix it, and add a testcase for it.
llvm-svn: 40498
2007-07-25 22:19:40 +00:00
Owen Anderson 3c67004d47 Fix an infinite loop on 300.twolf.
llvm-svn: 40497
2007-07-25 22:03:06 +00:00
Owen Anderson 9b796348bd Fix a bug in non-local memdep that was causing an infinite loop on 175.vpr.
llvm-svn: 40495
2007-07-25 21:26:36 +00:00
Owen Anderson 7bf26ee444 Fix a bug that was causing GVN to crash on 252.eon.
llvm-svn: 40494
2007-07-25 21:13:41 +00:00
Owen Anderson 5e5599b7ce Add basic support for performing whole-function RLE.
Note: This has not yet been thoroughly tested.  Use at your own risk.

llvm-svn: 40489
2007-07-25 19:57:03 +00:00
Dan Gohman cf0a5349de Don't ignore the return value of AsmPrinter::doInitialization and
AsmPrinter::doFinalization.

llvm-svn: 40487
2007-07-25 19:33:14 +00:00
Devang Patel 33227115b9 Add BasicInliner interface.
This interface allows clients to inline bunch of functions with module
level call graph information.:wq

llvm-svn: 40486
2007-07-25 18:00:25 +00:00
Nick Lewycky 5805c46e8f Fix debug info and globals filled with zeros.
llvm-svn: 40483
2007-07-25 03:48:45 +00:00
Anton Korobeynikov 64b64ae591 Minor cleanup:
- Split EH and debug infiormation
 - Make DwarfWriter more verbose in some cases

llvm-svn: 40481
2007-07-25 00:06:28 +00:00
Dan Gohman f0bb12848f Add const to CanBeFoldedBy, CheckAndMask, and CheckOrMask.
llvm-svn: 40480
2007-07-24 23:00:27 +00:00
Dan Gohman f906c7286f Use movaps to load a v4f32 build_vector of all-constant values into a
register instead of loading each element individually.

llvm-svn: 40478
2007-07-24 22:55:08 +00:00
Owen Anderson d998be79cc Add initial support for non-local memory dependence analysis.
NOTE: This has only been cursorily tested.  Expected improvements soon.

llvm-svn: 40476
2007-07-24 21:52:37 +00:00
Owen Anderson 4c54024319 Make the copy constructor of SmallPtrSet much faster.
llvm-svn: 40474
2007-07-24 21:31:23 +00:00
Anton Korobeynikov 0c46451d2b Heal EH handling stuff by emitting correct offsets to callee-saved registers.
Pretty hackish, but code itself is dirty mess, so we won't make anything worse. :)

llvm-svn: 40472
2007-07-24 21:07:39 +00:00
Owen Anderson ab6ec2eac2 Add a GVN pass, using the value numbering code I developed for GVNPRE and the
load elimination code from RedundantLoadElimination.

llvm-svn: 40469
2007-07-24 17:55:58 +00:00
Reid Spencer a2e618712d Make output match actual condition tested. Thanks, Duncan.
llvm-svn: 40464
2007-07-24 14:35:44 +00:00
Devang Patel 13b25df0e9 Unreachable block is not a root node in post dominator tree.
llvm-svn: 40458
2007-07-24 01:02:25 +00:00
Owen Anderson 9baaaa52e6 Rename a lot of things to change FastDLE to RedundantLoadElimination.
llvm-svn: 40457
2007-07-24 00:17:04 +00:00
Owen Anderson 7292a4a93f Rename FastDLE as RedundantLoadElimination.
llvm-svn: 40456
2007-07-24 00:08:38 +00:00
Reid Spencer 0f8fd66a62 1. Make sure we print the Function Value for parameter attribute errors
2. Fold an if statement into the Assert1 macro call.

llvm-svn: 40455
2007-07-23 23:46:43 +00:00
Reid Spencer 6c2b393f0c Add better verification of attributes on function types. It is not permitted
to use sret or inreg on the function. It is equally illegal to use noreturn
or nounwind on a parameter; they only go with the function. This patch
enforces these rules.

llvm-svn: 40453
2007-07-23 23:09:55 +00:00
Owen Anderson 5e68f0c93d Don't delete volatile loads. Doing so is not safe.
llvm-svn: 40448
2007-07-23 22:05:54 +00:00
Owen Anderson 6aba721425 Add FastDLE, the load-elimination counterpart of FastDSE.
llvm-svn: 40445
2007-07-23 21:48:08 +00:00
Dan Gohman b6a8ae20c7 Fix some uses of dyn_cast to be uses of cast.
llvm-svn: 40443
2007-07-23 20:24:29 +00:00
Dan Gohman 17f68f95d8 Delete the svn:executable property on these files, which aren't executable.
llvm-svn: 40441
2007-07-23 19:26:08 +00:00
Owen Anderson 5a201baba9 Fix file header.
llvm-svn: 40440
2007-07-23 18:30:37 +00:00
Chris Lattner 4512cd2cab completely remove a transformation that is unsafe in the face of
undefs.

llvm-svn: 40439
2007-07-23 17:10:17 +00:00
Bill Wendling 3d88e9940a Add missing SSE builtins:
__builtin_ia32_cvtss2si64
    __builtin_ia32_cvttss2si64
    __builtin_ia32_cvtsi642ss
    __builtin_ia32_cvtsd2si64
    __builtin_ia32_cvttsd2si64
    __builtin_ia32_cvtsi642sd

llvm-svn: 40411
2007-07-23 03:07:27 +00:00
Reid Spencer 71ce927d7b Report an error if one occurs in releaseModule.
llvm-svn: 40405
2007-07-22 21:39:37 +00:00
Devang Patel 5e39293e62 Apply temporary work around to fix llvm mis-compilation
reported in PR 1556.

llvm-svn: 40133
2007-07-21 00:34:29 +00:00
Evan Cheng ac1591be42 No more noResults.
llvm-svn: 40132
2007-07-21 00:34:19 +00:00
Dan Gohman 147d9fa57d Don't assume that only Uses can be kills. Defs are marked as kills initially
when there are no uses. This fixes a dangling-pointer bug, where pointers to
deleted instructions were not removed from kills lists. More info here:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-July/009749.html

llvm-svn: 40131
2007-07-20 23:17:34 +00:00
Chris Lattner 363485da82 zext(undef) = 0 and sext(undef) = 0, not undef.
This hopefully fixes a miscompilation of TargetData.cpp when self hosting.

llvm-svn: 40125
2007-07-20 22:09:02 +00:00
Chris Lattner d82e4a19cc this xform is already done by the constant folder.
llvm-svn: 40124
2007-07-20 22:06:41 +00:00
Evan Cheng 9d5df0a5f6 Added -print-emitted-asm to print out JIT generated asm to cerr.
llvm-svn: 40123
2007-07-20 21:56:13 +00:00
Devang Patel 8adae86688 Use SmallVector instead of std::vector.
llvm-svn: 40109
2007-07-20 18:04:54 +00:00
Dan Gohman e31a61eeca Optimize alignment of loads and stores.
llvm-svn: 40102
2007-07-20 16:34:21 +00:00
Duncan Sands 2be91fcdd8 Place SCCPSolver also in the anonymous namespace. This
pacifies g++-4.2.

llvm-svn: 40089
2007-07-20 08:56:21 +00:00
Owen Anderson 5bd6c3f2c4 Fix a bug where we were marking GEP expressions with the wrong opcode.
llvm-svn: 40085
2007-07-20 08:19:20 +00:00
Owen Anderson edb926bfe3 When removing instructions from the analysis, be sure to check the confirmed
flag when determining what to do with dependencies.

llvm-svn: 40079
2007-07-20 06:16:07 +00:00
Evan Cheng 8fefeffb37 Because we promote SSE logical ops and loads to v2i64, we often end up generate
code that cross integer / floating point domains (e.g. generate pxor / pand for
logical ops on floating point value, movdqa to load / store floating point SSE
values). Given that, it's better to use movaps instead of movdqa and movups
instead of movdqu. They have the same latency but the "aps" variants are one
byte shorter.
If the domain crossing problem is a real performance issue, then we will have to
fix it with dynamic programming based isel.

llvm-svn: 40076
2007-07-20 00:27:43 +00:00
Evan Cheng 9081ab8127 Oops. These stores actually produce results.
llvm-svn: 40074
2007-07-20 00:20:46 +00:00
Evan Cheng 64738536b3 Fix custom lowering of SSE FXOR.
llvm-svn: 40071
2007-07-19 23:36:01 +00:00
Evan Cheng 7ca3555bfa Fix patterns so we isel the xorps, etc. for floating pt logical SSE ops. DAG combiner may fold away the (bit_convert (load)).
llvm-svn: 40070
2007-07-19 23:34:10 +00:00
Reid Spencer 314e1cb7ee For PR1553:
Change the keywords for the zext and sext parameter attributes to be 
zeroext and signext so they don't conflict with the keywords for the
instructions of the same name. This gets around the ambiguity.

llvm-svn: 40069
2007-07-19 23:13:04 +00:00
Reid Spencer 68ee4e8efc Hush a noisy warning from GCC 4.2 about overflow during conversion by using
the type "unsigned" instead of uintptr_t for a 1-bit structure field.

llvm-svn: 40066
2007-07-19 21:05:30 +00:00
Owen Anderson f9e6542969 Make val_replace fail early, which reduces the time to optimize 403.gcc to 14.8s.
llvm-svn: 40064
2007-07-19 19:57:13 +00:00
Devang Patel a273d1cd3a Verify loop info.
llvm-svn: 40062
2007-07-19 18:02:32 +00:00
Duncan Sands 60f28bff4c Replace mysterious code causing a g++-4.2 warning
with hopefully correct code that pleases g++-4.2.

llvm-svn: 40051
2007-07-19 09:42:01 +00:00
Duncan Sands 85ec2af554 As pointed out by g++-4.2, the original code didn't do
what it thought it was doing.

llvm-svn: 40044
2007-07-19 07:31:58 +00:00
Owen Anderson ee99010782 Remember to free the heap allocated array if we're not going to use it.
llvm-svn: 40043
2007-07-19 06:45:33 +00:00
Owen Anderson 6aa17f1def Use SmallVector and DenseMap in even more places.
With this, the time to optimize 403.gcc is down to 15.1s.

llvm-svn: 40042
2007-07-19 06:37:56 +00:00
Owen Anderson 75a244d6eb Change ValueTable to use a DenseMap for mapping expressions to value numbers.
This results in a slight speedup for 403.gcc.

llvm-svn: 40040
2007-07-19 06:13:15 +00:00
Devang Patel ef43253e2e Set up ground work to verify preserved analysis info.
llvm-svn: 40039
2007-07-19 05:36:09 +00:00
Owen Anderson 6a4ff8549b Move some sets and maps to SmallPtrSet and DenseMap respectively. This
reduces the time to optimize 403.gcc from 17.6s to 16.4s.

llvm-svn: 40036
2007-07-19 03:32:44 +00:00
Devang Patel 186e0d8b0a After a basic block is split into two parts,
second part dominates all the blocks dominated
by original basic block. And first part dominates
second part.

llvm-svn: 40035
2007-07-19 02:29:24 +00:00
Devang Patel de5901523c Now this temp. fix is not required.
llvm-svn: 40034
2007-07-19 02:22:21 +00:00
Evan Cheng 94b5a80b93 Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr  : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
                 "add{l} {$src2, $dst|$dst, $src2}",
                 [(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr  : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
                 "add{l} {$src2, $dst|$dst, $src2}",
                 [(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;

llvm-svn: 40033
2007-07-19 01:14:50 +00:00
Evan Cheng 22b0c344db Only adjust esp around calls in presence of alloca.
llvm-svn: 40030
2007-07-19 00:42:58 +00:00
Evan Cheng 7b5b06805a Only adjust esp around calls in presence of alloca.
llvm-svn: 40028
2007-07-19 00:42:05 +00:00
Devang Patel 8a1d1ac925 Fix typo.
llvm-svn: 40025
2007-07-18 23:50:19 +00:00
Devang Patel bb8ea8cefc Fix dominator info update to accommodate CFG changes.
This fixes PR1559.

llvm-svn: 40024
2007-07-18 23:48:20 +00:00
Evan Cheng a8d152a22a Add comment.
llvm-svn: 40022
2007-07-18 23:34:48 +00:00
Evan Cheng 8941071ae1 Use MOV instead of LEA to restore ESP if callee-saved frame size is 0; if previous instruction updates esp, fold it in.
llvm-svn: 40018
2007-07-18 21:26:06 +00:00
Dan Gohman 68659280fa Add constructor overloads for LoadInst and StoreInst that insert at the
end of a BasicBlock and have an alignment parameter.

llvm-svn: 40016
2007-07-18 20:51:11 +00:00
Dan Gohman 776962a97a Implement initial memory alignment awareness for SSE instructions. Vector loads
and stores that have a specified alignment of less than 16 bytes now use
instructions that support misaligned memory references.

llvm-svn: 40015
2007-07-18 20:23:34 +00:00
Owen Anderson e21f270858 Fix an issue where assignments that caused a SmallPtrSet to become non-small
would result in calling realloc() on a null pointer.  Instead, if we encounter
this situation, make a normal call to malloc().

llvm-svn: 40014
2007-07-18 19:54:15 +00:00
Dan Gohman a7b65c30a3 It's not necessary to do rounding for alloca operations when the requested
alignment is equal to the stack alignment.

llvm-svn: 40004
2007-07-18 16:29:46 +00:00
Evan Cheng f314055706 New entry.
llvm-svn: 39998
2007-07-18 08:21:49 +00:00
Evan Cheng 97b5dc63d7 Fold prologue esp update when possible.
llvm-svn: 39984
2007-07-17 21:26:42 +00:00
Evan Cheng f9ef70560e Dead code.
llvm-svn: 39979
2007-07-17 20:01:19 +00:00
Evan Cheng b2bb4b4040 Make sure not to break eh_return.
llvm-svn: 39978
2007-07-17 18:40:47 +00:00
Evan Cheng 27ba94bf3b Update.
llvm-svn: 39977
2007-07-17 18:39:45 +00:00
Evan Cheng 67e2e22e97 Missed the case where alloca is used but the stack size (not including callee-saved portion) is zero. Thanks Dan.
llvm-svn: 39974
2007-07-17 18:03:34 +00:00
Rafael Espindola 6389ef9854 detect invalid combination of sret and byval
llvm-svn: 39971
2007-07-17 13:34:23 +00:00
Evan Cheng 9ae2eb43d8 Use push / pop for prologues and epilogues.
llvm-svn: 39967
2007-07-17 07:59:08 +00:00
Chris Lattner 396156e00b no email addrs in file headers
llvm-svn: 39962
2007-07-17 05:56:43 +00:00
Reid Spencer 5060fd0fa3 Unbreak the build by putting calls to free into the implementation file and
having that implementation file #include <cstdlib>.

llvm-svn: 39952
2007-07-17 02:16:12 +00:00
Owen Anderson 09f86993bd Take advantage of undefined behavior if the source program tries to GEP
beyond the end of an alloca to make FastDSE faster and more aggressive.

llvm-svn: 39945
2007-07-16 23:34:39 +00:00
Owen Anderson 7fcaaadf1c Add support for walking up memory def chains, which enables finding many more
dead stores on 400.perlbench.

llvm-svn: 39929
2007-07-16 21:52:50 +00:00
Owen Anderson 81990a3fc3 Use realloc() to (potentially) resize the contents of SmallPtrSet in place.
llvm-svn: 39926
2007-07-16 21:27:44 +00:00
Reid Spencer 3363f4ad96 Return Undef if the block has no dominator. This was required to allow
llvm-gcc build to succeed. Without this change it fails in libstdc++
compilation. This causes no regressions in dejagnu tests. However, 
someone who knows this code better might want to review it.

llvm-svn: 39924
2007-07-16 21:03:44 +00:00
Dan Gohman 72efc04d8e Use ConstantFoldFP for folding all unary floating-point operations which may
have an error, and refector out the code for binary operators into
ConstantFoldBinaryFP and use it for all binary floating-point operations
which may have an error. These functions still rely exclusively on errno
to detect errors though.

llvm-svn: 39923
2007-07-16 15:26:22 +00:00
Dan Gohman 06c60b6032 Fix comments about vectors to use the current wording.
llvm-svn: 39921
2007-07-16 14:29:03 +00:00
Chris Lattner 640fd5124d Repair a regression in Transforms/InstCombine/mul.ll that Reid noticed.
llvm-svn: 39896
2007-07-16 04:15:34 +00:00
Nick Lewycky b7c0c8a350 Start adding and cleaning up comments.
llvm-svn: 39894
2007-07-16 02:58:37 +00:00
Nick Lewycky 5246026c8c Handle decrementing loops properly. Fixes PR1533.
Always pass the constant as the second parameter to HowManyLessThans.

Remove obsolete "isSigned" parameter.

llvm-svn: 39893
2007-07-16 02:08:00 +00:00
Chris Lattner d4fef8dbca Implement shift-simplify.ll:test[45].
First teach instcombine that sign bit checks only demand the 
sign bit, this allows simplify demanded bits to hack on 
expressions better.

Second, teach instcombine that ashr is useless if only the
sign bit is demanded.

llvm-svn: 39880
2007-07-15 20:54:51 +00:00
Chris Lattner 06205d5567 Implement shift-simplify.ll:test3, turning:
(X << 31) <s 0  --> (X&1) != 0

This happens dozens of times in the CFE.

llvm-svn: 39879
2007-07-15 20:42:37 +00:00
Nick Lewycky ddc2f9ba57 Clarify the language. Pointed out by Duncan Sands.
llvm-svn: 39857
2007-07-14 17:41:03 +00:00
Nick Lewycky d20f485866 Fix the build. Patch from Holger Schurig.
llvm-svn: 39856
2007-07-14 15:11:14 +00:00
Anton Korobeynikov 383a324735 Long live the exception handling!
This patch fills the last necessary bits to enable exceptions
handling in LLVM. Currently only on x86-32/linux.

In fact, this patch adds necessary intrinsics (and their lowering) which
represent really weird target-specific gcc builtins used inside unwinder.

After corresponding llvm-gcc patch will land (easy) exceptions should be
more or less workable. However, exceptions handling support should not be 
thought as 'finished': I expect many small and not so small glitches
everywhere.

llvm-svn: 39855
2007-07-14 14:06:15 +00:00
Nick Lewycky 39519f5c41 Use maximal intersection algorithm exclusively. Fixes miscompile bug.
llvm-svn: 39852
2007-07-14 04:28:04 +00:00
Nick Lewycky 61b4a265ee Add alternate ConstantRange intersection algorithm.
llvm-svn: 39851
2007-07-14 02:51:34 +00:00
Devang Patel 4cd1413f15 Make LCSSA a loop pass.
llvm-svn: 39844
2007-07-13 23:57:11 +00:00
Evan Cheng 1fae1cd3e1 Fix for PR1540: Specify F0, F1 are sub-registers of D0, etc.
llvm-svn: 39843
2007-07-13 23:55:50 +00:00
Owen Anderson d975efab16 Handle GEPs with all-zero indices in the same way we handle pointer-pointer bitcasts. Also, fix a potentia infinite loop.
This brings FastDSE to parity with old DSE on 175.vpr.

llvm-svn: 39839
2007-07-13 22:50:48 +00:00
Devang Patel 29ccf8ba52 Disable claims to preserve analysis until open issues are resolved.
llvm-svn: 39834
2007-07-13 21:53:42 +00:00
Dan Gohman ff72788863 Fix the comment for LegalizeOp to more accurately reflect what it does.
llvm-svn: 39827
2007-07-13 20:14:11 +00:00
Dan Gohman 80f9f077e3 Don't call SimplifyVBinOp for non-vector operations, following earlier review
feedback. This theoretically makes the common (scalar) case more efficient.

llvm-svn: 39823
2007-07-13 20:03:40 +00:00
Owen Anderson 9c9ef21432 Be more aggressive in removing dead stores, and in removing instructions trivially dead after DSE.
This drastically improves the effect of FastDSE on kimwitu++.

llvm-svn: 39819
2007-07-13 18:26:26 +00:00
Dale Johannesen 4dc35dbd3e Modify previous patch per review comments.
llvm-svn: 39817
2007-07-13 17:31:29 +00:00
Dale Johannesen 2182f06f2d Skeleton of post-RA scheduler; doesn't do anything yet.
Change name of -sched option and DEBUG_TYPE to
pre-RA-sched; adjust testcases.

llvm-svn: 39816
2007-07-13 17:13:54 +00:00
Chris Lattner 2b4d9b684f Fix CodeGen/Generic/print-arith-fp.ll on sparc (PR1551)
llvm-svn: 39813
2007-07-13 16:24:10 +00:00
Owen Anderson 32c4a05dd4 Reimplement removing stores to allocas at the end of a function. This should be safe now.
llvm-svn: 39790
2007-07-12 21:41:30 +00:00
Owen Anderson d4451dee1e Make the condition-checking for free with non-trivial dependencies more correct.
llvm-svn: 39789
2007-07-12 18:08:51 +00:00
Owen Anderson 5e06995b3d Remove the end-block handling code. It was unsafe, and making it safe would have resulted in falling back to the slow DSE case. I need to think some more about the right way to handle this.
llvm-svn: 39788
2007-07-12 17:52:20 +00:00
Dale Johannesen 85ee72f7ba ARM: make branch folder remove unconditional branches
following jump tables that it earlier inserted.  This
would be OK on other targets but is needed for correctness
only on ARM (constant islands needs to find jump tables).

llvm-svn: 39782
2007-07-12 16:45:35 +00:00
Duncan Sands 0263dd1d7f The type ids making up a filter are unsigned, and
should be output as unsigned values.  Checked against
gcc.

llvm-svn: 39775
2007-07-12 13:51:39 +00:00
Gabor Greif b8bca52c7d checked in as obvious,
thanks Benoit Boissinot!

llvm-svn: 39774
2007-07-12 13:31:38 +00:00
Chris Lattner bdc69595d9 another missed SSE optimization
llvm-svn: 39772
2007-07-12 06:31:38 +00:00
Owen Anderson 1e1bace52b Let MemoryDependenceAnalysis take care of updating AliasAnalysis.
llvm-svn: 39769
2007-07-12 00:06:21 +00:00
Devang Patel fac4d1f014 Preserve analysis info.
llvm-svn: 39767
2007-07-11 23:47:28 +00:00
Bruno Cardoso Lopes bcda5e20c9 Added support for Mips specific GAS directives
Fixed print immediate 
Fixed Identation on MipsISelDAGToDAG.cpp

llvm-svn: 39764
2007-07-11 23:24:41 +00:00
Bruno Cardoso Lopes 6c8c748e4d Added support for framepointer
Prologue/Epilogue support fp,ra save/restore and use the stack frame the right
way!

llvm-svn: 39763
2007-07-11 23:21:31 +00:00
Owen Anderson aa07172340 Handle the case where an entire structure is freed, and its dependency is a store to a field within
that structure.

Also, refactor the runOnBasicBlock() function, splitting some of the special cases into separate functions.

llvm-svn: 39762
2007-07-11 23:19:17 +00:00
Bruno Cardoso Lopes 77dbdcabf2 Now that stack is represented the right way, LOA starts at 0
llvm-svn: 39761
2007-07-11 23:17:41 +00:00
Bruno Cardoso Lopes 4449e5dd7f Fixed AddLiveOut issues
FI's created the write way to represent Mips stack

llvm-svn: 39760
2007-07-11 23:16:16 +00:00
Bruno Cardoso Lopes c5affeccbd Removed unused immediate PatLeaf, fixed lui instruction
llvm-svn: 39759
2007-07-11 22:47:02 +00:00
Bruno Cardoso Lopes 753e37027f Added MipsMachineFunction class, to hold Mips dinamic stack info when inserting Prologue/Epilog
llvm-svn: 39758
2007-07-11 22:44:21 +00:00
Owen Anderson 1441470be8 Add support for eliminate stores to stack-allocated memory locations at the end
of a function.

llvm-svn: 39754
2007-07-11 21:06:56 +00:00
Owen Anderson e720144837 Handle eliminating stores that occur right before a free.
llvm-svn: 39753
2007-07-11 20:38:34 +00:00
Lauro Ramos Venancio 3d70855dd2 Handle packed structs in the CBackend.
llvm-svn: 39752
2007-07-11 19:56:53 +00:00
Evan Cheng 6b6d1f685f Missed a couple of places where new instructions are added due to spill / restore.
llvm-svn: 39748
2007-07-11 19:17:18 +00:00
Owen Anderson bf971aafb6 Clean up a few things based on Chris' feedback.
llvm-svn: 39747
2007-07-11 19:03:09 +00:00
Tanya Lattner ccecbcd779 Adding ability to demote phi to stack.
llvm-svn: 39744
2007-07-11 18:41:34 +00:00
Dale Johannesen e59411d056 Fix hang compiling TimberWolf (allow for islands
of size other than 4).

llvm-svn: 39743
2007-07-11 18:32:38 +00:00
Lauro Ramos Venancio 09d73c0305 Assert when TLS is not implemented.
llvm-svn: 39737
2007-07-11 17:19:51 +00:00
Duncan Sands 03b274911f Exception handling has been implemented.
llvm-svn: 39732
2007-07-11 16:59:20 +00:00
Chris Lattner 6e544a9cca Fix an oversight: for modules with no other identifying target info,
the sparc backend should be preferred when running on sparcs.

llvm-svn: 39142
2007-07-11 16:32:10 +00:00
Duncan Sands d5ea194b6c If assertions are not enabled, we should return False here.
llvm-svn: 38535
2007-07-11 08:47:55 +00:00
Evan Cheng 74a541024f No longer need to track last def / use.
llvm-svn: 38534
2007-07-11 08:47:44 +00:00
Evan Cheng bec7a20c5e Fix for PR1545: Revamp code that update kill information due to register reuse.
llvm-svn: 38525
2007-07-11 05:28:39 +00:00
Owen Anderson 5e72db3f7f Add FastDSE, a new algorithm for doing dead store elimination. This algorithm is not as accurate
as the current DSE, but it only a linear scan over each block, rather than quadratic.  Eventually
(once it has been improved somewhat), this will replace the current DSE.

NOTE: This has not yet been extensively tested.
llvm-svn: 38517
2007-07-11 00:46:18 +00:00
David Greene d9034f717a Make this work with GLIBCXX_DEBUG.
llvm-svn: 38516
2007-07-10 22:00:30 +00:00
Evan Cheng 94579dbd2e Didn't mean the last commit. Revert.
llvm-svn: 38515
2007-07-10 22:00:16 +00:00
Dale Johannesen 68471d263f Fix fp_constant_op failure.
llvm-svn: 38514
2007-07-10 21:53:30 +00:00
Evan Cheng effa7467b6 Update.
llvm-svn: 38513
2007-07-10 21:49:47 +00:00
Dale Johannesen 23f631d87c fix 80 columnn violations, increasing the world's
pedantic satisfaction level.

llvm-svn: 38512
2007-07-10 20:53:41 +00:00
Owen Anderson c432490b4c Calculate the size of a array allocation correctly.
llvm-svn: 38511
2007-07-10 20:48:38 +00:00
Owen Anderson faf9e42479 Fix a crasher when finding the dependency of a call.
llvm-svn: 38510
2007-07-10 20:39:07 +00:00
Owen Anderson 1279eaf776 Make this pass registration static as well.
llvm-svn: 38509
2007-07-10 20:21:08 +00:00
Owen Anderson 084d3c2e2f Make the pass registration static.
llvm-svn: 38508
2007-07-10 20:20:19 +00:00
Chris Lattner f51bd666d9 add a note
llvm-svn: 38507
2007-07-10 20:03:50 +00:00
Rafael Espindola 9521a564fb check for correct usage of the byval attribute
llvm-svn: 38506
2007-07-10 19:28:12 +00:00
Anton Korobeynikov 76547349c1 During module cloning copy aliases too. This fixes PR1544
llvm-svn: 38505
2007-07-10 19:07:35 +00:00
Owen Anderson 1fa6132e85 Handle vaarg instructions correctly.
llvm-svn: 38504
2007-07-10 18:43:15 +00:00
Dan Gohman 60d6f96da3 Change the peep for EXTRACT_VECTOR_ELT of BUILD_PAIR to look for
the new CONCAT_VECTORS node type instead, as that's what legalize
uses now. And add a peep for EXTRACT_VECTOR_ELT of INSERT_VECTOR_ELT.

llvm-svn: 38503
2007-07-10 18:20:44 +00:00
Owen Anderson 94a21dd1e0 Volatile loads and stores depend on each other.
llvm-svn: 38502
2007-07-10 18:11:42 +00:00
Evan Cheng 9d41b311fb Remove clobbersPred. Add an OptionalDefOperand to instructions which have the 's' bit.
llvm-svn: 38501
2007-07-10 18:08:01 +00:00
Evan Cheng 0867337075 Remove clobbersPred.
llvm-svn: 38500
2007-07-10 18:07:08 +00:00
Owen Anderson 9c88457abe Add support for finding the dependencies of call and invoke instructions.
llvm-svn: 38497
2007-07-10 17:59:22 +00:00
Evan Cheng 5e9084207f If the operand is marked M_OPTIONAL_DEF_OPERAND, then it's a def.
llvm-svn: 38496
2007-07-10 17:52:20 +00:00
Evan Cheng fbc73099dc Somehow this wasn't committed last time. M_CLOBBERS_PRED is gone.
llvm-svn: 38495
2007-07-10 17:50:43 +00:00
Owen Anderson 2552a12e65 Fix the build, and fix the handling of pointer sizes.
llvm-svn: 38494
2007-07-10 17:25:03 +00:00
Owen Anderson 47352db672 Fix a bunch of things from Chris' feedback
llvm-svn: 38493
2007-07-10 17:08:11 +00:00
Dan Gohman adb3d37c07 Fix a bug in the folding of binary operators to undef.
Thanks to Lauro for spotting this!

llvm-svn: 38491
2007-07-10 15:19:29 +00:00
Dan Gohman fa91282dbf Fix the folding of undef in several binary operators to recognize
undef in either the left or right operand.

llvm-svn: 38489
2007-07-10 14:20:37 +00:00
Evan Cheng ff6f279adf When a node value is only used by a CopyToReg, use the user's dest. This should not be restricted to nodes that produce only a single value.
llvm-svn: 38485
2007-07-10 07:08:32 +00:00
Evan Cheng 32aad49b24 Move DenseMapKeyInfo<SDOperand> from LegalizeDAG.cpp to SelectionDAGNodes.h
llvm-svn: 38484
2007-07-10 06:59:55 +00:00
Nick Lewycky e635cc43c6 Update the ValueRanges interface to use value numbers instead of Value*s.
llvm-svn: 38483
2007-07-10 03:28:21 +00:00
Owen Anderson 4c4b238448 Move some key maps from std::map to DenseMap. This improves the time to optimize Anton's testcase from 17.5s
to 15.7s.

llvm-svn: 38480
2007-07-10 00:27:22 +00:00