1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

30695 Commits

Author SHA1 Message Date
Jeff Cohen
98c99a3a02 Unbreak VC++ build.
llvm-svn: 34917
2007-03-05 00:00:42 +00:00
Chris Lattner
7fdddda045 add a getSignBit method, elimiante virtual method from getBitMask()
llvm-svn: 34916
2007-03-04 23:33:19 +00:00
Chris Lattner
69aafa4be8 fix 80 col violations, mark arrays static
llvm-svn: 34915
2007-03-04 23:33:03 +00:00
Chris Lattner
0036009167 simplify some code
llvm-svn: 34914
2007-03-04 23:16:36 +00:00
Chris Lattner
8c7d418eaf 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
295b3d69b1 add a new node
llvm-svn: 34912
2007-03-04 20:40:06 +00:00
Chris Lattner
fc3b6903e3 new testcase, corresponds to:
long long test(long long A, unsigned B) {
  return (A + ((long long)B << 32));
}

llvm-svn: 34911
2007-03-04 20:39:47 +00:00
Chris Lattner
7021449d8b generalize
llvm-svn: 34910
2007-03-04 20:08:45 +00:00
Chris Lattner
06e4ea2b21 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
bac1a46d92 eliminate some ops if they have an undef RHS
llvm-svn: 34908
2007-03-04 20:01:46 +00:00
Chris Lattner
241e2e2e3d fix typo
llvm-svn: 34906
2007-03-04 06:36:24 +00:00
Chris Lattner
6d7701714e add missing braces
llvm-svn: 34905
2007-03-04 06:13:52 +00:00
Chris Lattner
758a83d1b0 minor cleanups
llvm-svn: 34904
2007-03-04 04:50:21 +00:00
Reid Spencer
d3481fbeec Remove unneeded header file.
llvm-svn: 34903
2007-03-04 04:41:04 +00:00
Chris Lattner
de2b4322ff 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
f2304552f7 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
dec6a90a00 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
2510829eba add iterator range version of ctor.
llvm-svn: 34899
2007-03-04 04:04:43 +00:00
Chris Lattner
4d48389d2d 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
17000a40e2 Guard further against APInt operations with operands of unequal bit width.
llvm-svn: 34897
2007-03-04 01:25:35 +00:00
Chris Lattner
519ed087bb 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
f5eeb38be5 New testcases for PR1179/PR1232.
llvm-svn: 34895
2007-03-04 00:54:06 +00:00
Reid Spencer
811c8dccf1 Get the version number for the LLVM from the autoconf/configure.ac file
when building the documentation for the web site.

llvm-svn: 34894
2007-03-04 00:45:50 +00:00
Chris Lattner
9c1328fdbb Fix CodeGen/Generic/fpowi-promote.ll and PR1239
llvm-svn: 34893
2007-03-03 23:43:21 +00:00
Chris Lattner
e6d3ae4f2c New testcase for PR1239
llvm-svn: 34892
2007-03-03 23:42:50 +00:00
Chris Lattner
f45fa39069 Make RewriteLoopExitValues far less nested by using continue in the loop
llvm-svn: 34891
2007-03-03 22:48:48 +00:00
Chris Lattner
4275ffd6ff Add an expand action for ISD label which just deletes the label.
This "fixes" PR1238.

llvm-svn: 34890
2007-03-03 19:21:38 +00:00
Reid Spencer
4ab5a02fb1 Remove unnecessary #include.
llvm-svn: 34889
2007-03-03 18:29:16 +00:00
Reid Spencer
49931e1841 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.

llvm-svn: 34888
2007-03-03 18:21:44 +00:00
Reid Spencer
4610488330 Deal with error handling better.
llvm-svn: 34887
2007-03-03 18:19:18 +00:00
Reid Spencer
cdb5aa2805 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.

llvm-svn: 34886
2007-03-03 18:18:11 +00:00
Reid Spencer
e0d00951c2 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.

llvm-svn: 34885
2007-03-03 16:33:33 +00:00
Reid Spencer
8aaa36a012 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.

llvm-svn: 34884
2007-03-03 08:38:04 +00:00
Reid Spencer
6cdbf93aae Avoid memory leakage by having caller construct the APInt for the
destination value of LoadValueFromMemory.

llvm-svn: 34883
2007-03-03 08:36:29 +00:00
Reid Spencer
e96b55e61f Require the destination GlobalValue for LoadValueFromMemory to be passed
in as a parameter instead of returned.

llvm-svn: 34882
2007-03-03 08:35:14 +00:00
Reid Spencer
e2bf55dfe8 Regularize the interface for conversion functions to/from float/double.
llvm-svn: 34881
2007-03-03 08:34:02 +00:00
Reid Spencer
6037b564a0 Fix constant folding of fp->int bitcast for vectors.
llvm-svn: 34880
2007-03-03 08:32:46 +00:00
Reid Spencer
36fb227e99 Add APIntVal as a possible GenericeValue.
llvm-svn: 34879
2007-03-03 07:36:44 +00:00
Evan Cheng
306d12a520 Only propagate IsKill if the last use is a kill.
llvm-svn: 34878
2007-03-03 06:32:37 +00:00
Reid Spencer
747e872c5b 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.

llvm-svn: 34877
2007-03-03 06:22:22 +00:00
Reid Spencer
11a355139c 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.

llvm-svn: 34876
2007-03-03 06:19:55 +00:00
Nate Begeman
7ffce4cf16 http://llvm.org/bugs/show_bug.cgi?id=1237
llvm-svn: 34875
2007-03-03 06:18:18 +00:00
Reid Spencer
df9222b66d Implement loading and storing of APInt values from memory.
llvm-svn: 34874
2007-03-03 06:18:03 +00:00
Reid Spencer
503dda5840 Make getNumWords public so that those using getRawData stand a chance of
not reading beyond the end of the buffer returned.

llvm-svn: 34873
2007-03-03 06:17:23 +00:00
Reid Spencer
47b01d6acb Add names for some of the operators. This is needed for the macros in
the Interpreter.

llvm-svn: 34872
2007-03-03 05:37:23 +00:00
Nick Lewycky
cfed5f36a1 Emit low/high immediate loads properly for Linux/PPC.
llvm-svn: 34871
2007-03-03 05:29:51 +00:00
Chris Lattner
f22da20af4 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.

llvm-svn: 34870
2007-03-03 05:27:34 +00:00
Chris Lattner
e1179e62fb new testcase: instcombine should remove all the casts.
llvm-svn: 34869
2007-03-03 05:24:06 +00:00
Nick Lewycky
a0a23a645d Translate bit operations to English.
llvm-svn: 34868
2007-03-03 03:14:40 +00:00
Chris Lattner
a167e8f27b instcombine doesn't do CSE, simplify unrelated detail
llvm-svn: 34867
2007-03-03 02:27:02 +00:00