oota-llvm.git
14 years agosplit instcombine of compares (visit[FI]Cmp) out to
Chris Lattner [Mon, 4 Jan 2010 07:37:31 +0000 (07:37 +0000)]
split instcombine of compares (visit[FI]Cmp) out to
a new InstCombineCompares.cpp file.

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

14 years agoupdate cmakefile
Chris Lattner [Mon, 4 Jan 2010 07:19:55 +0000 (07:19 +0000)]
update cmakefile

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

14 years agomove the 'SimplifyDemandedFoo' methods out to their own file, cutting 1K lines out...
Chris Lattner [Mon, 4 Jan 2010 07:17:19 +0000 (07:17 +0000)]
move the 'SimplifyDemandedFoo' methods out to their own file, cutting 1K lines out of instcombine.cpp

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

14 years agoFix the Emacs mode string.
Mikhail Glushenkov [Mon, 4 Jan 2010 07:16:12 +0000 (07:16 +0000)]
Fix the Emacs mode string.

Also trailing whitespace & 80-col violations.

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

14 years agosplit the instcombine class definition out to a header shared
Chris Lattner [Mon, 4 Jan 2010 07:12:23 +0000 (07:12 +0000)]
split the instcombine class definition out to a header shared
among the instcombine library.

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

14 years agoremove a ton of unneeded LLVMContext stuff.
Chris Lattner [Mon, 4 Jan 2010 07:02:48 +0000 (07:02 +0000)]
remove a ton of unneeded LLVMContext stuff.

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

14 years agomove InstCombineWorklist out to its own header.
Chris Lattner [Mon, 4 Jan 2010 06:30:00 +0000 (06:30 +0000)]
move InstCombineWorklist out to its own header.

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

14 years agoforgot to svn add these.
Chris Lattner [Mon, 4 Jan 2010 06:28:20 +0000 (06:28 +0000)]
forgot to svn add these.

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

14 years agomove instcombine to its own library, it's past time.
Chris Lattner [Mon, 4 Jan 2010 06:23:24 +0000 (06:23 +0000)]
move instcombine to its own library, it's past time.

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

14 years agoimplement an instcombine xform needed by clang's codegen
Chris Lattner [Mon, 4 Jan 2010 06:03:59 +0000 (06:03 +0000)]
implement an instcombine xform needed by clang's codegen
on the example in PR4216.  This doesn't trigger in the testsuite,
so I'd really appreciate someone scrutinizing the logic for
correctness.

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

14 years agofix PR5930, allowing the asmprinter to emit difference between
Chris Lattner [Sun, 3 Jan 2010 18:33:18 +0000 (18:33 +0000)]
fix PR5930, allowing the asmprinter to emit difference between
two labels as a truncate.

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

14 years agoit isn't safe to speculative load from a malloc, it might have
Chris Lattner [Sun, 3 Jan 2010 18:14:24 +0000 (18:14 +0000)]
it isn't safe to speculative load from a malloc, it might have
returned null, and may not have been big enough in any case.
Thanks to Jay Foad for pointing this out!

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

14 years agoadd PR#
Chris Lattner [Sun, 3 Jan 2010 18:10:58 +0000 (18:10 +0000)]
add PR#

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

14 years agodifferences between two blockaddress's don't cause a
Chris Lattner [Sun, 3 Jan 2010 18:09:40 +0000 (18:09 +0000)]
differences between two blockaddress's don't cause a
global variable initializer to require relocations.

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

14 years agopull my debug hooks out, I'm done with this xform for now.
Chris Lattner [Sun, 3 Jan 2010 06:58:48 +0000 (06:58 +0000)]
pull my debug hooks out, I'm done with this xform for now.

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

14 years agoSmall cleanups, refactor some duplicated code into a single method. No
Nick Lewycky [Sun, 3 Jan 2010 04:39:07 +0000 (04:39 +0000)]
Small cleanups, refactor some duplicated code into a single method. No
functionality change.

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

14 years agogeneralize the previous transformation to handle indexing into
Chris Lattner [Sun, 3 Jan 2010 03:03:27 +0000 (03:03 +0000)]
generalize the previous transformation to handle indexing into
arrays of structs and other arrays, so long as all the subsequent
indexes are constants.  This triggers frequently for stuff like:

