Commit Graph

27114 Commits

Author SHA1 Message Date
Chris Lattner 28f17f45be Use branch reversal to do stuff like this:
call L_strcmp$stub
        testl %eax, %eax
-       jne LBB26_208   #cond_true6020
-       jmp LBB26_227   #bb7119
+       je LBB26_227    #bb7119
 LBB26_208:     #cond_true6020
        movl $l31_str14, 4(%esp)

        testl %eax, %eax
-       jne LBB26_704   #cond_true13042
-       jmp LBB26_713   #bb13151
+       je LBB26_713    #bb13151
 LBB26_704:     #cond_true13042
        movl $_str52, 4(%esp)

        cmpl 76(%ecx), %eax
-       jge LBB26_1628  #cond_false63.i.i
-       jmp LBB26_1769  #_Z8makeGridP13mrSurfaceListidiidd.exit.i
+       jl LBB26_1769   #_Z8makeGridP13mrSurfaceListidiidd.exit.i
 LBB26_1628:    #cond_false63.i.i
        movl $0, 48964(%esp)

llvm-svn: 31100
2006-10-21 05:54:00 +00:00
Chris Lattner 3a897f31fa Implement support for branch condition reversal.
llvm-svn: 31099
2006-10-21 05:52:40 +00:00
Chris Lattner 3ca52185af Transform code like:
jle FOO
  jmp BAR
BAR:

into:

  jle FOO
BAR:

... whoa!

llvm-svn: 31098
2006-10-21 05:43:30 +00:00
Chris Lattner d881660366 Simplify code, no functionality change
llvm-svn: 31097
2006-10-21 05:42:09 +00:00
Chris Lattner 94e04442eb implement support for inserting a cond branch
llvm-svn: 31096
2006-10-21 05:36:13 +00:00
Chris Lattner 6fca75ec05 allow insertion of a conditional branch with fall-through
llvm-svn: 31095
2006-10-21 05:34:23 +00:00
Chris Lattner 4fe01c42ca Three changes:
1. Remove a bunch of ifdef'd code.
2. When a block just contains an uncond branch, change all blocks branching
   to it to jump to the destination instead.
3. If branch analysis tells us some edges in the machinecfg are not actually
   possible, remove them.

#2 triggers a suprisingly large number of times.

llvm-svn: 31094
2006-10-21 05:08:28 +00:00
Chris Lattner 20e75d4635 update assert message
llvm-svn: 31093
2006-10-21 04:42:29 +00:00
Chris Lattner 60c9d4dc76 Add an experimental cross-jumping implementation.
This is currently disabled by default and limited in several ways, but does
have a positive effect.

llvm-svn: 31090
2006-10-21 00:47:49 +00:00
Chris Lattner 96fd2b28f1 typo
llvm-svn: 31089
2006-10-20 22:44:45 +00:00
Chris Lattner 33f5af09e4 implement MachineOperand::isIdenticalTo
llvm-svn: 31088
2006-10-20 22:39:59 +00:00
Chris Lattner 0f4db78dfe add isIdenticalTo method to machineinstr/operand.
llvm-svn: 31087
2006-10-20 22:39:36 +00:00
Chris Lattner af1222c1a7 llvm-extract should remove module-level asm
llvm-svn: 31086
2006-10-20 21:35:41 +00:00
Chris Lattner 8366b874a9 bugfix
llvm-svn: 31074
2006-10-20 20:44:34 +00:00
Chris Lattner 319c86fd38 Fix an ugly problem in SCCP. This fixes Benchmarks/Misc-C++/mandel-text.cpp
llvm-svn: 31073
2006-10-20 20:19:08 +00:00
Chris Lattner 5dee3b2526 Fix miscompilation of MallocBench/espresso which code review pointed out
but apparently didn't make it into the final patch.

llvm-svn: 31070
2006-10-20 18:20:21 +00:00
Bill Wendling c5c11a8070 Changed the pattern matching so that it will hopefully work on Linux.
llvm-svn: 31069
2006-10-20 18:15:24 +00:00
Devang Patel 4f4d3ec985 Test case for
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061016/038780.html

llvm-svn: 31068
2006-10-20 18:06:37 +00:00
Chris Lattner c5ab6ce613 Make flag and chain edges visually distinguishable from value edges in DOT
output.

llvm-svn: 31067
2006-10-20 18:06:09 +00:00
Chris Lattner 819cb9ad61 add method
llvm-svn: 31066
2006-10-20 18:00:03 +00:00
Chris Lattner c0fb567e23 Implement branch analysis/xform hooks required by the branch folding pass.
llvm-svn: 31065
2006-10-20 17:42:20 +00:00
Reid Spencer a91e4be84f Fix a comment to be accurate.
llvm-svn: 31064
2006-10-20 07:24:55 +00:00
Reid Spencer e0fc4dfc22 For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.

