oota-llvm.git
17 years agoFix this to put its output in the output directory.
Reid Spencer [Tue, 6 Mar 2007 17:44:43 +0000 (17:44 +0000)]
Fix this to put its output in the output directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34971 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRevert last patch. The examples build now.
Reid Spencer [Tue, 6 Mar 2007 17:26:14 +0000 (17:26 +0000)]
Revert last patch. The examples build now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34970 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdjust for changes in GenericValue type.
Reid Spencer [Tue, 6 Mar 2007 17:24:31 +0000 (17:24 +0000)]
Adjust for changes in GenericValue type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34969 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoLPPassManager : Add initialization and finalizatino hooks.
Devang Patel [Tue, 6 Mar 2007 16:59:03 +0000 (16:59 +0000)]
LPPassManager : Add initialization and finalizatino hooks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34968 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMinor interface change.
Evan Cheng [Tue, 6 Mar 2007 10:05:14 +0000 (10:05 +0000)]
Minor interface change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34967 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoScavenge a register using the register scavenger when needed.
Evan Cheng [Tue, 6 Mar 2007 10:03:56 +0000 (10:03 +0000)]
Scavenge a register using the register scavenger when needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34966 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoIf target decides to create an emergency spill slot, make sure it's closest to SP...
Evan Cheng [Tue, 6 Mar 2007 10:02:38 +0000 (10:02 +0000)]
If target decides to create an emergency spill slot, make sure it's closest to SP or frame pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34965 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRegister scavenger is now capable of scavenging. It spills a register whose use of...
Evan Cheng [Tue, 6 Mar 2007 10:01:25 +0000 (10:01 +0000)]
Register scavenger is now capable of scavenging. It spills a register whose use of furthest away to make it available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34964 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUse new SDIselParamAttr enumeration. This removes "magick" constants
Anton Korobeynikov [Tue, 6 Mar 2007 08:12:33 +0000 (08:12 +0000)]
Use new SDIselParamAttr enumeration. This removes "magick" constants
from formal attributes' flags processing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34963 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agotemporarily disable this until Reid has a chance to fix it.
Chris Lattner [Tue, 6 Mar 2007 07:30:03 +0000 (07:30 +0000)]
temporarily disable this until Reid has a chance to fix it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34962 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agollvm-gcc 3.4 is dead.
Chris Lattner [Tue, 6 Mar 2007 06:27:34 +0000 (06:27 +0000)]
llvm-gcc 3.4 is dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34961 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoEnumerate SDISel formal parameter attributes. Make use of new
Anton Korobeynikov [Tue, 6 Mar 2007 06:10:33 +0000 (06:10 +0000)]
Enumerate SDISel formal parameter attributes. Make use of new
enumeration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34960 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplement PR1240
Anton Korobeynikov [Tue, 6 Mar 2007 05:32:48 +0000 (05:32 +0000)]
Implement PR1240

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34959 91177308-0d34-0410-b5e6-96231b3b80d8

