Commit Graph

17707 Commits

Author SHA1 Message Date
Devang Patel 9d9fc90952 Keep track of higher level analysis.
llvm-svn: 34974
2007-03-06 17:52:53 +00:00
Devang Patel 84ffc223f1 LPPassManager : Add initialization and finalizatino hooks.
llvm-svn: 34968
2007-03-06 16:59:03 +00:00
Evan Cheng 8b8cac289b Minor interface change.
llvm-svn: 34967
2007-03-06 10:05:14 +00:00
Evan Cheng 4783ae8ac1 Scavenge a register using the register scavenger when needed.
llvm-svn: 34966
2007-03-06 10:03:56 +00:00
Evan Cheng c1b21857a4 If target decides to create an emergency spill slot, make sure it's closest to SP or frame pointer.
llvm-svn: 34965
2007-03-06 10:02:38 +00:00
Evan Cheng 372c2c69f8 Register scavenger is now capable of scavenging. It spills a register whose use of furthest away to make it available.
llvm-svn: 34964
2007-03-06 10:01:25 +00:00
Anton Korobeynikov e7ec3bc7bc Use new SDIselParamAttr enumeration. This removes "magick" constants
from formal attributes' flags processing.

llvm-svn: 34963
2007-03-06 08:12:33 +00:00
Anton Korobeynikov f0b9316552 Enumerate SDISel formal parameter attributes. Make use of new
enumeration.

llvm-svn: 34960
2007-03-06 06:10:33 +00:00
Anton Korobeynikov 666d23d4e6 Implement PR1240
llvm-svn: 34959
2007-03-06 05:32:48 +00:00
Reid Spencer 4e42790c43 1. Make StoreValueToMemory a little more efficient by not requiring caller
to make a copy of the GenericValue.
2. Fix a copy & paste bug in StoreValueToMemory where 64-bit values were
   truncated to 32

llvm-svn: 34958
2007-03-06 05:03:16 +00:00
Reid Spencer 1efc4aaf84 Fix some thinko's in the last patch. PtrSize has to be in bits and we
might need to zext not just trunc the value.

llvm-svn: 34955
2007-03-06 03:46:41 +00:00
Reid Spencer 10dbc1e896 Fix a bug in IntToPtr. Truncating to 64-bits only works if the integer
is larger. Adjust so that it truncates to pointer width, only if necessary.

llvm-svn: 34954
2007-03-06 03:41:50 +00:00
Reid Spencer c764c55745 Simplify code as a result of the change in GenericValue to have a single
integer field of type APInt instead of different sized integer fields.

llvm-svn: 34952
2007-03-06 03:11:31 +00:00
Reid Spencer 40015aad5a Radically simplify execution. This patch gets rid of all the special
handling for integer of various sizes. GenericValue now has just a single
integer field of type APInt. We use its facilities directly in the
execution of all instructions.

llvm-svn: 34951
2007-03-06 03:09:31 +00:00
Reid Spencer c45e10474a Adjust and simplify external function processing now that GenericValue has
a single integer field of type APInt.

llvm-svn: 34950
2007-03-06 03:08:12 +00:00
Reid Spencer 7f68713eb8 APInt's are no longer allocated on the heap because they are direct
members of GenericValue. Consequently the code to clean them up isn't
needed.

llvm-svn: 34948
2007-03-06 03:06:48 +00:00
Reid Spencer 2d89fa84bc Remove the insufficient code in Interpreter::create that computed the
Target DataLayout incorrectly. For now, we'll trust that the module has
got the correct DataLayout. In the future, this needs to be changed to
tell the TargetData to be "current host".

llvm-svn: 34947
2007-03-06 03:05:57 +00:00
Reid Spencer 87aa65f40e Simplify things significantly because GenericValue now has a single integer
field, of type APInt, instead of multiple integer fields. Also, get rid of
the special endianness code in StoreValueToMemory and LoadValueToMemory.
ExecutionEngine is always used to execute on the host platform so this is
now unnecessary.

llvm-svn: 34946
2007-03-06 03:04:04 +00:00
Devang Patel a8c81c5261 Use std::deque to manage loop queue inside LPPassManager.
llvm-svn: 34943
2007-03-06 02:30:46 +00:00
Devang Patel 42dd1e92c7 Keep track of inherited analysis. For example, if a loop pass does not
preserve dominator info then it should update parent FPPassManager's
available analysis info to reflect this.

llvm-svn: 34942
2007-03-06 01:55:46 +00:00
Devang Patel d74ede70fb Add preparePassManager() hook. This allows each pass to check whether
current active pass manager is appropriate or not.

A loop pass may consider current LPPassManager in appropraite if loop
pass is not preserving analysis information that is used by other
passes managed by current LPPassManager. In such situation, loop pass
can pop current LPPassManager from the PMStack using this  hook
and use new LPPassManager for itself.

llvm-svn: 34941
2007-03-06 01:06:16 +00:00
Chris Lattner 4f2e4e0f92 Switch PPC return lower to use an autogenerated CC description.
llvm-svn: 34940
2007-03-06 00:59:59 +00:00
Reid Spencer 3939b1a274 Remove an unnecessary if statement and adjust indentation.
llvm-svn: 34939
2007-03-05 23:36:13 +00:00
Bill Wendling b1c86b49ea Add the emms intrinsic for MMX support.
llvm-svn: 34938
2007-03-05 23:09:45 +00:00
Devang Patel ec2b9a7850 Current pass manager, not the parent pass manager, assumes the role of
last user when one of the managed pass uses info provided by parent pass
manager.

This was exposed by LPPassManager work.

