1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

6859 Commits

Author SHA1 Message Date
Gabor Greif
8f93852b68 cache dereferenced iterators
llvm-svn: 108138
2010-07-12 12:03:02 +00:00
Gabor Greif
fc666b2d76 recommit r108131 (hich has been backed out in r108135) with a fix
llvm-svn: 108137
2010-07-12 12:02:10 +00:00
Benjamin Kramer
f00a49ceff instcombine: fold (x & y) | (~x & z) and (x & y) ^ (~x & z) into ((y ^ z) & x) ^ z which is one instruction shorter. (PR6773)
before:
  %and = and i32 %y, %x
  %neg = xor i32 %x, -1
  %and4 = and i32 %z, %neg
  %xor = xor i32 %and4, %and

after:
  %xor1 = xor i32 %z, %y
  %and2 = and i32 %xor1, %x
  %xor = xor i32 %and2, %z

llvm-svn: 108136
2010-07-12 11:54:45 +00:00
Gabor Greif
1ae3047b14 back out r108131 (of TailDuplication.cpp) for now, it causes a buildbot failure
llvm-svn: 108135
2010-07-12 11:32:39 +00:00
Gabor Greif
f420d43bf6 cache dereferenced iterators
llvm-svn: 108134
2010-07-12 11:19:24 +00:00
Gabor Greif
95805d51b8 cache dereferenced iterators
llvm-svn: 108133
2010-07-12 10:59:23 +00:00
Gabor Greif
32f6368a27 cache dereferenced iterators
llvm-svn: 108132
2010-07-12 10:49:54 +00:00
Gabor Greif
5c94fddae4 cache dereferenced iterators
llvm-svn: 108131
2010-07-12 10:36:48 +00:00
Duncan Sands
f7b98e2b1e Convert some tab stops into spaces.
llvm-svn: 108130
2010-07-12 08:16:59 +00:00
Chris Lattner
c6f9c11878 make the prototypes for CreateMalloc and CreateFree more consistent. Patch
by Hans Vandierendonck from PR7605

llvm-svn: 108116
2010-07-12 00:57:28 +00:00
Chris Lattner
baef771d17 if jump threading is able to infer interesting values on both
the LHS and RHS of an and/or instruction, don't multiply add
known predecessor values.  This fixes the crash on testcase
from PR7498

llvm-svn: 108114
2010-07-12 00:47:34 +00:00
Duncan Sands
954c75c560 The accumulator tail recursion transform claims to work for any associative
operation, but the way it's implemented requires the operation to also be
commutative.  So add a check for commutativity (and tweak the corresponding
comments).  This makes no difference in practice since every associative
LLVM instruction is also commutative!  Here's an example to show the need
for commutativity: the accum_recursion.ll testcase calculates the factorial
function.  Before the transformation the result of a call is
  ((((1*1)*2)*3)...)*x
while afterwards it is
  (((1*x)*(x-1))...*2)*1
which clearly requires both associativity and commutativity of * to be equal
to the original.

llvm-svn: 108056
2010-07-10 20:31:42 +00:00
Gabor Greif
e0e7111f4e cache result of operator*
llvm-svn: 107990
2010-07-09 16:51:20 +00:00
Gabor Greif
4d1241bddb cache result of operator*
llvm-svn: 107984
2010-07-09 16:31:08 +00:00
Gabor Greif
fc355ccebb cache result of operator*
llvm-svn: 107983
2010-07-09 16:26:41 +00:00
Gabor Greif
9259059af3 cache result of operator*
llvm-svn: 107981
2010-07-09 16:17:52 +00:00
Gabor Greif
6184b1a2fa cache result of operator*
llvm-svn: 107976
2010-07-09 15:40:10 +00:00
Gabor Greif
4d54dede01 cache result of operator*
llvm-svn: 107975
2010-07-09 15:25:42 +00:00
Gabor Greif
dcaa85787c cache result of operator*
llvm-svn: 107974
2010-07-09 15:25:09 +00:00
Gabor Greif
72d36e30a0 cache result of operator*
llvm-svn: 107972
2010-07-09 15:01:36 +00:00
Gabor Greif
00ab305f37 cache result of operator* (found by inspection)
llvm-svn: 107971
2010-07-09 14:48:08 +00:00
Gabor Greif
9ac508494f cache result of operator*
llvm-svn: 107969
2010-07-09 14:36:49 +00:00
Gabor Greif
a9fbbe2dbb cache result of operator*
llvm-svn: 107968
2010-07-09 14:29:14 +00:00
Gabor Greif
a5fdd0955d cache result of operator*
llvm-svn: 107966
2010-07-09 14:18:23 +00:00
Gabor Greif
cda479a708 cache operator*'s result (in multiple functions)
llvm-svn: 107965
2010-07-09 14:02:13 +00:00
Gabor Greif
9e2aa5d5d7 do not repeatedly dereference use_iterator
llvm-svn: 107962
2010-07-09 12:23:50 +00:00
Benjamin Kramer
27eb255a70 Teach instcombine to transform
(X >s -1) ? C1 : C2 and (X <s  0) ? C2 : C1
into ((X >>s 31) & (C2 - C1)) + C1, avoiding the conditional.

This optimization could be extended to take non-const C1 and C2 but we better
stay conservative to avoid code size bloat for now.

for
int sel(int n) {
     return n >= 0 ? 60 : 100;
}

we now generate
  sarl  $31, %edi
  andl  $40, %edi
  leal  60(%rdi), %eax