17 years ago1. Make StoreValueToMemory a little more efficient by not requiring caller
Reid Spencer [Tue, 6 Mar 2007 05:03:16 +0000 (05:03 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34958 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake StoreValueToMemory a little more efficient by not copying a
Reid Spencer [Tue, 6 Mar 2007 05:02:28 +0000 (05:02 +0000)]
Make StoreValueToMemory a little more efficient by not copying a
GenericValue to a temporary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34957 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix some thinko's in the last patch. PtrSize has to be in bits and we
Reid Spencer [Tue, 6 Mar 2007 03:46:41 +0000 (03:46 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34955 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix a bug in IntToPtr. Truncating to 64-bits only works if the integer
Reid Spencer [Tue, 6 Mar 2007 03:41:50 +0000 (03:41 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34954 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoObtain the exit function before execution just in case the module
Reid Spencer [Tue, 6 Mar 2007 03:12:55 +0000 (03:12 +0000)]
Obtain the exit function before execution just in case the module
disappears before we get to calling the exit function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34953 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSimplify code as a result of the change in GenericValue to have a single
Reid Spencer [Tue, 6 Mar 2007 03:11:31 +0000 (03:11 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34952 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRadically simplify execution. This patch gets rid of all the special
Reid Spencer [Tue, 6 Mar 2007 03:09:31 +0000 (03:09 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34951 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdjust and simplify external function processing now that GenericValue has
Reid Spencer [Tue, 6 Mar 2007 03:08:12 +0000 (03:08 +0000)]
Adjust and simplify external function processing now that GenericValue has
a single integer field of type APInt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34950 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAPInt's are no longer allocated on the heap because they are direct
Reid Spencer [Tue, 6 Mar 2007 03:06:48 +0000 (03:06 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34948 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRemove the insufficient code in Interpreter::create that computed the
Reid Spencer [Tue, 6 Mar 2007 03:05:57 +0000 (03:05 +0000)]
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".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34947 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSimplify things significantly because GenericValue now has a single integer
Reid Spencer [Tue, 6 Mar 2007 03:04:04 +0000 (03:04 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34946 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake GenericeValue into a struct with a union instead of just a union. This
Reid Spencer [Tue, 6 Mar 2007 03:01:54 +0000 (03:01 +0000)]
Make GenericeValue into a struct with a union instead of just a union. This
allows an APInt value to be constructed. Remove all the native integer types
from the union. These are replaced with the single IntVal of type APInt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34945 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTest to ensure that data layout is generated correctly for host platform.
Reid Spencer [Tue, 6 Mar 2007 03:00:17 +0000 (03:00 +0000)]
Test to ensure that data layout is generated correctly for host platform.
This is for PR1242.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34944 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUse std::deque to manage loop queue inside LPPassManager.
Devang Patel [Tue, 6 Mar 2007 02:30:46 +0000 (02:30 +0000)]
Use std::deque to manage loop queue inside LPPassManager.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34943 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoKeep track of inherited analysis. For example, if a loop pass does not
Devang Patel [Tue, 6 Mar 2007 01:55:46 +0000 (01:55 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34942 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd preparePassManager() hook. This allows each pass to check whether
Devang Patel [Tue, 6 Mar 2007 01:06:16 +0000 (01:06 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34941 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSwitch PPC return lower to use an autogenerated CC description.
Chris Lattner [Tue, 6 Mar 2007 00:59:59 +0000 (00:59 +0000)]
Switch PPC return lower to use an autogenerated CC description.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34940 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRemove an unnecessary if statement and adjust indentation.
Reid Spencer [Mon, 5 Mar 2007 23:36:13 +0000 (23:36 +0000)]
Remove an unnecessary if statement and adjust indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34939 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd the emms intrinsic for MMX support.
Bill Wendling [Mon, 5 Mar 2007 23:09:45 +0000 (23:09 +0000)]
Add the emms intrinsic for MMX support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34938 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoDocument the use of getValueType() more accurately, specifically explain
Reid Spencer [Mon, 5 Mar 2007 23:06:32 +0000 (23:06 +0000)]
Document the use of getValueType() more accurately, specifically explain
that the instruction opcode is added to the InstructionVal value and the
consequences of that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34937 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCurrent pass manager, not the parent pass manager, assumes the role of
Devang Patel [Mon, 5 Mar 2007 22:57:49 +0000 (22:57 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34936 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd a test case for a particular udiv/select transform.
Reid Spencer [Mon, 5 Mar 2007 22:51:08 +0000 (22:51 +0000)]
Add a test case for a particular udiv/select transform.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34935 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAvoid constructing std::strings unless pass debugging is ON.
Devang Patel [Mon, 5 Mar 2007 20:01:30 +0000 (20:01 +0000)]
Avoid constructing std::strings unless pass debugging is ON.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34933 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAccount for time consumed by releaseMemory() properly.
Devang Patel [Mon, 5 Mar 2007 18:20:51 +0000 (18:20 +0000)]
Account for time consumed by releaseMemory() properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34932 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUse init_array/fini_array sections for static contructors/destructors when the ABI...
Lauro Ramos Venancio [Mon, 5 Mar 2007 17:59:58 +0000 (17:59 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34931 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoThe hack won't work on VS 2005, and it might not be needed anyway.
Jeff Cohen [Mon, 5 Mar 2007 17:22:33 +0000 (17:22 +0000)]
The hack won't work on VS 2005, and it might not be needed anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34930 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCorrect the calculation in APInt::logBase2().
Zhou Sheng [Mon, 5 Mar 2007 16:42:58 +0000 (16:42 +0000)]
Correct the calculation in APInt::logBase2().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34929 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCredit self for Ada front-end.
Duncan Sands [Mon, 5 Mar 2007 09:21:11 +0000 (09:21 +0000)]
Credit self for Ada front-end.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34928 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTestcase for handling of static constant declarations in EmitBIND_EXPR.
Duncan Sands [Mon, 5 Mar 2007 08:39:58 +0000 (08:39 +0000)]
Testcase for handling of static constant declarations in EmitBIND_EXPR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34927 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTestcase causing the Ada front-end to create bogus constructor fields.
Duncan Sands [Mon, 5 Mar 2007 08:34:35 +0000 (08:34 +0000)]
Testcase causing the Ada front-end to create bogus constructor fields.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34926 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoNew directory for Ada testcases. Test handling of NON_LVALUE_EXPR.
Duncan Sands [Mon, 5 Mar 2007 08:20:48 +0000 (08:20 +0000)]
New directory for Ada testcases.  Test handling of NON_LVALUE_EXPR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34925 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoThis is the first major step of implementing PR1226. We now successfully
Chris Lattner [Mon, 5 Mar 2007 07:52:57 +0000 (07:52 +0000)]
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 &&".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34924 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoEnsure 64-bit correctness.
Jeff Cohen [Mon, 5 Mar 2007 05:45:08 +0000 (05:45 +0000)]
Ensure 64-bit correctness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34923 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplement memoryLimit on Windows.
Jeff Cohen [Mon, 5 Mar 2007 05:22:08 +0000 (05:22 +0000)]
Implement memoryLimit on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34922 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoElminate tabs and improve comments.
Jeff Cohen [Mon, 5 Mar 2007 00:46:22 +0000 (00:46 +0000)]
Elminate tabs and improve comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34921 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agofix a subtle bug that caused an MSVC warning. Thanks to Jeffc for pointing this...
Chris Lattner [Mon, 5 Mar 2007 00:11:19 +0000 (00:11 +0000)]
fix a subtle bug that caused an MSVC warning.  Thanks to Jeffc for pointing this out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34920 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd some simplifications for demanded bits, this allows instcombine to turn:
Chris Lattner [Mon, 5 Mar 2007 00:02:29 +0000 (00:02 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34919 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agonew testcase
Chris Lattner [Mon, 5 Mar 2007 00:01:38 +0000 (00:01 +0000)]
new testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34918 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUnbreak VC++ build.
Jeff Cohen [Mon, 5 Mar 2007 00:00:42 +0000 (00:00 +0000)]
Unbreak VC++ build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34917 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd a getSignBit method, elimiante virtual method from getBitMask()
Chris Lattner [Sun, 4 Mar 2007 23:33:19 +0000 (23:33 +0000)]
add a getSignBit method, elimiante virtual method from getBitMask()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34916 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agofix 80 col violations, mark arrays static
Chris Lattner [Sun, 4 Mar 2007 23:33:03 +0000 (23:33 +0000)]
fix 80 col violations, mark arrays static

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34915 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agosimplify some code
Chris Lattner [Sun, 4 Mar 2007 23:16:36 +0000 (23:16 +0000)]
simplify some code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34914 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agofold away addc nodes when we know there cannot be a carry-out.
Chris Lattner [Sun, 4 Mar 2007 20:40:38 +0000 (20:40 +0000)]
fold away addc nodes when we know there cannot be a carry-out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34913 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd a new node
Chris Lattner [Sun, 4 Mar 2007 20:40:06 +0000 (20:40 +0000)]
add a new node

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34912 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agonew testcase, corresponds to:
Chris Lattner [Sun, 4 Mar 2007 20:39:47 +0000 (20:39 +0000)]
new testcase, corresponds to:

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34911 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agogeneralize
Chris Lattner [Sun, 4 Mar 2007 20:08:45 +0000 (20:08 +0000)]
generalize

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34910 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agocanonicalize constants to the RHS of addc/adde. If nothing uses the carry out of
Chris Lattner [Sun, 4 Mar 2007 20:03:15 +0000 (20:03 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34909 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoeliminate some ops if they have an undef RHS
Chris Lattner [Sun, 4 Mar 2007 20:01:46 +0000 (20:01 +0000)]
eliminate some ops if they have an undef RHS

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34908 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agofix typo
Chris Lattner [Sun, 4 Mar 2007 06:36:24 +0000 (06:36 +0000)]
fix typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34906 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd missing braces
Chris Lattner [Sun, 4 Mar 2007 06:13:52 +0000 (06:13 +0000)]
add missing braces

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34905 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agominor cleanups
Chris Lattner [Sun, 4 Mar 2007 04:50:21 +0000 (04:50 +0000)]
minor cleanups

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34904 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRemove unneeded header file.
Reid Spencer [Sun, 4 Mar 2007 04:41:04 +0000 (04:41 +0000)]
Remove unneeded header file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34903 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSpeed up -instcombine by 20% by avoiding a particularly expensive passmgr call.
Chris Lattner [Sun, 4 Mar 2007 04:27:24 +0000 (04:27 +0000)]
Speed up -instcombine by 20% by avoiding a particularly expensive passmgr call.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34902 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoswitch MarkAliveBlocks over to using SmallPtrSet instead of std::set, speeding
Chris Lattner [Sun, 4 Mar 2007 04:20:48 +0000 (04:20 +0000)]
switch MarkAliveBlocks over to using SmallPtrSet instead of std::set, speeding
up simplifycfg by 20%

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34901 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSpeed up Loop::isLCSSAForm by using a hash table instead of a sorted vector.
Chris Lattner [Sun, 4 Mar 2007 04:06:39 +0000 (04:06 +0000)]
Speed up Loop::isLCSSAForm by using a hash table instead of a sorted vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34900 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd iterator range version of ctor.
Chris Lattner [Sun, 4 Mar 2007 04:04:43 +0000 (04:04 +0000)]
add iterator range version of ctor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34899 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agomake better use of LCSSA information in RewriteLoopExitValues. Before, we
Chris Lattner [Sun, 4 Mar 2007 03:43:23 +0000 (03:43 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34898 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoGuard further against APInt operations with operands of unequal bit width.
Reid Spencer [Sun, 4 Mar 2007 01:25:35 +0000 (01:25 +0000)]
Guard further against APInt operations with operands of unequal bit width.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34897 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplement PR1179/PR1232 and test/Transforms/IndVarsSimplify/loop_evaluate_[234].ll
Chris Lattner [Sun, 4 Mar 2007 01:00:28 +0000 (01:00 +0000)]
Implement PR1179/PR1232 and test/Transforms/IndVarsSimplify/loop_evaluate_[234].ll

This makes -indvars require and use LCSSA, updating it as appropriate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34896 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoNew testcases for PR1179/PR1232.
Chris Lattner [Sun, 4 Mar 2007 00:54:06 +0000 (00:54 +0000)]
New testcases for PR1179/PR1232.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34895 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoGet the version number for the LLVM from the autoconf/configure.ac file
Reid Spencer [Sun, 4 Mar 2007 00:45:50 +0000 (00:45 +0000)]
Get the version number for the LLVM from the autoconf/configure.ac file
when building the documentation for the web site.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34894 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix CodeGen/Generic/fpowi-promote.ll and PR1239
Chris Lattner [Sat, 3 Mar 2007 23:43:21 +0000 (23:43 +0000)]
Fix CodeGen/Generic/fpowi-promote.ll and PR1239

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34893 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoNew testcase for PR1239
Chris Lattner [Sat, 3 Mar 2007 23:42:50 +0000 (23:42 +0000)]
New testcase for PR1239

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34892 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake RewriteLoopExitValues far less nested by using continue in the loop
Chris Lattner [Sat, 3 Mar 2007 22:48:48 +0000 (22:48 +0000)]
Make RewriteLoopExitValues far less nested by using continue in the loop

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34891 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd an expand action for ISD label which just deletes the label.
Chris Lattner [Sat, 3 Mar 2007 19:21:38 +0000 (19:21 +0000)]
Add an expand action for ISD label which just deletes the label.
This "fixes" PR1238.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34890 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRemove unnecessary #include.
Reid Spencer [Sat, 3 Mar 2007 18:29:16 +0000 (18:29 +0000)]
Remove unnecessary #include.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34889 91177308-0d34-0410-b5e6-96231b3b80d8

17 years ago1. Handle errors around the ModuleProvider. This is necessary since it is
Reid Spencer [Sat, 3 Mar 2007 18:21:44 +0000 (18:21 +0000)]
1. Handle errors around the ModuleProvider. This is necessary since it is
   reading bytecode.
2. The interpreter can delete the ModuleProvider and replace it with
   another so don't depend on it being around after the EE is created.
3. Don't just run llvm_shutdown on exit but actually delete the EE as well.
   This cleans up a vast amount of memory (but not all) that EE retained
   through exit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34888 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoDeal with error handling better.
Reid Spencer [Sat, 3 Mar 2007 18:19:18 +0000 (18:19 +0000)]
Deal with error handling better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34887 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake the creation functions take an error string. This will help the
Reid Spencer [Sat, 3 Mar 2007 18:18:11 +0000 (18:18 +0000)]
Make the creation functions take an error string. This will help the
ExecutionEngine report errors on creation (like bytecode stuff) and also
help to get rid of exception handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34886 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake sure that when we store a value it is masked to its correct bit
Reid Spencer [Sat, 3 Mar 2007 16:33:33 +0000 (16:33 +0000)]
Make sure that when we store a value it is masked to its correct bit
width. This helps CBE work with non-standard integer bit widths.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34885 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoComplete the APIntification of the interpreter. All asserts for > 64 bits
Reid Spencer [Sat, 3 Mar 2007 08:38:04 +0000 (08:38 +0000)]
Complete the APIntification of the interpreter. All asserts for > 64 bits
have been removed and dealt with. The interpreter should now be able to
execute any LLVM program using any bit width.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34884 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAvoid memory leakage by having caller construct the APInt for the
Reid Spencer [Sat, 3 Mar 2007 08:36:29 +0000 (08:36 +0000)]
Avoid memory leakage by having caller construct the APInt for the
destination value of LoadValueFromMemory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34883 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRequire the destination GlobalValue for LoadValueFromMemory to be passed
Reid Spencer [Sat, 3 Mar 2007 08:35:14 +0000 (08:35 +0000)]
Require the destination GlobalValue for LoadValueFromMemory to be passed
in as a parameter instead of returned.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34882 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRegularize the interface for conversion functions to/from float/double.
Reid Spencer [Sat, 3 Mar 2007 08:34:02 +0000 (08:34 +0000)]
Regularize the interface for conversion functions to/from float/double.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34881 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix constant folding of fp->int bitcast for vectors.
Reid Spencer [Sat, 3 Mar 2007 08:32:46 +0000 (08:32 +0000)]
Fix constant folding of fp->int bitcast for vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34880 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd APIntVal as a possible GenericeValue.
Reid Spencer [Sat, 3 Mar 2007 07:36:44 +0000 (07:36 +0000)]
Add APIntVal as a possible GenericeValue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34879 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoOnly propagate IsKill if the last use is a kill.
Evan Cheng [Sat, 3 Mar 2007 06:32:37 +0000 (06:32 +0000)]
Only propagate IsKill if the last use is a kill.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34878 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplement APInt support for the binary operators.
Reid Spencer [Sat, 3 Mar 2007 06:22:22 +0000 (06:22 +0000)]
Implement APInt support for the binary operators.
Move the getConstantExpr function towards the end of the file so we don't
need a dozen forward declarations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34877 91177308-0d34-0410-b5e6-96231b3b80d8

17 years ago1. Have the ExecutionContext keep track of the APInt's allocated and
Reid Spencer [Sat, 3 Mar 2007 06:19:55 +0000 (06:19 +0000)]
1. Have the ExecutionContext keep track of the APInt's allocated and
   ensure they are cleaned up when the stack frame exits.
2. Move a function to the Execution.cpp file where it belongs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34876 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agohttp://llvm.org/bugs/show_bug.cgi?id=1237
Nate Begeman [Sat, 3 Mar 2007 06:18:18 +0000 (06:18 +0000)]
http://llvm.org/bugs/show_bug.cgi?id=1237

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34875 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplement loading and storing of APInt values from memory.
Reid Spencer [Sat, 3 Mar 2007 06:18:03 +0000 (06:18 +0000)]
Implement loading and storing of APInt values from memory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34874 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake getNumWords public so that those using getRawData stand a chance of
Reid Spencer [Sat, 3 Mar 2007 06:17:23 +0000 (06:17 +0000)]
Make getNumWords public so that those using getRawData stand a chance of
not reading beyond the end of the buffer returned.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34873 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd names for some of the operators. This is needed for the macros in
Reid Spencer [Sat, 3 Mar 2007 05:37:23 +0000 (05:37 +0000)]
Add names for some of the operators. This is needed for the macros in
the Interpreter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34872 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoEmit low/high immediate loads properly for Linux/PPC.
Nick Lewycky [Sat, 3 Mar 2007 05:29:51 +0000 (05:29 +0000)]
Emit low/high immediate loads properly for Linux/PPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34871 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agomy recent change caused a failure in a bswap testcase, because it changed
Chris Lattner [Sat, 3 Mar 2007 05:27:34 +0000 (05:27 +0000)]
my recent change caused a failure in a bswap testcase, because it changed
the order that instcombine processed instructions in the testcase.  The end
result is that instcombine finished with:

define i16 @test1(i16 %a) {
        %tmp = zext i16 %a to i32               ; <i32> [#uses=2]
        %tmp21 = lshr i32 %tmp, 8               ; <i32> [#uses=1]
        %tmp5 = shl i32 %tmp, 8         ; <i32> [#uses=1]
        %tmp.upgrd.32 = or i32 %tmp21, %tmp5            ; <i32> [#uses=1]
        %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16           ; <i16> [#uses=1]
        ret i16 %tmp.upgrd.3
}

which can't get matched as a bswap.

This patch makes instcombine more sophisticated about removing truncating
casts, allowing it to turn this into:

define i16 @test2(i16 %a) {
        %tmp211 = lshr i16 %a, 8
        %tmp52 = shl i16 %a, 8
        %tmp.upgrd.323 = or i16 %tmp211, %tmp52
        ret i16 %tmp.upgrd.323
}

which then matches as bswap.  This fixes bswap.ll and implements
InstCombine/cast2.ll:test[12].  This also implements cast elimination of
add/sub.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34870 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agonew testcase: instcombine should remove all the casts.
Chris Lattner [Sat, 3 Mar 2007 05:24:06 +0000 (05:24 +0000)]
new testcase: instcombine should remove all the casts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34869 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTranslate bit operations to English.
Nick Lewycky [Sat, 3 Mar 2007 03:14:40 +0000 (03:14 +0000)]
Translate bit operations to English.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34868 91177308-0d34-0410-b5e6-96231b3b80d8