1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 21:42:54 +02:00
Commit Graph

14467 Commits

Author SHA1 Message Date
Chris Lattner
1ad393b186 Remove debugging printout
Instcombine (setcc (truncate X), C1).

This occurs THOUSANDS of times in many benchmarks.  Particularlly common
seem to be things like (seteq (cast bool X to int), int 0)

This turns it into (seteq bool %X, false), which then becomes (not %X).

llvm-svn: 16567
2004-09-29 03:09:18 +00:00
Nate Begeman
dc50ea0d82 To go along with sabre's improved InstCombining, improve recognition of
integers that we can use as immediate values in instructions.

Example from yacr2:
-       lis r10, -1
-       ori r10, r10, 65535
-       add r28, r28, r10
+       addi r28, r28, -1
        addi r7, r7, 1
        addi r9, r9, 1
        b .LBB_main_9   ; loopentry.1.i214

llvm-svn: 16566
2004-09-29 02:35:05 +00:00
Reid Spencer
3d434887d4 Improve validity checking of windows path names and fix file creation
problems.

Patch contributed by Jeff Cohen. Thanks Jeff!

llvm-svn: 16565
2004-09-29 00:01:17 +00:00
Reid Spencer
6a072ccbb0 Use llvm::sys::Path to destroy the file.
Patch contributed by Jeff Cohen. Thanks Jeff!

llvm-svn: 16564
2004-09-28 23:58:03 +00:00
Reid Spencer
e2e85bd507 Win32 implementation of TimeValue::now().
Patch contributed by Jeff Cohen. Thanks Jeff!

llvm-svn: 16563
2004-09-28 23:56:20 +00:00
Reid Spencer
9ef91b3145 FreeBSD implementation of the TimeValue::now() method.
Patch kindly contributed by Jeff Cohen. Thanks Jeff!

llvm-svn: 16562
2004-09-28 23:54:12 +00:00
Chris Lattner
0046cec2a2 Fold (X setcc C1) | (X setcc C2)
This implements or.ll:test1[89]

llvm-svn: 16561
2004-09-28 22:33:08 +00:00
Chris Lattner
6cc64c11a5 New testcase
llvm-svn: 16560
2004-09-28 22:31:49 +00:00
Chris Lattner
d3cfa5aba5 Fold (and (setcc X, C1), (setcc X, C2))
This is important for several reasons:

1. Benchmarks have lots of code that looks like this (perlbmk in particular):

  %tmp.2.i = setne int %tmp.0.i, 128              ; <bool> [#uses=1]
  %tmp.6343 = seteq int %tmp.0.i, 1               ; <bool> [#uses=1]
  %tmp.63 = and bool %tmp.2.i, %tmp.6343          ; <bool> [#uses=1]

   we now fold away the setne, a clear improvement.

2. In the more important cases, such as (X >= 10) & (X < 20), we now produce
   smaller code: (X-10) < 10.

3. Perhaps the nicest effect of this patch is that it really helps out the
   code generators.  In particular, for a 'range test' like the above,
   instead of generating this on X86 (the difference on PPC is even more
   pronounced):

        cmp %EAX, 50
        setge %CL
        cmp %EAX, 100
        setl %AL
        and %CL, %AL
        cmp %CL, 0

   we now generate this:

        add %EAX, -50
        cmp %EAX, 50

   Furthermore, this causes setcc's to be folded into branches more often.

These combinations trigger dozens of times in the spec benchmarks, particularly
in 176.gcc, 186.crafty, 253.perlbmk, 254.gap, & 099.go.

llvm-svn: 16559
2004-09-28 21:48:02 +00:00
Misha Brukman
71196a4005 * Add `deplibs' keyword for specifying a list of dependent libraries
* Convert tabs to spaces

llvm-svn: 16558
2004-09-28 21:46:18 +00:00
Misha Brukman
4cfc2f589e Add `deplibs' keyword for specifying a list of dependent libraries
llvm-svn: 16557
2004-09-28 21:45:54 +00:00
Chris Lattner
67eea81390 New testcases
llvm-svn: 16556
2004-09-28 21:39:35 +00:00
Nate Begeman
18d4f04e0a Add support for the isLoad and isStore flags, needed by the instruction scheduler
llvm-svn: 16555
2004-09-28 21:29:00 +00:00
Nate Begeman
bbf7945b61 Add support for the isLoad and isStore flags, needed by the instruction scheduler
llvm-svn: 16554
2004-09-28 21:01:45 +00:00
Chris Lattner
7a941d7691 Turn the hasDelaySlot flag into the M_DELAY_SLOT_FLAG
llvm-svn: 16553
2004-09-28 18:38:01 +00:00
Chris Lattner
89a80a46f1 Be consistent with our naming
llvm-svn: 16552
2004-09-28 18:37:00 +00:00
Chris Lattner
bd2d966db6 Capture delay slot info
llvm-svn: 16551
2004-09-28 18:34:14 +00:00
Chris Lattner
c92b280e0d Capture information about whether the target instructions have delay slots
llvm-svn: 16550
2004-09-28 18:33:50 +00:00
Chris Lattner
d7b9ededb4 Implement X / C1 / C2 folding
Implement (setcc (shl X, C1), C2) folding.

The second one occurs several dozen times in spec.  The first was added
just in case.  :)

These are tested by shift.ll:test2[12], and div.ll:test5

llvm-svn: 16549
2004-09-28 18:22:15 +00:00
Chris Lattner
8b76cd2373 New testcase
llvm-svn: 16548
2004-09-28 18:21:01 +00:00
Chris Lattner
737f3b92da New testcases
llvm-svn: 16547
2004-09-28 18:18:35 +00:00
Chris Lattner
a4e0ed87bc shl is always zero extending, so always use a zero extending shift right.
This latent bug was exposed by recent changes, and is tested as:
llvm/test/Regression/Transforms/InstCombine/2004-09-28-BadShiftAndSetCC.llx

llvm-svn: 16546
2004-09-28 17:54:07 +00:00
Chris Lattner
f9ba821a89 New testcase for a latent bug in instcombine that I have been chasing for
1.5 days :(

llvm-svn: 16545
2004-09-28 17:50:05 +00:00
Misha Brukman
1006a8465c * InstructionReader.cpp was absorbed into Reader.cpp
* Wrap at 80 cols

llvm-svn: 16543
2004-09-28 16:58:12 +00:00
Misha Brukman
a31e841080 Fix doxygen comment
llvm-svn: 16542
2004-09-28 16:57:46 +00:00
Brian Gaeke
c07c76aa75 Touch output files before reading or writing them, so that they are
always guaranteed to exist. This fixes PR444. Thanks to Alkis
for reporting the bug and testing the patch.
AddRecord used to return a big list, but that return value was never
used. So now it doesn't return anything.
Create the WebDir if it does not exist.
Fix a typo in a comment.

llvm-svn: 16541
2004-09-28 16:04:00 +00:00
John Criswell
11855532c2 Corrected spelling of Makefile variable, thereby re-enabling profile
builds for projects.

llvm-svn: 16540
2004-09-28 14:52:58 +00:00
Alkis Evlogimenos
4f5920aaef Add includes and use std:: for standard library calls to make code
compile on windows. This patch was contributed by Paolo Invernizzi.

llvm-svn: 16539
2004-09-28 14:42:44 +00:00
Chris Lattner
cfba8b1306 Bug fixed
llvm-svn: 16538
2004-09-28 03:45:22 +00:00
Chris Lattner
6f7dd6c766 Testcase for LLVM PR445
llvm-svn: 16537
2004-09-28 03:36:39 +00:00
Alkis Evlogimenos
192cc2e3aa Since we use alloca now make sure we include the proper headers for it.
llvm-svn: 16536
2004-09-28 02:53:15 +00:00
Alkis Evlogimenos
a10f96d417 Use alloca instead of a C99 style array. This should fix the
compilation problem in windows.

llvm-svn: 16535
2004-09-28 02:47:38 +00:00
Alkis Evlogimenos
7ff66b2884 Pull assignment out of for loop conditional in order for this to
compile under windows. Patch contributed by Paolo Invernizzi!

llvm-svn: 16534
2004-09-28 02:40:37 +00:00
Alkis Evlogimenos
95cc7f115a Fix includes. Patch contributed by Paolo Invernizzi!
llvm-svn: 16533
2004-09-28 02:38:58 +00:00
Chris Lattner
f6c32e46e4 New testcase that crashes the C++ FE, encountered while working on PR445
llvm-svn: 16532
2004-09-28 02:29:40 +00:00
Alkis Evlogimenos
adea49eec0 Use class instead of struct for defining classes. This unbreaks the
build on windows. Patch contributed by Paolo Invernizzi!

llvm-svn: 16531
2004-09-28 01:59:17 +00:00
Chris Lattner
daa0a295e7 Patch contributed by Patrick Meredith:
added notes on the fact that the current implementation uses
sbyte* for va_list.  Updated all occurances of valist to va_list (it was
inconsistant and find/replace is so easy ;-) ).  Added <...> around all
occurances of va_list in the intrinsic functions to match the vaarg and
vanext instructions and to further show that va_list is a variable type.

llvm-svn: 16530
2004-09-27 21:51:25 +00:00
Misha Brukman
123eda8575 Fix grammar.
llvm-svn: 16529
2004-09-27 20:35:59 +00:00
Chris Lattner
f953091075 Fix two bugs: one where a condition was mistakenly swapped, and another
where we folded (X & 254) -> X < 1 instead of X < 2.  These problems were
latent problems exposed by the latest patch.

llvm-svn: 16528
2004-09-27 19:29:18 +00:00
Chris Lattner
fe5261ee15 New testcase
llvm-svn: 16527
2004-09-27 19:25:20 +00:00
Misha Brukman
88a1e0aba4 SparcV8 int regs are not only 32-bits in width, but they are 32-bit aligned!
llvm-svn: 16526
2004-09-27 18:22:18 +00:00
Chris Lattner
047daf6261 The system ranlib on darwin occasionally adds two extra newlines to the
end of files, breaking the CFE build.  As a gross hack around this,
ignore any trailing garbage on bytecode files.  Thanks to Brian for digging
in and identifying the problem.

llvm-svn: 16525
2004-09-27 16:59:06 +00:00
Chris Lattner
ca55a0ff6e Hrm, if there is an error loading a file, try printing a message so the
user knows that...

llvm-svn: 16524
2004-09-27 16:41:01 +00:00
Chris Lattner
25a0e82d62 Testcases for rev 250 of InstructionCombining.cpp
llvm-svn: 16522
2004-09-27 16:21:26 +00:00
Chris Lattner
a715ffded3 Fold: (setcc (shr X, ShAmt), CI), where 'cc' is eq or ne. This xform
triggers often, for example:

6x in povray, 1x in gzip, 279x in gcc, 1x in crafty, 8x in eon, 11x in perlbmk,
362x in gap, 4x in vortex, 14 in m88ksim, 211x in 126.gcc, 1x in compress,
11x in ijpeg, and 4x in 147.vortex.

llvm-svn: 16521
2004-09-27 16:18:50 +00:00
Alkis Evlogimenos
404855c98b Improve warning
llvm-svn: 16520
2004-09-27 07:35:19 +00:00
Nate Begeman
921a44443d Correct some BuildMI arguments for the upcoming simple scheduler
llvm-svn: 16519
2004-09-27 05:08:17 +00:00
Misha Brukman
84e238e5ed Fix the copy-pasto that Brian noticed: V8 int regs are 32-bits wide, not 64.
llvm-svn: 16518
2004-09-26 21:07:43 +00:00
Reid Spencer
c3f7948472 Add some missing #includes
llvm-svn: 16517
2004-09-25 16:00:07 +00:00
Reid Spencer
26de3ccc82 Qualify Path with sys:: namespace so this file compiles.
llvm-svn: 16516
2004-09-25 15:59:41 +00:00