instead of
  testl %edi, %edi
  movl  $60, %ecx
  movl  $100, %eax
  cmovnsl %ecx, %eax

llvm-svn: 107866
2010-07-08 11:39:10 +00:00
Chris Lattner
bf009b527a Fix the second half of PR7437: scalarrepl wasn't preserving
address spaces when SRoA'ing memcpy's.

llvm-svn: 107846
2010-07-08 00:27:05 +00:00
Duncan Sands
eb15d2084a Rename "Release" builds as "Release+Asserts"; rename "Release-Asserts"
builds to "Release".  The default build is unchanged (optimization on,
assertions on), however it is now called Release+Asserts.  The intent
is that future LLVM releases released via llvm.org will be Release builds
in the new sense, i.e. will have assertions disabled (currently they have
assertions enabled, for a more than 20% slowdown).  This will bring them
in line with MacOS releases, which ship with assertions disabled.  It also
means that "Release" now means the same things in make and cmake builds:
cmake already disables assertions for "Release" builds AFAICS.

llvm-svn: 107758
2010-07-07 07:48:00 +00:00
Nick Lewycky
16490a3bf1 Detabify this file.
llvm-svn: 107637
2010-07-06 03:53:43 +00:00
Devang Patel
1c47157b66 MDString is already checked earlier.
llvm-svn: 107516
2010-07-02 21:13:23 +00:00
Dan Gohman
9d0f697ca8 Don't claim to preserve AliasAnalysis. First, this is doesn't actually
have any effect, and second, deleting stores can potentially invalidate
an AliasAnalysis, and there's currently no notification for this.

llvm-svn: 107496
2010-07-02 18:43:05 +00:00
Bill Wendling
90b6422f2f Implement the "linker_private_weak" linkage type. This will be used for
Objective-C metadata types which should be marked as "weak", but which the
linker will remove upon final linkage. However, this linkage isn't specific to
Objective-C.

For example, the "objc_msgSend_fixup_alloc" symbol is defined like this:

      .globl l_objc_msgSend_fixup_alloc
      .weak_definition l_objc_msgSend_fixup_alloc
      .section __DATA, __objc_msgrefs, coalesced
      .align 3
l_objc_msgSend_fixup_alloc:
       .quad   _objc_msgSend_fixup
       .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".

Currently only supported on Darwin platforms.

llvm-svn: 107433
2010-07-01 21:55:59 +00:00
Devang Patel
a0fa700f3c Debugging infomration is encoded in llvm IR using metadata. This is designed
such a way that debug info for symbols preserved even if symbols are
optimized away by the optimizer. 

Add new special pass to remove debug info for such symbols.

llvm-svn: 107416
2010-07-01 19:49:20 +00:00
Devang Patel
fa499484c0 If a named mdnode is removed then mark module as changed.
llvm-svn: 107412
2010-07-01 18:27:46 +00:00
Jim Grosbach
f5a790e251 lowerinvoke needs to handle aggregate function args like sjlj eh does.
llvm-svn: 107335
2010-06-30 22:22:59 +00:00
Devang Patel
7962349c46 Remove all debug info related named mdnodes.
llvm-svn: 107323
2010-06-30 21:29:00 +00:00
Gabor Greif
016e24ce4c use ArgOperand API
llvm-svn: 107278
2010-06-30 12:42:43 +00:00
Gabor Greif
c0b5e221cb use ArgOperand API
llvm-svn: 107277
2010-06-30 12:40:35 +00:00
Gabor Greif
e315b7db00 use getArgOperand (corrected by CallInst::ArgOffset) instead of getOperand
llvm-svn: 107275
2010-06-30 12:38:26 +00:00
Gabor Greif
ed5dd5198a use getArgOperand (corrected by CallInst::ArgOffset) instead of getOperand
llvm-svn: 107273
2010-06-30 09:19:23 +00:00
Gabor Greif
8719d680ef use getNumArgOperands instead of getNumOperands
llvm-svn: 107272
2010-06-30 09:17:53 +00:00
Gabor Greif
b6e59f4a82 use getArgOperand instead of getOperand
llvm-svn: 107271
2010-06-30 09:16:16 +00:00
Gabor Greif
abeab11279 use getArgOperand instead of getOperand
llvm-svn: 107270
2010-06-30 09:15:28 +00:00
Gabor Greif
a77e545e60 use getArgOperand instead of getOperand
llvm-svn: 107269
2010-06-30 09:14:26 +00:00
Bill Wendling
59ef9bcc6d Revert r107205 and r107207.
llvm-svn: 107215
2010-06-29 22:34:52 +00:00
Bill Wendling
05a4c0b1f2 Introducing the "linker_weak" linkage type. This will be used for Objective-C
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:

       .globl l_objc_msgSend_fixup_alloc
       .weak_definition l_objc_msgSend_fixup_alloc
       .section __DATA, __objc_msgrefs, coalesced
       .align 3
l_objc_msgSend_fixup_alloc:
        .quad   _objc_msgSend_fixup
        .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".

llvm-svn: 107205
2010-06-29 21:24:00 +00:00
Duncan Sands
2f42c8716a Return Changed. This required setting Changed if dbg metadata
is stripped off.  Currently set unconditionally, since the API
does not provide a way of working out if anything was actually
stripped off.

llvm-svn: 107142
2010-06-29 14:52:10 +00:00
Gabor Greif
cc251773b5 use ArgOperand API
llvm-svn: 107017
2010-06-28 16:50:57 +00:00
Gabor Greif
a96e0eb251 use ArgOperand API
llvm-svn: 107016
2010-06-28 16:45:00 +00:00