Commit Graph

16857 Commits

Author SHA1 Message Date
Chris Lattner
7ff1ca4cd0 This is no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19259 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 22:50:00 +00:00
Chris Lattner
4be483baa4 Testcase for PR494
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19258 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 21:11:11 +00:00
Chris Lattner
71dbefed4e xfail these tests, whcih require more info in the code generator to implement
correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19257 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 19:01:33 +00:00
Reid Spencer
325a87e3fd Avoid use of -fomit-frame-pointer on FreeBSD platforms. It causes thrown
exceptions to abort() in cases where it should not.

Many thanks to Duraid Madina for doing the heavy lifting on the analysis
of this problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19256 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 17:43:20 +00:00
Reid Spencer
4a1e5c09bb Quote the PATH variable value just in case it has spaces in it (like on
Cygwin).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19255 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 09:45:54 +00:00
Reid Spencer
d6b1f5fee6 Correct the case of a #include directory name, just in case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19254 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 09:45:04 +00:00
Jeff Cohen
2ee430cc3c Cleanup some Visual Studio project dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19253 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 04:44:36 +00:00
Jeff Cohen
40296bdf27 Eliminate the use of the global variable hack in the X86 target that was used
to get Visual Studio to link in X86.lib to the executables that need it.  There
is another way of doing it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19252 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 04:23:12 +00:00
Chris Lattner
5aee0b97aa Disable 2->3 address promotion of add and inc instructions to LEA's. In
addition to being three address, LEA's don't set the flags.

This fixes 186.crafty.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19251 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 04:18:17 +00:00
Chris Lattner
bbdfaf8ec7 Check in an old test that never made it into CVS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19250 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 02:46:29 +00:00
Chris Lattner
5dd350defd Add a new method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19249 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 02:38:18 +00:00
Chris Lattner
eb96ec52ff Add support for SETNPr to lower to memory form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19248 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 02:37:46 +00:00
Chris Lattner
bcea4d6f28 Implement the convertToThreeAddress method, add support for inverting JP/JNP
branches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19247 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 02:37:07 +00:00
Chris Lattner
cc65beeb39 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19246 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 02:35:46 +00:00
Chris Lattner
cfa0f2edd3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19245 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 02:34:12 +00:00
Chris Lattner
ae37c2a543 Add several testcases for new optimizations in the code generator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19244 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 02:30:04 +00:00
Chris Lattner
aad75aa1a2 Expose isConvertibleToThreeAddress and isCommutable bits to the code generator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19243 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 02:29:04 +00:00
Chris Lattner
15f63ad2e5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19242 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 02:28:31 +00:00
Chris Lattner
273f2280f2 Add some bits that can be set for instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19241 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 02:27:48 +00:00
Reid Spencer
52b50a64ec Make printing a warning message optional in CheckBytecodeOutputToConsole.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19240 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 00:10:03 +00:00
Reid Spencer
b687c0c218 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 -


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19239 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 00:08:46 +00:00
Reid Spencer
5737913c46 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19238 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 23:57:01 +00:00
Reid Spencer
436f23ebf5 Implement a function to print a warning if bytecode output is to be sent to
a terminal/console.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19237 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 23:56:20 +00:00
Jeff Cohen
c6dffe0a5b Add functions for determining if the stdin/out/err is connected to a
console or not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19236 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 22:54:05 +00:00
Jeff Cohen
b63cfccd20 Add llvm-link, Linker projects to Visual Studio.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19235 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 22:32:26 +00:00
Jeff Cohen
c201755cb1 Add missing header files to projects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19234 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 22:30:19 +00:00
Reid Spencer
a01aade75d Add functions for determining if the stdin/out/err is connected to a
console or not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19233 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 22:29:26 +00:00
Jeff Cohen
7109ce8258 Fix typo 'ompress' => 'compress'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19232 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 22:10:32 +00:00
Jeff Cohen
8cde0339b9 Add llvm-ranlib project to Visual Studio.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19231 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 22:05:56 +00:00
Jeff Cohen
a9eaac7758 Add llvm-ar project to Visual Studio.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19230 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 22:00:28 +00:00
Jeff Cohen
094cfdf36b Add -v option to bison.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19229 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 21:35:39 +00:00
Jeff Cohen
41ca0b171d Add missing file SystemUtils.cpp to Support project.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19228 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 21:34:18 +00:00
Jeff Cohen
184d84b07d Add llvm-as project to Visual Studio
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19227 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 20:51:41 +00:00
Jeff Cohen
f80c516c58 Add llvm-dis project to Visual Studio
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19226 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 20:18:03 +00:00
Jeff Cohen
ae7b071d7a Put executables into a single directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19225 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 19:37:14 +00:00
Jeff Cohen
00dcbaa6e5 Fix bountiful sources of VC++ 'possible loss of data' warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19224 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 18:58:23 +00:00
Jeff Cohen
0f7745f2e5 Improve TableGen dependencies
Move TableGen generated files out of the src tree
Add descriptions to the custom build steps


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19223 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 18:17:40 +00:00
Reid Spencer
9d9c19cf96 Add HAVE_SBRK
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19222 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 18:16:16 +00:00
Reid Spencer
90b3b7162a Ignore some files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19221 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 18:14:18 +00:00
Chris Lattner
6e7ba45460 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19220 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 16:22:27 +00:00
Chris Lattner
0f75849116 New testcases that we should combine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19219 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 16:14:46 +00:00
Chris Lattner
095b51ee36 New testcase for common bitfield manipulation instruction sequences.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19218 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 16:14:18 +00:00
Chris Lattner
296fcbaf2c Add a bunch of tests for cases that should be eliminated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19217 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 16:13:43 +00:00
Chris Lattner
e768ff2cdc Add a bunch of tests for ANDs that should be eliminated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19216 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 16:13:19 +00:00
Chris Lattner
05b402ce9f This now works.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19215 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 16:12:52 +00:00
Chris Lattner
6dec0b09d5 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19214 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 16:10:12 +00:00
Chris Lattner
e7f96c515e 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19213 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 16:06:57 +00:00
Chris Lattner
13b2f764c0 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19212 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 16:02:12 +00:00
Chris Lattner
72a406eb14 Add new test to make sure simplifycfg doesn't leave around trivially
dead instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19211 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 16:00:56 +00:00
Chris Lattner
f5ac6c27ac Allow getZeroExtend and getSignExtend to work with boolean inputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19210 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 15:59:57 +00:00