Commit Graph

30744 Commits

Author SHA1 Message Date
Duncan Sands
143cced66b 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
2007-03-05 08:20:48 +00:00
Chris Lattner
372dda8881 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
2007-03-05 07:52:57 +00:00
Jeff Cohen
413bc8262e Ensure 64-bit correctness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34923 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 05:45:08 +00:00
Jeff Cohen
0a18267248 Implement memoryLimit on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34922 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 05:22:08 +00:00
Jeff Cohen
f15bd1b9c6 Elminate tabs and improve comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34921 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 00:46:22 +00:00
Chris Lattner
3c69849696 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
2007-03-05 00:11:19 +00:00
Chris Lattner
783ccdb5c4 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
2007-03-05 00:02:29 +00:00
Chris Lattner
bc62f24a8c new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34918 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 00:01:38 +00:00
Jeff Cohen
ca5183d445 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34917 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 00:00:42 +00:00
Chris Lattner
f298fd0428 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
2007-03-04 23:33:19 +00:00
Chris Lattner
82a60eca8f fix 80 col violations, mark arrays static
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34915 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 23:33:03 +00:00
Chris Lattner
d5fa214729 simplify some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34914 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 23:16:36 +00:00
Chris Lattner
b654176cb4 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
2007-03-04 20:40:38 +00:00
Chris Lattner
55e34eb317 add a new node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34912 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 20:40:06 +00:00
Chris Lattner
53546d8ab4 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
2007-03-04 20:39:47 +00:00
Chris Lattner
bcf2484450 generalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34910 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 20:08:45 +00:00
Chris Lattner
91153686f0 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
2007-03-04 20:03:15 +00:00
Chris Lattner
175415e116 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
2007-03-04 20:01:46 +00:00
Chris Lattner
8f3acf87a2 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34906 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 06:36:24 +00:00
Chris Lattner
569bdc7bb7 add missing braces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34905 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 06:13:52 +00:00
Chris Lattner
57939df2eb minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34904 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 04:50:21 +00:00
Reid Spencer
d7f3de655b Remove unneeded header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34903 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 04:41:04 +00:00
Chris Lattner
f964f321eb 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
2007-03-04 04:27:24 +00:00
Chris Lattner
55091782c1 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
2007-03-04 04:20:48 +00:00
Chris Lattner
b1f5d8bf6f 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
2007-03-04 04:06:39 +00:00
Chris Lattner
ab8fea5283 add iterator range version of ctor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34899 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 04:04:43 +00:00
Chris Lattner
9f3d738866 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
2007-03-04 03:43:23 +00:00
Reid Spencer
0797605204 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
2007-03-04 01:25:35 +00:00
Chris Lattner
9caed5440d 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
2007-03-04 01:00:28 +00:00
Chris Lattner
2fbdd6ba02 New testcases for PR1179/PR1232.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34895 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 00:54:06 +00:00
Reid Spencer
12cabda941 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
2007-03-04 00:45:50 +00:00
Chris Lattner
8b2d42c949 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
2007-03-03 23:43:21 +00:00
Chris Lattner
4f263a00bf New testcase for PR1239
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34892 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 23:42:50 +00:00
Chris Lattner
c9838f25d5 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
2007-03-03 22:48:48 +00:00
Chris Lattner
a9569f10de 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
2007-03-03 19:21:38 +00:00
Reid Spencer
b90fc7ed21 Remove unnecessary #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34889 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 18:29:16 +00:00
Reid Spencer
f70d677501 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
2007-03-03 18:21:44 +00:00
Reid Spencer
d4c0e62413 Deal with error handling better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34887 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 18:19:18 +00:00
Reid Spencer
c923435a59 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
2007-03-03 18:18:11 +00:00
Reid Spencer
bdc75089ab 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
2007-03-03 16:33:33 +00:00
Reid Spencer
e0929364e8 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
2007-03-03 08:38:04 +00:00
Reid Spencer
f0f09a96f3 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
2007-03-03 08:36:29 +00:00
Reid Spencer
47567bdcb5 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
2007-03-03 08:35:14 +00:00
Reid Spencer
52f32d5566 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
2007-03-03 08:34:02 +00:00
Reid Spencer
a188bbe7ac 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
2007-03-03 08:32:46 +00:00
Reid Spencer
1416862d7c Add APIntVal as a possible GenericeValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34879 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 07:36:44 +00:00
Evan Cheng
a7288df62d 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
2007-03-03 06:32:37 +00:00
Reid Spencer
e1aa066216 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
2007-03-03 06:22:22 +00:00
Reid Spencer
dea7ef1f17 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
2007-03-03 06:19:55 +00:00
Nate Begeman
af80638869 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
2007-03-03 06:18:18 +00:00