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

16611 Commits

Author SHA1 Message Date
Chris Lattner
3ef32da6c3 Add a new method.
llvm-svn: 19249
2005-01-02 02:38:18 +00:00
Chris Lattner
95f1e628ed Add support for SETNPr to lower to memory form.
llvm-svn: 19248
2005-01-02 02:37:46 +00:00
Chris Lattner
d6bc921fa8 Implement the convertToThreeAddress method, add support for inverting JP/JNP
branches.

llvm-svn: 19247
2005-01-02 02:37:07 +00:00
Chris Lattner
0d6f03e52b Two changes here:
1. Add new instructions for checking parity flags: JP, JNP, SETP, SETNP.
2. Set the isCommutable and isPromotableTo3Address bits on several
   instructions.

llvm-svn: 19246
2005-01-02 02:35:46 +00:00
Chris Lattner
c1feb0c8fe Make the 2-address instruction lowering pass smarter in two ways:
1. If we are two-addressing a commutable instruction and the LHS is not the
   last use of the variable, see if the instruction is the last use of the
   RHS.  If so, commute the instruction, allowing us to avoid a
   register-register copy in many cases for common instructions like ADD, OR,
   AND, etc on X86.
2. If #1 doesn't hold, and if this is an instruction that also existing in
   3-address form, promote the instruction to a 3-address instruction to
   avoid the register-register copy.  We can do this for several common
   instructions in X86, including ADDrr, INC, DEC, etc.

This patch implements test/Regression/CodeGen/X86/commute-two-addr.ll,
overlap-add.ll, and overlap-shift.ll when I check in the X86 support for it.

llvm-svn: 19245
2005-01-02 02:34:12 +00:00
Chris Lattner
2cfe515d2b Add several testcases for new optimizations in the code generator.
llvm-svn: 19244
2005-01-02 02:30:04 +00:00
Chris Lattner
2aef5783b0 Expose isConvertibleToThreeAddress and isCommutable bits to the code generator.
llvm-svn: 19243
2005-01-02 02:29:04 +00:00
Chris Lattner
a008165daa Add some bits that can be set on instructions. Renumber existing bits so
they are dense.  Add a virtual method that targets can choose to implement.

llvm-svn: 19242
2005-01-02 02:28:31 +00:00
Chris Lattner
cc26e332b3 Add some bits that can be set for instructions.
llvm-svn: 19241
2005-01-02 02:27:48 +00:00
Reid Spencer
37f31d4aa1 Make printing a warning message optional in CheckBytecodeOutputToConsole.
llvm-svn: 19240
2005-01-02 00:10:03 +00:00
Reid Spencer
fb233f641d Prevent output of bytecode to std::cout unless the --force flag is given.
This prevents bytecode splats with usage like: cat file.ll | llvm-as -

llvm-svn: 19239
2005-01-02 00:08:46 +00:00
Reid Spencer
7d4a2f180f Move the code for printing out a warning about bytecode output to a console
into lib/Support so it can be used with other tools.

llvm-svn: 19238
2005-01-01 23:57:01 +00:00
Reid Spencer
2d73c4d556 Implement a function to print a warning if bytecode output is to be sent to
a terminal/console.

llvm-svn: 19237
2005-01-01 23:56:20 +00:00
Jeff Cohen
7466dd37d0 Add functions for determining if the stdin/out/err is connected to a
console or not.

llvm-svn: 19236
2005-01-01 22:54:05 +00:00
Jeff Cohen
11901e559d Add llvm-link, Linker projects to Visual Studio.
llvm-svn: 19235
2005-01-01 22:32:26 +00:00
Jeff Cohen
5899433ea2 Add missing header files to projects.
llvm-svn: 19234
2005-01-01 22:30:19 +00:00
Reid Spencer
ed2f874a8d Add functions for determining if the stdin/out/err is connected to a
console or not.