llvm-svn: 34936
2007-03-05 22:57:49 +00:00
Devang Patel 003a559633 Avoid constructing std::strings unless pass debugging is ON.
llvm-svn: 34933
2007-03-05 20:01:30 +00:00
Devang Patel 7ebf09dbca Account for time consumed by releaseMemory() properly.
llvm-svn: 34932
2007-03-05 18:20:51 +00:00
Lauro Ramos Venancio f10769dda7 Use init_array/fini_array sections for static contructors/destructors when the ABI is AAPCS.
Fix SingleSource/Regression/C/ConstructorDestructorAttributes test on arm-linux-gnueabi.

llvm-svn: 34931
2007-03-05 17:59:58 +00:00
Chris Lattner 66e6a8229a This is the first major step of implementing PR1226. We now successfully
scalarrepl things down to elements, but mem2reg can't promote elements that
are memset/memcpy'd.  Until then, the code is disabled "0 &&".

llvm-svn: 34924
2007-03-05 07:52:57 +00:00
Jeff Cohen 7157fe3f4b Ensure 64-bit correctness.
llvm-svn: 34923
2007-03-05 05:45:08 +00:00
Jeff Cohen a531d04b64 Implement memoryLimit on Windows.
llvm-svn: 34922
2007-03-05 05:22:08 +00:00
Chris Lattner fe53cf2459 fix a subtle bug that caused an MSVC warning. Thanks to Jeffc for pointing this out.
llvm-svn: 34920
2007-03-05 00:11:19 +00:00
Chris Lattner 5fdded1d2f Add some simplifications for demanded bits, this allows instcombine to turn:
define i64 @test(i64 %A, i32 %B) {
        %tmp12 = zext i32 %B to i64             ; <i64> [#uses=1]
        %tmp3 = shl i64 %tmp12, 32              ; <i64> [#uses=1]
        %tmp5 = add i64 %tmp3, %A               ; <i64> [#uses=1]
        %tmp6 = and i64 %tmp5, 123              ; <i64> [#uses=1]
        ret i64 %tmp6
}

into:

define i64 @test(i64 %A, i32 %B) {
        %tmp6 = and i64 %A, 123         ; <i64> [#uses=1]
        ret i64 %tmp6
}

This implements Transforms/InstCombine/add2.ll:test1

llvm-svn: 34919
2007-03-05 00:02:29 +00:00
Jeff Cohen b622c11f77 Unbreak VC++ build.
llvm-svn: 34917
2007-03-05 00:00:42 +00:00
Chris Lattner ab2f913b68 simplify some code
llvm-svn: 34914
2007-03-04 23:16:36 +00:00
Chris Lattner 47206667c0 fold away addc nodes when we know there cannot be a carry-out.
llvm-svn: 34913
2007-03-04 20:40:38 +00:00
Chris Lattner 2dcc6e7f58 generalize
llvm-svn: 34910
2007-03-04 20:08:45 +00:00
Chris Lattner e2e13caeb2 canonicalize constants to the RHS of addc/adde. If nothing uses the carry out of
addc, turn it into add.

This allows us to compile:

long long test(long long A, unsigned B) {
  return (A + ((long long)B << 32)) & 123;
}

into:

_test:
        movl $123, %eax
        andl 4(%esp), %eax
        xorl %edx, %edx
        ret

instead of:
_test:
        xorl %edx, %edx
        movl %edx, %eax
        addl 4(%esp), %eax   ;; add of zero
        andl $123, %eax
        ret

llvm-svn: 34909
2007-03-04 20:03:15 +00:00
Chris Lattner 362621c7ae eliminate some ops if they have an undef RHS
llvm-svn: 34908
2007-03-04 20:01:46 +00:00
Chris Lattner 1e04147240 fix typo
llvm-svn: 34906
2007-03-04 06:36:24 +00:00
Chris Lattner d647f92a14 add missing braces
llvm-svn: 34905
2007-03-04 06:13:52 +00:00
Chris Lattner c33fd469ef minor cleanups
llvm-svn: 34904
2007-03-04 04:50:21 +00:00
Reid Spencer b8825b8c04 Remove unneeded header file.
llvm-svn: 34903
2007-03-04 04:41:04 +00:00
Chris Lattner 8258b44b22 Speed up -instcombine by 20% by avoiding a particularly expensive passmgr call.
llvm-svn: 34902
2007-03-04 04:27:24 +00:00
Chris Lattner a5403a587c switch MarkAliveBlocks over to using SmallPtrSet instead of std::set, speeding
up simplifycfg by 20%

llvm-svn: 34901
2007-03-04 04:20:48 +00:00
Chris Lattner 16cf9a7686 Speed up Loop::isLCSSAForm by using a hash table instead of a sorted vector.
llvm-svn: 34900
2007-03-04 04:06:39 +00:00
Chris Lattner d7b4c92cd0 make better use of LCSSA information in RewriteLoopExitValues. Before, we
would scan the entire loop body, then scan all users of instructions in the
loop, looking for users outside the loop.  Now, since we know that the
loop is in LCSSA form, we know that any users outside the loop will be LCSSA
phi nodes.  Just scan them.

This speeds up indvars significantly.

llvm-svn: 34898
2007-03-04 03:43:23 +00:00
Reid Spencer 69904f939a Guard further against APInt operations with operands of unequal bit width.
llvm-svn: 34897
2007-03-04 01:25:35 +00:00
Chris Lattner 1f7648efba Implement PR1179/PR1232 and test/Transforms/IndVarsSimplify/loop_evaluate_[234].ll
This makes -indvars require and use LCSSA, updating it as appropriate.

llvm-svn: 34896
2007-03-04 01:00:28 +00:00
Chris Lattner ca401aac31 Fix CodeGen/Generic/fpowi-promote.ll and PR1239
llvm-svn: 34893
2007-03-03 23:43:21 +00:00