llvm-svn: 31063
2006-10-20 07:07:24 +00:00
Devang Patel 5d417e35bc While creating mask, use 1ULL instead of 1.
llvm-svn: 31062
2006-10-20 01:16:56 +00:00
Chris Lattner b8b11599dd Fix SimplifyCFG/2006-10-19-UncondDiv.ll by disabling a bad xform.
llvm-svn: 31061
2006-10-20 00:42:07 +00:00
Chris Lattner 51e9632ea5 new testcase for PR957
llvm-svn: 31060
2006-10-20 00:41:31 +00:00
Chris Lattner 23dd1f6325 add a method to determine whether evaluation of a constant can trap.
llvm-svn: 31059
2006-10-20 00:27:06 +00:00
Bill Wendling b5d19927c9 Testcase for P926
llvm-svn: 31058
2006-10-19 23:21:59 +00:00
Bill Wendling be96e1cd09 Partially in response to PR926: insert the newly created machine basic
blocks into the basic block list when lowering the switch inst. into a
binary tree of if-then statements. This allows the "visitSwitchCase" func
to allow for fall-through behavior.

llvm-svn: 31057
2006-10-19 21:46:38 +00:00
Devang Patel 5d6df959e3 It is OK to remove extra cast if operation is EQ/NE even though source
and destination sign may not match but other conditions are met.

llvm-svn: 31056
2006-10-19 20:59:13 +00:00
Devang Patel 88afd00d1d Typo Typo.
llvm-svn: 31055
2006-10-19 19:21:36 +00:00
Devang Patel 472530d9fc Typo.
llvm-svn: 31054
2006-10-19 19:05:38 +00:00
Devang Patel b42aef4925 Fix bug in PR454 resolution. Added new test case.
This fixes llvmAsmParser.cpp miscompile by llvm on PowerPC Darwin.

llvm-svn: 31053
2006-10-19 18:54:08 +00:00
Rafael Espindola 336d62e99a use Pat to implement extloadi8 and extloadi16
llvm-svn: 31052
2006-10-19 17:05:03 +00:00
Reid Spencer ebd21a425a 80 cols fix.
llvm-svn: 31050
2006-10-19 15:24:04 +00:00
Rafael Espindola f8274c0318 implement undef
llvm-svn: 31049
2006-10-19 13:45:00 +00:00
Rafael Espindola ea67b973c2 print common symbols
llvm-svn: 31048
2006-10-19 13:30:40 +00:00
Rafael Espindola ff62819e2f implement extloadi8 and extloadi16
llvm-svn: 31047
2006-10-19 12:45:04 +00:00
Rafael Espindola 3c563c5072 expand SIGN_EXTEND_INREG
llvm-svn: 31046
2006-10-19 12:06:50 +00:00
Rafael Espindola b260306625 expand brind so that we don't have to implement jump tables right now
llvm-svn: 31045
2006-10-19 10:56:43 +00:00
Reid Spencer 309e03aea2 Beef up the output from DiffFilesWithTolerance by setting the error code
to describe the difference being reported. This assists with understanding
differences an llvm-test and should help with bugpoint too.

llvm-svn: 31044
2006-10-18 20:23:52 +00:00
Reid Spencer 8f0acfbe6a Add llvm.spec, a generated file.
llvm-svn: 31041
2006-10-18 19:23:56 +00:00
Jim Laskey 55e4dcad36 Add option for controlling inclusion of global AA.
llvm-svn: 31040
2006-10-18 19:08:31 +00:00
Chris Lattner f4aeff00c2 fit in 80 cols
llvm-svn: 31039
2006-10-18 18:26:48 +00:00
Chris Lattner 35a1471046 add a note
llvm-svn: 31038
2006-10-18 17:04:09 +00:00
Rafael Espindola bad440742e add blx
llvm-svn: 31037
2006-10-18 16:21:43 +00:00
Rafael Espindola 01dd97a8aa add isTerminatortto b and bcond
llvm-svn: 31036
2006-10-18 16:20:57 +00:00
Jim Laskey a15b0ebb5e Use global info for alias analysis.
llvm-svn: 31035
2006-10-18 12:29:57 +00:00
Rafael Espindola b21e8d2e12 implement CallingConv::Fast as CallingConv::C
llvm-svn: 31034
2006-10-18 12:03:07 +00:00
Anton Korobeynikov 24b7ac303c Fixed mingw\cygwin linkonce linkage once again.
Added workaround for linker bug with linkonce sections.
Changed sections prefix to allow linker merge them
(PE loader doesn't like too much long-named sections :) )
All of this unbreaks libstdc++ on mingw32 allowing (small)
programs to be compiled, linked and run.

llvm-svn: 31033
2006-10-18 09:12:29 +00:00