llvm-svn: 19233
2005-01-01 22:29:26 +00:00
Jeff Cohen
d3e59f9ac0 Fix typo 'ompress' => 'compress'.
llvm-svn: 19232
2005-01-01 22:10:32 +00:00
Jeff Cohen
bba2cc9d6a Add llvm-ranlib project to Visual Studio.
llvm-svn: 19231
2005-01-01 22:05:56 +00:00
Jeff Cohen
26e5b107ec Add llvm-ar project to Visual Studio.
llvm-svn: 19230
2005-01-01 22:00:28 +00:00
Jeff Cohen
35edbe7f00 Add -v option to bison.
llvm-svn: 19229
2005-01-01 21:35:39 +00:00
Jeff Cohen
748f1529e2 Add missing file SystemUtils.cpp to Support project.
llvm-svn: 19228
2005-01-01 21:34:18 +00:00
Jeff Cohen
8e751d4f87 Add llvm-as project to Visual Studio
llvm-svn: 19227
2005-01-01 20:51:41 +00:00
Jeff Cohen
6df3da7f26 Add llvm-dis project to Visual Studio
llvm-svn: 19226
2005-01-01 20:18:03 +00:00
Jeff Cohen
1d6b491438 Put executables into a single directory
llvm-svn: 19225
2005-01-01 19:37:14 +00:00
Jeff Cohen
1d174640fe Fix bountiful sources of VC++ 'possible loss of data' warnings
llvm-svn: 19224
2005-01-01 18:58:23 +00:00
Jeff Cohen
c1f4827e96 Improve TableGen dependencies
Move TableGen generated files out of the src tree
Add descriptions to the custom build steps

llvm-svn: 19223
2005-01-01 18:17:40 +00:00
Reid Spencer
560327d430 Add HAVE_SBRK
llvm-svn: 19222
2005-01-01 18:16:16 +00:00
Reid Spencer
15619e49d4 Ignore some files
llvm-svn: 19221
2005-01-01 18:14:18 +00:00
Chris Lattner
14d51ed06a This is a bulk commit that implements the following primary improvements:
* We can now fold cast instructions into select instructions that
    have at least one constant operand.
  * We now optimize expressions more aggressively based on bits that are
    known to be zero.  These optimizations occur a lot in code that uses
    bitfields even in simple ways.
  * We now turn more cast-cast sequences into AND instructions.  Before we
    would only do this if it if all types were unsigned.  Now only the
    middle type needs to be unsigned (guaranteeing a zero extend).
  * We transform sign extensions into zero extensions in several cases.

This corresponds to these test/Regression/Transforms/InstCombine testcases:
  2004-11-22-Missed-and-fold.ll
  and.ll: test28-29
  cast.ll: test21-24
  and-or-and.ll
  cast-cast-to-and.ll
  zeroext-and-reduce.ll

llvm-svn: 19220
2005-01-01 16:22:27 +00:00
Chris Lattner
5bd69087d9 New testcases that we should combine.
llvm-svn: 19219
2005-01-01 16:14:46 +00:00
Chris Lattner
2162178f04 New testcase for common bitfield manipulation instruction sequences.
llvm-svn: 19218
2005-01-01 16:14:18 +00:00
Chris Lattner
0e0786263d Add a bunch of tests for cases that should be eliminated.
llvm-svn: 19217
2005-01-01 16:13:43 +00:00
Chris Lattner
d0151b3b33 Add a bunch of tests for ANDs that should be eliminated.
llvm-svn: 19216
2005-01-01 16:13:19 +00:00
Chris Lattner
6b064417be This now works.
llvm-svn: 19215
2005-01-01 16:12:52 +00:00
Chris Lattner
ad63a0d6a4 Fix a FIXME: Select instructions on longs were miscompiled.
While we're at it, improve codegen of select instructions.  For this
testcase:

int %test(bool %C, int %A, int %B) {
  %D = select bool %C, int %A, int %B
  ret int %D
}

We used to generate this code:

_test:
        cmpwi cr0, r3, 0
        bne .LBB_test_2 ;
.LBB_test_1:    ;
        b .LBB_test_3   ;
.LBB_test_2:    ;
        or r5, r4, r4