@divisions = internal constant [29 x [2 x i32]] [[2 x i32] zeroinitializer, [2 x i32] [i32 0, i32 1], [2 x i32] [i32 0, i32 2], [2 x i32] [i32 0, i32 1], [2 x i32] zeroinitializer, [2 x i32] [i32 0, i32 1], [2 x i32] [i32 0, i32 1], [2 x i32] [i32 0, i32 2], [2 x i32] [i32 0, i32 2], [2 x i32] zeroinitializer, [2 x i32] zeroinitializer, [2 x i32] zeroinitializer, [2 x i32] [i32 0, i32 2], [2 x i32] [i32 0, i32 1], [2 x i32] zeroinitializer, [2 x i32] [i32 1, i32 0], [2 x i32] [i32 1, i32 1], [2 x i32] [i32 1, i32 1], [2 x i32] [i32 1, i32 2], [2 x i32] [i32 1, i32 1], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 1, i32 2], [2 x i32] [i32 1, i32 2], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 1, i32 1], [2 x i32] [i32 1, i32 2], [2 x i32] [i32 1, i32 2]], align 32 ; <[29 x [2 x i32]]*> [#uses=50]

  %623 = getelementptr inbounds [29 x [2 x i32]]* @divisions, i64 0, i64 %619, i64 0 ; <i32*> [#uses=1]
   %684 = icmp eq i32 %683, 999

also for the "my_defs" table in 'gs', etc.

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

14 years agoCleanup.
Nick Lewycky [Sun, 3 Jan 2010 00:55:31 +0000 (00:55 +0000)]
Cleanup.

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

14 years agoteach instcombine to optimize idioms like A[i]&42 == 0. This
Chris Lattner [Sat, 2 Jan 2010 22:08:28 +0000 (22:08 +0000)]
teach instcombine to optimize idioms like A[i]&42 == 0.  This
occurs in 403.gcc in mode_mask_array, in safe-ctype.c (which
is copied in multiple apps) in _sch_istable, etc.

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

14 years agoTeach the table lookup optimization to generate range compares
Chris Lattner [Sat, 2 Jan 2010 21:50:18 +0000 (21:50 +0000)]
Teach the table lookup optimization to generate range compares
when a consequtive sequence of elements all satisfies the
predicate.  Like the double compare case, this generates better
code than the magic constant case and generalizes to more than
32/64 element array lookups.

Here are some examples where it triggers.  From 403.gcc, most
accesses to the rtx_class array are handled, e.g.:

@rtx_class = constant [153 x i8] c"xxxxxmmmmmmmmxxxxxxxxxxxxmxxxxxxiiixxxxxxxxxxxxxxxxxxxooxooooooxxoooooox3x2c21c2222ccc122222ccccaaaaaa<<<<<<<<<<<<<<<<<<111111111111bbooxxxxxxxxxxcc2211x", align 32 ; <[153 x i8]*> [#uses=547]
   %142 = icmp eq i8 %141, 105
@rtx_class = constant [153 x i8] c"xxxxxmmmmmmmmxxxxxxxxxxxxmxxxxxxiiixxxxxxxxxxxxxxxxxxxooxooooooxxoooooox3x2c21c2222ccc122222ccccaaaaaa<<<<<<<<<<<<<<<<<<111111111111bbooxxxxxxxxxxcc2211x", align 32 ; <[153 x i8]*> [#uses=543]
   %165 = icmp eq i8 %164, 60

Also, most of the 59-element arrays (mode_class/rid_to_yy, etc)
optimized before are actually range compares.  This lets 32-bit
machines optimize them.

400.perlbmk has stuff like this:

400.perlbmk: PL_regkind, even for 32-bit:
@PL_regkind = constant [62 x i8] c"\00\00\02\02\02\06\06\06\06\09\09\0B\0B\0D\0E\0E\0E\11\12\12\14\14\16\16\18\18\1A\1A\1C\1C\1E\1F !!!$$&'((((,-.///88886789:;8$", align 32 ; <[62 x i8]*> [#uses=4]
   %811 = icmp ne i8 %810, 33

@PL_utf8skip = constant [256 x i8] c"\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\03\03\03\03\03\03\03\03\03\03\03\03\03\03\03\03\04\04\04\04\04\04\04\04\05\05\05\05\06\06\07\0D", align 32 ; <[256 x i8]*> [#uses=94]
   %12 = icmp ult i8 %10, 2

etc.

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

14 years agotheoretically the negate we find could be in a different function, check
Chris Lattner [Sat, 2 Jan 2010 21:46:33 +0000 (21:46 +0000)]
theoretically the negate we find could be in a different function, check
for this case.

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

14 years agouse enums for the over/underdefined markers for clarity. Switch
Chris Lattner [Sat, 2 Jan 2010 20:20:33 +0000 (20:20 +0000)]
use enums for the over/underdefined markers for clarity.  Switch
to using -2/-3 instead of -1/-2 for a future xform.

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

14 years agoremove the random sampling framework, which is not maintained anymore.
Chris Lattner [Sat, 2 Jan 2010 20:07:03 +0000 (20:07 +0000)]
remove the random sampling framework, which is not maintained anymore.
If there is interest, it can be resurrected from SVN.  PR4912.

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

14 years agoFix logic error in previous commit. The != case needs to become an or, not an
Nick Lewycky [Sat, 2 Jan 2010 16:14:56 +0000 (16:14 +0000)]
Fix logic error in previous commit. The != case needs to become an or, not an
and.

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

14 years agoOptimize pointer comparison into the typesafe form, now that the backends will
Nick Lewycky [Sat, 2 Jan 2010 15:25:44 +0000 (15:25 +0000)]
Optimize pointer comparison into the typesafe form, now that the backends will
handle them efficiently. This is the opposite direction of the transformation
we used to have here.

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

14 years agoGeneralize the previous xform to handle cases where exactly
Chris Lattner [Sat, 2 Jan 2010 09:35:17 +0000 (09:35 +0000)]
Generalize the previous xform to handle cases where exactly
two elements match or don't match with two comparisons.  For
example, the testcase compiles into:

define i1 @test5(i32 %X) {
  %1 = icmp eq i32 %X, 2                          ; <i1> [#uses=1]
  %2 = icmp eq i32 %X, 7                          ; <i1> [#uses=1]
  %R = or i1 %1, %2                               ; <i1> [#uses=1]
  ret i1 %R
}

This generalizes the previous xforms when the array is larger than
64 elements (and this case matches) and generates better code for
cases where it overlaps with the magic bitshift case.

This generalizes more cases than you might expect.  For example,
400.perlbmk has:

@PL_utf8skip = constant [256 x i8] c"\01\01\01\...
%15 = icmp ult i8 %7, 7

403.gcc has:
@rid_to_yy = internal constant [114 x i16] [i16 259, i16 260, ...
%18 = icmp eq i16 %16, 295

and xalancbmk has a bunch of examples, such as
_ZN11xercesc_2_5L15gCombiningCharsE and _ZN11xercesc_2_5L10gBaseCharsE.

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

14 years agofix a miscompilation I introduced of cdecl with a late change.
Chris Lattner [Sat, 2 Jan 2010 09:22:13 +0000 (09:22 +0000)]
fix a miscompilation I introduced of cdecl with a late change.

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

14 years agoenhance the compare/load/index optimization to work on *any* load
Chris Lattner [Sat, 2 Jan 2010 08:56:52 +0000 (08:56 +0000)]
enhance the compare/load/index optimization to work on *any* load
from a global with 32/64 elements or less (depending on whether
i64 is native on the target), generating a bitshift idiom to
determine the result.  For example, on test4 we produce:

define i1 @test4(i32 %X) {
  %1 = lshr i32 933, %X                           ; <i32> [#uses=1]
  %2 = and i32 %1, 1                              ; <i32> [#uses=1]
  %R = icmp ne i32 %2, 0                          ; <i1> [#uses=1]
  ret i1 %R
}

This triggers in a number of interesting cases, for example, here's an
fp case:
@A.3255 = internal constant [4 x double] [double 4.100000e+00, double -3.900000e+00, double -1.000000e+00, double 1.000000e+00], align 32 ; <[4 x double]*> [#uses=7]
...
   %7 = fcmp olt double %3, 0.000000e+00

In this case we make the slen2_tab global dead, which is nice:
@slen2_tab = internal constant [16 x i32] [i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 1, i32 2, i32 3, i32 1, i32 2, i32 3, i32 2, i32 3], align 32 ; <[16 x i32]*> [#uses=1]
...
   %204 = icmp eq i32 %46, 0

Perl has a bunch of these, also on the 'Perl_regkind' array:
@Perl_yygindex = internal constant [51 x i16] [i16 0, i16 0, i16 0, i16 0, i16 374, i16 351, i16 0, i16 -12, i16 0, i16 946, i16 413, i16 -83, i16 0, i16 0, i16 0, i16 -311, i16 -13, i16 4007, i16 2893, i16 0, i16 0, i16 0, i16 0, i16 0, i16 372, i16 -8, i16 0, i16 0, i16 246, i16 -131, i16 43, i16 86, i16 208, i16 -45, i16 -169, i16 987, i16 0, i16 0, i16 0, i16 0, i16 308, i16 0, i16 -271, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0], align 32 ; <[51 x i16]*> [#uses=1]
...
  %1364 = icmp eq i16 %1361, 0

186.crafty really likes this on 64-bit machines, because it triggers on a bunch of globals like this:
@white_outpost = internal constant [64 x i8] c"\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\02\02\00\00\00\00\00\04\05\05\04\00\00\00\00\03\06\06\03\00\00\00\00\00\01\01\00\00\00\00\00\00\00\00\00\00\00", align 32 ; <[64 x i8]*> [#uses=2]

However the big winner is 403.gcc, which triggers hundreds of times, eliminating all the accesses to the 57-element arrays 'mode_class', mode_unit_size, mode_bitsize, regclass_map, etc.

go 64-bit machines :)

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

14 years agoForward -O0 to llvm-gcc.
Mikhail Glushenkov [Sat, 2 Jan 2010 08:27:23 +0000 (08:27 +0000)]
Forward -O0 to llvm-gcc.

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

14 years agoApparently, it is OK for -MT to be specified several times.
Mikhail Glushenkov [Sat, 2 Jan 2010 08:27:10 +0000 (08:27 +0000)]
Apparently, it is OK for -MT to be specified several times.

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

14 years agoenhance the previous optimization to work with fcmp in addition
Chris Lattner [Sat, 2 Jan 2010 08:20:51 +0000 (08:20 +0000)]
enhance the previous optimization to work with fcmp in addition
to icmp.

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

14 years agoTeach instcombine to fold compares of loads from constant
Chris Lattner [Sat, 2 Jan 2010 08:12:04 +0000 (08:12 +0000)]
Teach instcombine to fold compares of loads from constant
arrays with variable indices into a comparison of the index
with a constant.  The most common occurrence of this that
I see by far is stuff like:

if ("foobar"[i] == '\0') ...

which we compile into: if (i == 6), saving a load and
materialization of the global address.  This also exposes
loop trip count information to later passes in many cases.

This triggers hundreds of times in xalancbmk, which is where I first
noticed it, but it also triggers in many other apps.  Here are a few
interesting ones from various apps:

@must_be_connected_without = internal constant [8 x i8*] [i8* getelementptr inbounds ([3 x i8]* @.str64320, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8]* @.str27283, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8]* @.str71327, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8]* @.str72328, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8]* @.str18274, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8]* @.str11267, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8]* @.str32288, i64 0, i64 0), i8* null], align 32 ; <[8 x i8*]*> [#uses=2]
  %scevgep.i = getelementptr [8 x i8*]* @must_be_connected_without, i64 0, i64 %indvar.i ; <i8**> [#uses=1]
  %17 = load ...
  %18 = icmp eq i8* %17, null                     ; <i1> [#uses=1]
-> icmp eq i64 %indvar.i, 7

@yytable1095 = internal constant [84 x i8] c"\12\01(\05\06\07\08\09\0A\0B\0C\0D\0E1\0F\10\11266\1D: \10\11,-,0\03'\10\11B6\04\17&\18\1945\05\06\07\08\09\0A\0B\0C\0D\0E\1E\0F\10\11*\1A\1B\1C$3+>#%;<IJ=ADFEGH9KL\00\00\00C", align 32 ; <[84 x i8]*> [#uses=2]
  %57 = getelementptr inbounds [84 x i8]* @yytable1095, i64 0, i64 %56 ; <i8*> [#uses=1]
   %mode.0.in = getelementptr inbounds [9 x i32]* @mb_mode_table, i64 0, i64 %.pn ; <i32*> [#uses=1]
load ...
   %64 = icmp eq i8 %58, 4                         ; <i1> [#uses=1]
-> icmp eq i64 %.pn, 35             ; <i1> [#uses=0]

@gsm_DLB = internal constant [4 x i16] [i16 6554, i16 16384, i16 26214, i16 32767]
%scevgep.i = getelementptr [4 x i16]* @gsm_DLB, i64 0, i64 %indvar.i ; <i16*> [#uses=1]
%425 = load %scevgep.i
%426 = icmp eq i16 %425, -32768                 ; <i1> [#uses=0]
-> false

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

14 years agoconstant fold nasty constant expressions formed by llvm-gcc,
Chris Lattner [Sat, 2 Jan 2010 01:22:23 +0000 (01:22 +0000)]
constant fold nasty constant expressions formed by llvm-gcc,
wrapping up PR3351.

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

14 years agoremove the instcombine transformations that are inserting nasty
Chris Lattner [Sat, 2 Jan 2010 00:31:05 +0000 (00:31 +0000)]
remove the instcombine transformations that are inserting nasty
pointer to int casts that confuse later optimizations.  See PR3351
for details.

This improves but doesn't complete fix 483.xalancbmk because llvm-gcc
does this xform in GCC's "fold" routine as well.  Clang++ will do
better I guess.

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

14 years agoallow this to work on linux hosts.
Chris Lattner [Sat, 2 Jan 2010 00:22:15 +0000 (00:22 +0000)]
allow this to work on linux hosts.

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

14 years agoTeach codegen to handle:
Chris Lattner [Sat, 2 Jan 2010 00:00:03 +0000 (00:00 +0000)]
Teach codegen to handle:
 (X != null) | (Y != null) --> (X|Y) != 0
 (X == null) & (Y == null) --> (X|Y) == 0

so that instcombine can stop doing this for pointers.  This is part of PR3351,
which is a case where instcombine doing this for pointers (inserting ptrtoint)
is pessimizing code.

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

14 years agorename file.
Chris Lattner [Fri, 1 Jan 2010 23:55:04 +0000 (23:55 +0000)]
rename file.

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

14 years agowhitespace cleanup
Chris Lattner [Fri, 1 Jan 2010 23:37:34 +0000 (23:37 +0000)]
whitespace cleanup

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

14 years agoadd a simple instcombine xform, simplify another one to use hasAllZeroIndices()
Chris Lattner [Fri, 1 Jan 2010 23:09:08 +0000 (23:09 +0000)]
add a simple instcombine xform, simplify another one to use hasAllZeroIndices()
instead of hand rolling a loop.

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

14 years agogeneralize the pointer difference optimization to handle
Chris Lattner [Fri, 1 Jan 2010 22:42:29 +0000 (22:42 +0000)]
generalize the pointer difference optimization to handle
a constantexpr gep on the 'base' side of the expression.
This completes comment #4 in PR3351, which comes from
483.xalancbmk.

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

14 years agoteach instcombine to optimize pointer difference idioms involving constant
Chris Lattner [Fri, 1 Jan 2010 22:29:12 +0000 (22:29 +0000)]
teach instcombine to optimize pointer difference idioms involving constant
expressions.  This is a step towards comment #4 in PR3351.

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

14 years agouse 'match' to simplify some code.
Chris Lattner [Fri, 1 Jan 2010 22:12:03 +0000 (22:12 +0000)]
use 'match' to simplify some code.

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

14 years agoimplement the transform requested in PR5284
Chris Lattner [Fri, 1 Jan 2010 18:34:40 +0000 (18:34 +0000)]
implement the transform requested in PR5284

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

14 years agoFix a warning on gcc 4.4.
Mikhail Glushenkov [Fri, 1 Jan 2010 04:41:36 +0000 (04:41 +0000)]
Fix a warning on gcc 4.4.

SelectionDAGBuilder.cpp:4294: warning: suggest explicit braces to avoid
ambiguous â€˜else’

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

14 years agoTrailing whitespace, 80-col violations.
Mikhail Glushenkov [Fri, 1 Jan 2010 04:41:22 +0000 (04:41 +0000)]
Trailing whitespace, 80-col violations.

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

14 years agoMinor simplifactions.
Mikhail Glushenkov [Fri, 1 Jan 2010 04:41:10 +0000 (04:41 +0000)]
Minor simplifactions.

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

14 years agoTypo.
Mikhail Glushenkov [Fri, 1 Jan 2010 04:40:54 +0000 (04:40 +0000)]
Typo.

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

14 years agoMake CheckForSuperfluousOptions handle list form of 'switch_on' correctly.
Mikhail Glushenkov [Fri, 1 Jan 2010 03:51:02 +0000 (03:51 +0000)]
Make CheckForSuperfluousOptions handle list form of 'switch_on' correctly.

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

14 years agoMinor simplifications.
Mikhail Glushenkov [Fri, 1 Jan 2010 03:50:51 +0000 (03:50 +0000)]
Minor simplifications.

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

14 years agoBetter error message.
Mikhail Glushenkov [Fri, 1 Jan 2010 03:50:34 +0000 (03:50 +0000)]
Better error message.

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

14 years agoTeach codegen to lower llvm.powi to an efficient (but not optimal)
Chris Lattner [Fri, 1 Jan 2010 03:32:16 +0000 (03:32 +0000)]
Teach codegen to lower llvm.powi to an efficient (but not optimal)
multiply sequence when the power is a constant integer.  Before, our
codegen for std::pow(.., int) always turned into a libcall, which was
really inefficient.

This should also make many gfortran programs happier I'd imagine.

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

14 years agoMake this more likely to generate a libcall.
Chris Lattner [Fri, 1 Jan 2010 03:26:51 +0000 (03:26 +0000)]
Make this more likely to generate a libcall.

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

14 years agoadd missing line.
Chris Lattner [Fri, 1 Jan 2010 01:54:08 +0000 (01:54 +0000)]
add missing line.

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

14 years agoadd a few trivial instcombines for llvm.powi.
Chris Lattner [Fri, 1 Jan 2010 01:52:15 +0000 (01:52 +0000)]
add a few trivial instcombines for llvm.powi.

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

14 years agoupdate this. To take the next step, llvm.powi should be generalized to work
Chris Lattner [Fri, 1 Jan 2010 01:29:26 +0000 (01:29 +0000)]
update this.  To take the next step, llvm.powi should be generalized to work
on integers as well and codegen should lower them to branch trees.

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

14 years agoWhen factoring multiply expressions across adds, factor both
Chris Lattner [Fri, 1 Jan 2010 01:13:15 +0000 (01:13 +0000)]
When factoring multiply expressions across adds, factor both
positive and negative forms of constants together.  This
allows us to compile:

int foo(int x, int y) {
    return (x-y) + (x-y) + (x-y);
}

into:

_foo:                                                       ## @foo
subl %esi, %edi
leal (%rdi,%rdi,2), %eax
ret

instead of (where the 3 and -3 were not factored):

_foo:
        imull   $-3, 8(%esp), %ecx
        imull   $3, 4(%esp), %eax
        addl    %ecx, %eax
        ret

this started out as:
    movl    12(%ebp), %ecx
    imull   $3, 8(%ebp), %eax
    subl    %ecx, %eax
    subl    %ecx, %eax
    subl    %ecx, %eax
    ret

This comes from PR5359.

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

14 years agotest case we alredy get right.
Chris Lattner [Fri, 1 Jan 2010 00:50:00 +0000 (00:50 +0000)]
test case we alredy get right.

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

14 years agoRemove old header.
Ted Kremenek [Fri, 1 Jan 2010 00:04:49 +0000 (00:04 +0000)]
Remove old header.

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

14 years agoclean up some comments.
Chris Lattner [Fri, 1 Jan 2010 00:04:26 +0000 (00:04 +0000)]
clean up some comments.

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

14 years agoswitch from std::map to DenseMap for rank data structures.
Chris Lattner [Fri, 1 Jan 2010 00:01:34 +0000 (00:01 +0000)]
switch from std::map to DenseMap for rank data structures.

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

14 years agoRemove derelict serialization code.
Ted Kremenek [Thu, 31 Dec 2009 23:40:17 +0000 (23:40 +0000)]
Remove derelict serialization code.

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

14 years agoreuse negates where possible instead of always creating them from scratch.
Chris Lattner [Thu, 31 Dec 2009 20:34:32 +0000 (20:34 +0000)]
reuse negates where possible instead of always creating them from scratch.
This allows us to optimize test12 into:

define i32 @test12(i32 %X) {
  %factor = mul i32 %X, -3                        ; <i32> [#uses=1]
  %Z = add i32 %factor, 6                         ; <i32> [#uses=1]
  ret i32 %Z
}

instead of:

define i32 @test12(i32 %X) {
  %Y = sub i32 6, %X                              ; <i32> [#uses=1]
  %C = sub i32 %Y, %X                             ; <i32> [#uses=1]
  %Z = sub i32 %C, %X                             ; <i32> [#uses=1]
  ret i32 %Z
}

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

14 years agowe don't need a smallptrset to detect duplicates, the values are
Chris Lattner [Thu, 31 Dec 2009 19:49:01 +0000 (19:49 +0000)]
we don't need a smallptrset to detect duplicates, the values are
sorted, so we can just do a linear scan.

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

14 years agomake reassociate more careful about not leaving around dead mul's
Chris Lattner [Thu, 31 Dec 2009 19:34:45 +0000 (19:34 +0000)]
make reassociate more careful about not leaving around dead mul's

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

14 years agoremove debug
Chris Lattner [Thu, 31 Dec 2009 19:25:19 +0000 (19:25 +0000)]
remove debug

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

14 years agoteach reassociate to factor x+x+x -> x*3. While I'm at it,
Chris Lattner [Thu, 31 Dec 2009 19:24:52 +0000 (19:24 +0000)]
teach reassociate to factor x+x+x -> x*3.  While I'm at it,
fix RemoveDeadBinaryOp to actually do something.

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

14 years agochange reassociate to use SmallVector for its key datastructures
Chris Lattner [Thu, 31 Dec 2009 18:40:32 +0000 (18:40 +0000)]
change reassociate to use SmallVector for its key datastructures
instead of std::vector.

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

14 years agochange an if to an assert, fix comment.
Chris Lattner [Thu, 31 Dec 2009 18:18:46 +0000 (18:18 +0000)]
change an if to an assert, fix comment.

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

14 years agomove the rest of the add optimization code out to OptimizeAdd,
Chris Lattner [Thu, 31 Dec 2009 18:17:13 +0000 (18:17 +0000)]
move the rest of the add optimization code out to OptimizeAdd,
improve some comments, simplify a bit of code.

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

14 years agofactor statistic updating better.
Chris Lattner [Thu, 31 Dec 2009 17:51:05 +0000 (17:51 +0000)]
factor statistic updating better.

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

14 years agoSilence compiler warning.
Benjamin Kramer [Thu, 31 Dec 2009 16:27:13 +0000 (16:27 +0000)]
Silence compiler warning.

warning: comparison between signed and unsigned integer expressions

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

14 years agosimple fix for an incorrect factoring which causes a
Chris Lattner [Thu, 31 Dec 2009 08:33:49 +0000 (08:33 +0000)]
simple fix for an incorrect factoring which causes a
miscompilation, PR5458.

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

14 years agomerge some more tests in.
Chris Lattner [Thu, 31 Dec 2009 08:32:22 +0000 (08:32 +0000)]
merge some more tests in.

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

14 years agofilecheckize
Chris Lattner [Thu, 31 Dec 2009 08:29:56 +0000 (08:29 +0000)]
filecheckize

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

14 years agofix refactoro
Chris Lattner [Thu, 31 Dec 2009 08:23:09 +0000 (08:23 +0000)]
fix refactoro

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

14 years agofactor code out into helper functions.
Chris Lattner [Thu, 31 Dec 2009 07:59:34 +0000 (07:59 +0000)]
factor code out into helper functions.

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

14 years agoswitch some std::vector's to smallvector. Reduce nesting.
Chris Lattner [Thu, 31 Dec 2009 07:48:51 +0000 (07:48 +0000)]
switch some std::vector's to smallvector.  Reduce nesting.

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

14 years agouse more modern datastructures.
Chris Lattner [Thu, 31 Dec 2009 07:33:14 +0000 (07:33 +0000)]
use more modern datastructures.

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

14 years agoclean up -debug output.
Chris Lattner [Thu, 31 Dec 2009 07:17:37 +0000 (07:17 +0000)]
clean up -debug output.

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

14 years agoDocument the edit-distance algorithm used in StringRef, switch it over
Douglas Gregor [Thu, 31 Dec 2009 04:24:34 +0000 (04:24 +0000)]
Document the edit-distance algorithm used in StringRef, switch it over
to SmallVector, and add a unit test.

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

14 years agothis #include is ok.
Chris Lattner [Thu, 31 Dec 2009 03:02:42 +0000 (03:02 +0000)]
this #include is ok.

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

14 years agofix Analysis/DebugInfo.h to not include Metadata.h. Do this
Chris Lattner [Thu, 31 Dec 2009 03:02:08 +0000 (03:02 +0000)]
fix Analysis/DebugInfo.h to not include Metadata.h.  Do this
by moving one method out of line and eliminating redundant checks
from other methods.

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

14 years agoadd some basic named MD tests.
Chris Lattner [Thu, 31 Dec 2009 03:00:49 +0000 (03:00 +0000)]
add some basic named MD tests.

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

14 years agouse early exits to reduce indentation.
Chris Lattner [Thu, 31 Dec 2009 02:33:14 +0000 (02:33 +0000)]
use early exits to reduce indentation.

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

14 years agoeliminate another copy of the mdnode printing logic, simplify the
Chris Lattner [Thu, 31 Dec 2009 02:31:59 +0000 (02:31 +0000)]
eliminate another copy of the mdnode printing logic, simplify the
one that remains.

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

14 years agorandom tidying for MDNode printing.
Chris Lattner [Thu, 31 Dec 2009 02:27:30 +0000 (02:27 +0000)]
random tidying for MDNode printing.

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

14 years agoeliminate a bunch of useless forwarding functions with one caller.
Chris Lattner [Thu, 31 Dec 2009 02:23:35 +0000 (02:23 +0000)]
eliminate a bunch of useless forwarding functions with one caller.

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

14 years agomake mdnMap type safe, rename accessors for consistency with the rest of llvm.
Chris Lattner [Thu, 31 Dec 2009 02:20:11 +0000 (02:20 +0000)]
make mdnMap type safe, rename accessors for consistency with the rest of llvm.

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

14 years agometadata can't be a global var initializer.
Chris Lattner [Thu, 31 Dec 2009 02:15:45 +0000 (02:15 +0000)]
metadata can't be a global var initializer.

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

14 years agosimplify mdnode printing logic. Now N->dump() only
Chris Lattner [Thu, 31 Dec 2009 02:13:35 +0000 (02:13 +0000)]
simplify mdnode printing logic.  Now N->dump() only
dumps one node instead of all of them.

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

14 years agodon't unittest mdnode printing, we have disassembler tests for this.
Chris Lattner [Thu, 31 Dec 2009 02:12:13 +0000 (02:12 +0000)]
don't unittest mdnode printing, we have disassembler tests for this.

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

14 years agounify two copies of the NamedMDNode printing code.
Chris Lattner [Thu, 31 Dec 2009 01:54:05 +0000 (01:54 +0000)]
unify two copies of the NamedMDNode printing code.

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

14 years agofix printing of function-local metadata to print all the operands of the
Chris Lattner [Thu, 31 Dec 2009 01:44:44 +0000 (01:44 +0000)]
fix printing of function-local metadata to print all the operands of the
mdnode, not just operand 0 over and over.

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

14 years agosimplify printing of mdstring and Argument.
Chris Lattner [Thu, 31 Dec 2009 01:41:14 +0000 (01:41 +0000)]
simplify printing of mdstring and Argument.

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

14 years agosimplify asmprinting of NamedMDNode
Chris Lattner [Thu, 31 Dec 2009 01:36:50 +0000 (01:36 +0000)]
simplify asmprinting of NamedMDNode

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

14 years agoRemove #include of metadata.h from intrinsicinst.h. The only
Chris Lattner [Thu, 31 Dec 2009 01:32:41 +0000 (01:32 +0000)]
Remove #include of metadata.h from intrinsicinst.h.  The only
method that needs it (DbgValueInst::getValue) has been moved out
of line.

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

14 years agorename "elements" of metadata to "operands". "Elements" are
Chris Lattner [Thu, 31 Dec 2009 01:22:29 +0000 (01:22 +0000)]
rename "elements" of metadata to "operands".  "Elements" are
things that occur in types.  "operands" are things that occur
in values.

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

14 years agoOptimize MDNode to coallocate the operand list immediately
Chris Lattner [Thu, 31 Dec 2009 01:05:46 +0000 (01:05 +0000)]
Optimize MDNode to coallocate the operand list immediately
after the MDNode in memory.  This eliminates the operands
pointer and saves a new[] per node.

Note that the code in DIDerivedType::replaceAllUsesWith is wrong
and quite scary.  A MDNode should not be RAUW'd with something
else: this changes all uses of the mdnode, which may not be debug
info related!  Debug info should use something non-mdnode for
declarations.

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

14 years agotidy
Chris Lattner [Thu, 31 Dec 2009 00:51:46 +0000 (00:51 +0000)]
tidy

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

14 years agodo not bother reuniquing mdnodes whose operands drop to null. Doing
Chris Lattner [Wed, 30 Dec 2009 21:42:11 +0000 (21:42 +0000)]
do not bother reuniquing mdnodes whose operands drop to null.  Doing
so can be a huge performance issue when tearing down modules and mdnodes
are not guaranteed to be unique anyway.  This speeds up:
$ time ~/llvm/Release/bin/clang gcc.c -w -S -g

from 72 to 35s, where gcc.c is from:
http://people.csail.mit.edu/smcc/projects/single-file-programs/

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