.LBB_test_3:    ;
        or r3, r5, r5
        blr

Now we emit:

_test:
        cmpwi cr0, r3, 0
        bne .LBB_test_2 ;
.LBB_test_1:    ;
        or r4, r5, r5
.LBB_test_2:    ;
        or r3, r4, r4
        blr

-Chris

llvm-svn: 19214
2005-01-01 16:10:12 +00:00
Chris Lattner
ccd0d44133 Substantially improve the code generated by non-folded setcc instructions.
In particular, instead of compiling this:

bool %test(int %A, int %B) {
  %C = setlt int %A, %B
  ret bool %C
}

to this:

test:
        save %sp, -96, %sp
        subcc %i0, %i1, %g0
        bl .LBBtest_1   !
        nop
        ba .LBBtest_2   !
        nop
.LBBtest_1:     !
        or %g0, 1, %i0
        ba .LBBtest_3   !
        nop
.LBBtest_2:     !
        or %g0, 0, %i0
        ba .LBBtest_3   !
        nop
.LBBtest_3:     !
        restore %g0, %g0, %g0
        retl
        nop

We now compile it to this:

test:
        save %sp, -96, %sp
        subcc %i0, %i1, %g0
        or %g0, 1, %i0
        bl .LBBtest_2   !
        nop
.LBBtest_1:     !
        or %g0, %g0, %i0
.LBBtest_2:     !
        restore %g0, %g0, %g0
        retl
        nop

llvm-svn: 19213
2005-01-01 16:06:57 +00:00
Chris Lattner
5fff877f74 Implement SimplifyCFG/DeadSetCC.ll
SimplifyCFG is one of those passes that we use for final cleanup: it should
not rely on other passes to clean up its garbage.  This fixes the "why are
trivially dead setcc's in the output of gccas" problem.

llvm-svn: 19212
2005-01-01 16:02:12 +00:00
Chris Lattner
fcc2ae9a85 Add new test to make sure simplifycfg doesn't leave around trivially
dead instructions.

llvm-svn: 19211
2005-01-01 16:00:56 +00:00
Chris Lattner
043ec8bb61 Allow getZeroExtend and getSignExtend to work with boolean inputs.
llvm-svn: 19210
2005-01-01 15:59:57 +00:00
Chris Lattner
70d0a6155b Add a useful accessor
llvm-svn: 19209
2005-01-01 15:58:55 +00:00
Chris Lattner
7f004e59d8 Add two helper functions.
llvm-svn: 19208
2005-01-01 15:58:41 +00:00
Reid Spencer
3ab011eb95 Update to autoconf 2.59 standards.
llvm-svn: 19207
2005-01-01 09:26:55 +00:00
Reid Spencer
41ac6a5ebb Correct the conditional test for non-portable tools so that it will
correctly omit them for non-Unix operating systems.

llvm-svn: 19206
2004-12-31 22:56:14 +00:00
Reid Spencer
734b581c5b For PR351:
Make LLVM_ON_UNIX and LLVM_ON_WIN32 available in the makefiles

llvm-svn: 19205
2004-12-31 22:54:28 +00:00
Reid Spencer
c820ef21d2 Describe both objdir==srcdir and objdir!=srcdir methods of building LLVM
libraries and tools. Thanks to Henrik Bach for this suggestion.

llvm-svn: 19204
2004-12-31 19:48:59 +00:00
Jeff Cohen
a46121ed32 Where do these tabs keep coming from???
llvm-svn: 19203
2004-12-31 19:03:31 +00:00
Jeff Cohen
9b439381c3 Mostly cleanup, but also some bug fixes, for win32/Path.cpp
llvm-svn: 19202
2004-12-31 19:01:08 +00:00
Reid Spencer
7b4b2407c1 Fix a compilation error for the case where mallinfo() is not available.
llvm-svn: 19201
2004-12-31 05:53:27 +00:00
Reid Spencer
e5034a35e0 For PR351:
* lib/System depends on sbrk(3), make sure we check for it.

llvm-svn: 19200
2004-12-31 05:49:15 +00:00