oota-llvm.git
20 years agoAlign case statements.
Alkis Evlogimenos [Tue, 17 Feb 2004 15:50:41 +0000 (15:50 +0000)]
Align case statements.

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

20 years agoAdd TEST and XCHG memory operand support.
Alkis Evlogimenos [Tue, 17 Feb 2004 15:48:42 +0000 (15:48 +0000)]
Add TEST and XCHG memory operand support.

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

20 years agoAdd OR and XOR memory operand support.
Alkis Evlogimenos [Tue, 17 Feb 2004 15:33:14 +0000 (15:33 +0000)]
Add OR and XOR memory operand support.

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

20 years agoPeephole optimize SUBmi{16,32} into SUBmi{16,32}b when immediate is 8
Alkis Evlogimenos [Tue, 17 Feb 2004 15:14:29 +0000 (15:14 +0000)]
Peephole optimize SUBmi{16,32} into SUBmi{16,32}b when immediate is 8
bits wide.

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

20 years agoADDmi{16,32} should be in the next case statement.
Alkis Evlogimenos [Tue, 17 Feb 2004 15:10:11 +0000 (15:10 +0000)]
ADDmi{16,32} should be in the next case statement.

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

20 years agoAdd memory operand folding support for MUL, DIV, IDIV, NEG, NOT,
Alkis Evlogimenos [Tue, 17 Feb 2004 09:14:23 +0000 (09:14 +0000)]
Add memory operand folding support for MUL, DIV, IDIV, NEG, NOT,
MOVSX, and MOVZX.

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

20 years agoAdd memory operand folding for CMP{rm,mr,mi}{8,16,32}, INCm{8,16,32}
Alkis Evlogimenos [Tue, 17 Feb 2004 08:49:20 +0000 (08:49 +0000)]
Add memory operand folding for CMP{rm,mr,mi}{8,16,32}, INCm{8,16,32}
and DECm{8,16,32} instructions.

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

20 years agoAdd CMP{rm,mr,mi}{8,16,32}, INCm{8,16,32} and DECm{8,16,32} instructions.
Alkis Evlogimenos [Tue, 17 Feb 2004 08:49:00 +0000 (08:49 +0000)]
Add CMP{rm,mr,mi}{8,16,32}, INCm{8,16,32} and DECm{8,16,32} instructions.

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

20 years agoAdd SUB{rm,mr,mi}{8,16,32} instructions.
Alkis Evlogimenos [Tue, 17 Feb 2004 08:17:40 +0000 (08:17 +0000)]
Add SUB{rm,mr,mi}{8,16,32} instructions.

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

20 years agoAdd support to the local allocator for fusing spill code into the instructions
Chris Lattner [Tue, 17 Feb 2004 08:09:40 +0000 (08:09 +0000)]
Add support to the local allocator for fusing spill code into the instructions
that need them.  This is very useful on CISCy targets like the X86 because it
reduces the total spill pressure, and makes better use of it's (large)
instruction set.  Though the X86 backend doesn't know how to rewrite many
instructions yet, this already makes a substantial difference on 176.gcc for
example:

Before:
Time:
   8.0099 ( 31.2%)   0.0100 ( 12.5%)   8.0199 ( 31.2%)   7.7186 ( 30.0%)  Local Register Allocator

Code quality:
734559 asm-printer           - Number of machine instrs printed
111395 ra-local              - Number of registers reloaded
 79902 ra-local              - Number of registers spilled
231554 x86-peephole          - Number of peephole optimization performed

After:
Time:
   7.8700 ( 30.6%)   0.0099 ( 19.9%)   7.8800 ( 30.6%)   7.7892 ( 30.2%)  Local Register Allocator
Code quality:
733083 asm-printer           - Number of machine instrs printed
  2379 ra-local              - Number of reloads fused into instructions
109046 ra-local              - Number of registers reloaded
 79881 ra-local              - Number of registers spilled
230658 x86-peephole          - Number of peephole optimization performed

So by fusing 2300 instructions, we reduced the  static number of instructions
by 1500, and reduces the number of peepholes (and thus the work) by about 900.
This also clearly reduces the number of reload/spill instructions that are
emitted.

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

20 years agoAdd support for folding memory operands for ADC, SBB and SUB instructions.
Alkis Evlogimenos [Tue, 17 Feb 2004 08:08:51 +0000 (08:08 +0000)]
Add support for folding memory operands for ADC, SBB and SUB instructions.

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

20 years agoAdd support for ADC{rm.mr}32 and SBB{rm,mr}32.
Alkis Evlogimenos [Tue, 17 Feb 2004 08:06:31 +0000 (08:06 +0000)]
Add support for ADC{rm.mr}32 and SBB{rm,mr}32.

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

20 years agoAdd a (hidden) option to print instructions that fail to fuse. It's looking
Chris Lattner [Tue, 17 Feb 2004 08:03:47 +0000 (08:03 +0000)]
Add a (hidden) option to print instructions that fail to fuse.  It's looking
like compares and test's would be the next huge win...

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

20 years agoAdd support for folding memory operands in MOVri{8,16,32} instructions.
Alkis Evlogimenos [Tue, 17 Feb 2004 07:47:20 +0000 (07:47 +0000)]
Add support for folding memory operands in MOVri{8,16,32} instructions.

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

20 years agoExpand the repertoire of the forms we can print and encode.
Chris Lattner [Tue, 17 Feb 2004 07:40:44 +0000 (07:40 +0000)]
Expand the repertoire of the forms we can print and encode.

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

20 years agoDisable this peephole for now. We can't keep track of the fact that the immediate...
Chris Lattner [Tue, 17 Feb 2004 07:36:32 +0000 (07:36 +0000)]
Disable this peephole for now.  We can't keep track of the fact that the immediate is 8 bits,
but the memory reference is full sized.

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

20 years agoFix a bug in my previous refactoring change... arg!
Chris Lattner [Tue, 17 Feb 2004 07:02:17 +0000 (07:02 +0000)]
Fix a bug in my previous refactoring change... arg!

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

20 years agoThe CBE is now in llc, not llvm-dis
Chris Lattner [Tue, 17 Feb 2004 06:40:51 +0000 (06:40 +0000)]
The CBE is now in llc, not llvm-dis

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

20 years agoThe C backend is no longer in llvm-dis, it's in llc
Chris Lattner [Tue, 17 Feb 2004 06:40:06 +0000 (06:40 +0000)]
The C backend is no longer in llvm-dis, it's in llc

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

20 years agoThe CBE is no longer in llvm-dis
Chris Lattner [Tue, 17 Feb 2004 06:39:48 +0000 (06:39 +0000)]
The CBE is no longer in llvm-dis

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

20 years agoAdd an option to disable spill fusing in the X86 backend
Chris Lattner [Tue, 17 Feb 2004 06:30:34 +0000 (06:30 +0000)]
Add an option to disable spill fusing in the X86 backend

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

20 years agoFix the mneumonics for the mov instructions to have the source and destination
Chris Lattner [Tue, 17 Feb 2004 06:28:19 +0000 (06:28 +0000)]
Fix the mneumonics for the mov instructions to have the source and destination
order in the correct sense!! Arg!

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

20 years agoFix the last crimes against nature that used the 'ir' ordering to use the
Chris Lattner [Tue, 17 Feb 2004 06:24:02 +0000 (06:24 +0000)]
Fix the last crimes against nature that used the 'ir' ordering to use the
'ri' ordering instead... no it's not possible to store a register into an
immediate!

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

20 years agoGRRR. Move instructions have swapped the order of the r/m operands.
Chris Lattner [Tue, 17 Feb 2004 06:20:20 +0000 (06:20 +0000)]
GRRR.  Move instructions have swapped the order of the r/m operands.

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

20 years agoRename MOVi[mr] instructions to MOV[rm]i
Chris Lattner [Tue, 17 Feb 2004 06:16:44 +0000 (06:16 +0000)]
Rename MOVi[mr] instructions to MOV[rm]i

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

20 years agoWhoops, got my cases swapped.
Chris Lattner [Tue, 17 Feb 2004 06:02:15 +0000 (06:02 +0000)]
Whoops, got my cases swapped.

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

20 years agoChange to match the newer, simpler, interface
Chris Lattner [Tue, 17 Feb 2004 05:54:57 +0000 (05:54 +0000)]
Change to match the newer, simpler, interface

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

20 years agoSimplify and document the new interface
Chris Lattner [Tue, 17 Feb 2004 05:54:26 +0000 (05:54 +0000)]
Simplify and document the new interface

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

20 years agoAdd support for folding memory operands into AND and IMUL's
Chris Lattner [Tue, 17 Feb 2004 05:46:06 +0000 (05:46 +0000)]
Add support for folding memory operands into AND and IMUL's

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

20 years agoScrunchify code, by adding helpers. No functionality changes.
Chris Lattner [Tue, 17 Feb 2004 05:35:13 +0000 (05:35 +0000)]
Scrunchify code, by adding helpers.  No functionality changes.

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

20 years agoAdd mem forms of AND instructions
Chris Lattner [Tue, 17 Feb 2004 05:25:50 +0000 (05:25 +0000)]
Add mem forms of AND instructions

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

20 years agoAdd LiveIntervals::Interval::empty() member function.
Alkis Evlogimenos [Tue, 17 Feb 2004 05:14:37 +0000 (05:14 +0000)]
Add LiveIntervals::Interval::empty() member function.

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

20 years agoAdd API to check and fold memory operands into instructions.
Alkis Evlogimenos [Tue, 17 Feb 2004 04:33:18 +0000 (04:33 +0000)]
Add API to check and fold memory operands into instructions.

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

20 years agoRename the IMULri* instructions to IMULrri, as they are actually three address
Chris Lattner [Tue, 17 Feb 2004 04:26:43 +0000 (04:26 +0000)]
Rename the IMULri* instructions to IMULrri, as they are actually three address
instructions.  Add forms of these instructions that read from memory

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

20 years agoOnce we have a way to fold spill code reloads into instructions, we have a way to...
Chris Lattner [Tue, 17 Feb 2004 04:08:37 +0000 (04:08 +0000)]
Once we have a way to fold spill code reloads into instructions, we have a way to use it.  :)

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

20 years agoFix spilled interval update. It was too conservative.
Alkis Evlogimenos [Tue, 17 Feb 2004 04:04:20 +0000 (04:04 +0000)]
Fix spilled interval update. It was too conservative.

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

20 years agoRefactor code a bit. No functionality changes, though the comment hints at things...
Chris Lattner [Tue, 17 Feb 2004 03:57:19 +0000 (03:57 +0000)]
Refactor code a bit.  No functionality changes, though the comment hints at things to come.

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

20 years agoAdjust to recent changes
Chris Lattner [Tue, 17 Feb 2004 03:03:47 +0000 (03:03 +0000)]
Adjust to recent changes

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

20 years agoAdd two missing pieces from last checkin
Chris Lattner [Tue, 17 Feb 2004 03:03:36 +0000 (03:03 +0000)]
Add two missing pieces from last checkin

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

20 years agoRearrange code to eliminate warnings
Chris Lattner [Tue, 17 Feb 2004 02:58:36 +0000 (02:58 +0000)]
Rearrange code to eliminate warnings

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

20 years agoAdd peephole optimizations for ADD [MEM], IMM8 instructions.
Alkis Evlogimenos [Mon, 16 Feb 2004 23:50:18 +0000 (23:50 +0000)]
Add peephole optimizations for ADD [MEM], IMM8 instructions.

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

20 years agoAdd two more variants of add. Update comments.
Alkis Evlogimenos [Mon, 16 Feb 2004 23:48:42 +0000 (23:48 +0000)]
Add two more variants of add. Update comments.

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

20 years agoPreemptive additions for the MallocBench tests.
John Criswell [Mon, 16 Feb 2004 23:32:26 +0000 (23:32 +0000)]
Preemptive additions for the MallocBench tests.

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

20 years agoOnly spit out warning for functions that take pointers, not for sin and the like
Chris Lattner [Mon, 16 Feb 2004 22:57:19 +0000 (22:57 +0000)]
Only spit out warning for functions that take pointers, not for sin and the like
Add more special case handling for stdio functions.  I feel dirty, how about you?

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

20 years agoMove the folding of gep null, 0, 0, 0 to a place where it can be shared and
Chris Lattner [Mon, 16 Feb 2004 20:46:13 +0000 (20:46 +0000)]
Move the folding of gep null, 0, 0, 0 to a place where it can be shared and
enjoyed by all, fixing a fixme.  Add an assert

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

20 years agoPreSelection isn't optional and so there's no way to turn it off.
Misha Brukman [Mon, 16 Feb 2004 19:45:26 +0000 (19:45 +0000)]
PreSelection isn't optional and so there's no way to turn it off.

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

20 years agomemset and bcopy and now unified by the llvm.memset intrinsic
Chris Lattner [Mon, 16 Feb 2004 18:37:40 +0000 (18:37 +0000)]
memset and bcopy and now unified by the llvm.memset intrinsic

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

20 years agoAdd some ADD instructions that take memory operands for Alkis
Chris Lattner [Mon, 16 Feb 2004 18:19:31 +0000 (18:19 +0000)]
Add some ADD instructions that take memory operands for Alkis

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

20 years agoAdjusted the default pathname to the SPEC95 benchmarks. The new directory
John Criswell [Mon, 16 Feb 2004 14:55:18 +0000 (14:55 +0000)]
Adjusted the default pathname to the SPEC95 benchmarks.  The new directory
has source code corrections and some input files pre-filtered for use
with the LLVM test suite.

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

20 years agoAdd LeakDetection to MachineInstr.
Alkis Evlogimenos [Mon, 16 Feb 2004 07:17:43 +0000 (07:17 +0000)]
Add LeakDetection to MachineInstr.

Move out of line member functions of MachineBasicBlock to
MachineBasicBlock.cpp.

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

20 years agoImplement test/Regression/Transforms/SimplifyCFG/UncondBranchToReturn.ll,
Chris Lattner [Mon, 16 Feb 2004 06:35:48 +0000 (06:35 +0000)]
Implement test/Regression/Transforms/SimplifyCFG/UncondBranchToReturn.ll,
see the testcase for the reasoning.

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

20 years agoNew testcase, details in the comments
Chris Lattner [Mon, 16 Feb 2004 06:35:19 +0000 (06:35 +0000)]
New testcase, details in the comments

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

20 years agoFold PHI nodes of constants which are only used by a single cast. This implements
Chris Lattner [Mon, 16 Feb 2004 05:07:08 +0000 (05:07 +0000)]
Fold PHI nodes of constants which are only used by a single cast.  This implements
phi.ll:test4

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

20 years agoA new testcase for a situation that occurs in 181.mcf
Chris Lattner [Mon, 16 Feb 2004 05:06:36 +0000 (05:06 +0000)]
A new testcase for a situation that occurs in 181.mcf

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

20 years agoTeach LLVM to unravel the "swap idiom". This implements:
Chris Lattner [Mon, 16 Feb 2004 03:54:20 +0000 (03:54 +0000)]
Teach LLVM to unravel the "swap idiom".  This implements:
Regression/Transforms/InstCombine/xor.ll:test20

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

20 years agoAdd a test for the "swap idiom", which LLVM should be able to unravel.
Chris Lattner [Mon, 16 Feb 2004 03:53:44 +0000 (03:53 +0000)]
Add a test for the "swap idiom", which LLVM should be able to unravel.

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

20 years agoImplement Transforms/InstCombine/xor.ll:test19
Chris Lattner [Mon, 16 Feb 2004 01:20:27 +0000 (01:20 +0000)]
Implement Transforms/InstCombine/xor.ll:test19

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

20 years agoTest for xor chains
Chris Lattner [Mon, 16 Feb 2004 01:19:52 +0000 (01:19 +0000)]
Test for xor chains

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

20 years agoFix a bug in the recent rewrite of the leakdetector that caused all of the
Chris Lattner [Sun, 15 Feb 2004 23:33:48 +0000 (23:33 +0000)]
Fix a bug in the recent rewrite of the leakdetector that caused all of the
nightly tests to be really messed up.  The problem was that the new leakdetector
was depending on undefined behavior: the order of destruction of static objects.

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

20 years agoDocument bug 240
Chris Lattner [Sun, 15 Feb 2004 23:09:07 +0000 (23:09 +0000)]
Document bug 240

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

20 years agoMoving CBE tests to test/Regression/CodeGen/CBackend
Chris Lattner [Sun, 15 Feb 2004 22:56:30 +0000 (22:56 +0000)]
Moving CBE tests to test/Regression/CodeGen/CBackend

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

20 years agoWhen the user runs 'llc foo.bc -march=c', write the output to "foo.cbe.c", not
Chris Lattner [Sun, 15 Feb 2004 22:54:19 +0000 (22:54 +0000)]
When the user runs 'llc foo.bc -march=c', write the output to "foo.cbe.c", not
to "foo.s".

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

20 years agoNow that the lowerinvoke pass inserts calls to llvm.setjmp/llvm.longjmp, some
Chris Lattner [Sun, 15 Feb 2004 22:51:47 +0000 (22:51 +0000)]
Now that the lowerinvoke pass inserts calls to llvm.setjmp/llvm.longjmp, some
hacks can be banished.  Also, this gives us the opportunity to emit special code
for the setjmp/longjmps which alows the elimination of one GCC warning for every
setjmp/longjmp site (which is often THOUSANDS in C++ programs).  Yaay!

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

20 years agoBy default, llvm.setjmp/llvm.longjmp intrinsics get lowered to their libc counterparts
Chris Lattner [Sun, 15 Feb 2004 22:24:51 +0000 (22:24 +0000)]
By default, llvm.setjmp/llvm.longjmp intrinsics get lowered to their libc counterparts

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

20 years agoInstead of producing calls to setjmp/longjmp, produce uses of the
Chris Lattner [Sun, 15 Feb 2004 22:24:27 +0000 (22:24 +0000)]
Instead of producing calls to setjmp/longjmp, produce uses of the
llvm.setjmp/llvm.longjmp intrinsics.

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

20 years agoRefactor code. Now the intrinsic lowering pass tries to recycle preexisting
Chris Lattner [Sun, 15 Feb 2004 22:16:39 +0000 (22:16 +0000)]
Refactor code.  Now the intrinsic lowering pass tries to recycle preexisting
prototypes, even if they don't precisely match what it would prefer to use.
This fixes: CBackend/2004-02-15-PreexistingExternals.llx compiling it into:

  ltmp_0_30 = memcpy(l14_C, 4u, 17);
  ltmp_1_30 = memcpy(((int *)l27_A), ((unsigned )(long)l27_B), ((int )123u));

instead of:

  ltmp_0_30 = memcpy(l14_C, 4u, 17);
  ltmp_1_27 = l43_memcpy(l27_A, l27_B, 123u);

Which does the wrong thing as you could imagine.

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

20 years agoNew testcase
Chris Lattner [Sun, 15 Feb 2004 22:14:46 +0000 (22:14 +0000)]
New testcase

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

20 years agoThis pass should not require phi elimination or live variable
Alkis Evlogimenos [Sun, 15 Feb 2004 21:50:32 +0000 (21:50 +0000)]
This pass should not require phi elimination or live variable
analysis. It should only preserve them and update LiveVariables if it
already ran.

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

20 years agoFinegrainify namespacification
Chris Lattner [Sun, 15 Feb 2004 21:38:28 +0000 (21:38 +0000)]
Finegrainify namespacification
Remove one of the operands of a two operand instruction

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

20 years agoMake dense maps keyed on physical registers smallerusing
Alkis Evlogimenos [Sun, 15 Feb 2004 21:37:17 +0000 (21:37 +0000)]
Make dense maps keyed on physical registers smallerusing
MRegisterInfo::getNumRegs() instead of
MRegisterInfo::FirstVirtualRegister.

Also use MRegisterInfo::is{Physical,Virtual}Register where
appropriate.

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

20 years agoEliminate the use of spill (reserved) registers.
Alkis Evlogimenos [Sun, 15 Feb 2004 10:24:21 +0000 (10:24 +0000)]
Eliminate the use of spill (reserved) registers.

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

20 years agoQOI bug fixed
Chris Lattner [Sun, 15 Feb 2004 06:00:04 +0000 (06:00 +0000)]
QOI bug fixed

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

20 years agoAdjustments to support the new ConstantAggregateZero class
Chris Lattner [Sun, 15 Feb 2004 05:55:15 +0000 (05:55 +0000)]
Adjustments to support the new ConstantAggregateZero class

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

20 years agoAdd support for the new ConstantAggregateZero class
Chris Lattner [Sun, 15 Feb 2004 05:54:27 +0000 (05:54 +0000)]
Add support for the new ConstantAggregateZero class

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

20 years agoMake the JIT zero out globals with memset instead of an element at a time. This
Chris Lattner [Sun, 15 Feb 2004 05:54:06 +0000 (05:54 +0000)]
Make the JIT zero out globals with memset instead of an element at a time.  This
should speed it up a bit on a lot of programs

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

20 years agoNo need to scan zero initializers. This should make DSA a bit faster.
Chris Lattner [Sun, 15 Feb 2004 05:53:42 +0000 (05:53 +0000)]
No need to scan zero initializers.  This should make DSA a bit faster.

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

20 years agoAdd a new ConstantAggregateZero class, to fix PR239. This makes zero
Chris Lattner [Sun, 15 Feb 2004 05:53:04 +0000 (05:53 +0000)]
Add a new ConstantAggregateZero class, to fix PR239.  This makes zero
initializers for constant structs and arrays take constant space, instead of
space proportinal to the number of elements.  This reduces the memory usage of
the LLVM compiler by hundreds of megabytes when compiling some nasty SPEC95
benchmarks.

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

20 years agofinegrainify namespacification
Chris Lattner [Sun, 15 Feb 2004 05:52:36 +0000 (05:52 +0000)]
finegrainify namespacification

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

20 years agoBug fixed
Chris Lattner [Sun, 15 Feb 2004 05:47:37 +0000 (05:47 +0000)]
Bug fixed

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

20 years agoConstantArray::get and ConstantStruct::get now just return pointers to
Chris Lattner [Sun, 15 Feb 2004 04:14:47 +0000 (04:14 +0000)]
ConstantArray::get and ConstantStruct::get now just return pointers to
'Constant', instead of specific subclass pointers.  In the future, these will
return an instance of ConstantAggregateZero if all of the inputs are zeros.

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

20 years agoRemove dependence on return type of ConstantStruct::get
Chris Lattner [Sun, 15 Feb 2004 04:07:32 +0000 (04:07 +0000)]
Remove dependence on return type of ConstantStruct::get

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

20 years agoRemove dependence on the return type of ConstantArray::get
Chris Lattner [Sun, 15 Feb 2004 04:05:58 +0000 (04:05 +0000)]
Remove dependence on the return type of ConstantArray::get

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

20 years agoKeep a cache of non-abstract null arrays and structs. This speeds up llvm-dis
Chris Lattner [Sun, 15 Feb 2004 02:46:46 +0000 (02:46 +0000)]
Keep a cache of non-abstract null arrays and structs.  This speeds up llvm-dis
from 16.57 -> 13.46s on 129.compress.

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

20 years agoTestcase for PR205: [llvmgcc] C front-end does not emit 'zeroinitializer' when possible
Chris Lattner [Sun, 15 Feb 2004 02:19:08 +0000 (02:19 +0000)]
Testcase for PR205: [llvmgcc] C front-end does not emit 'zeroinitializer' when possible

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

20 years agoTest for actual support, not just for lack of crashage
Chris Lattner [Sun, 15 Feb 2004 01:21:39 +0000 (01:21 +0000)]
Test for actual support, not just for lack of crashage

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

20 years agoImplement llvm.(frame|return)address(0) correctly. They are used by the LLVM JIT...
Chris Lattner [Sun, 15 Feb 2004 01:04:03 +0000 (01:04 +0000)]
Implement llvm.(frame|return)address(0) correctly.  They are used by the LLVM JIT, among other
applications

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

20 years agoFix problem in DEBUG code. I could be pointing past the end and
Alkis Evlogimenos [Sun, 15 Feb 2004 00:46:41 +0000 (00:46 +0000)]
Fix problem in DEBUG code. I could be pointing past the end and
dereferencing it causes an assertion error.

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

20 years agoNew code quality fix
Chris Lattner [Sun, 15 Feb 2004 00:23:15 +0000 (00:23 +0000)]
New code quality fix

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

20 years agoNew testcase for PR237: [x86] wierd stack/frame pointer manipulation
Chris Lattner [Sun, 15 Feb 2004 00:21:04 +0000 (00:21 +0000)]
New testcase for PR237: [x86] wierd stack/frame pointer manipulation

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

20 years agoFix the 'have a framepointer' case, so that the frame pointer always points
Chris Lattner [Sun, 15 Feb 2004 00:15:37 +0000 (00:15 +0000)]
Fix the 'have a framepointer' case, so that the frame pointer always points
to the old saved EBP.

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

20 years agoAllow for fixed objects to reside in the local area, and if they don't to not
Chris Lattner [Sun, 15 Feb 2004 00:14:20 +0000 (00:14 +0000)]
Allow for fixed objects to reside in the local area, and if they don't to not
clobber them by allocating other objects in the same space!

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

20 years agoAdd back machine code deleter pass until we get a MachineCode pass
Alkis Evlogimenos [Sun, 15 Feb 2004 00:03:15 +0000 (00:03 +0000)]
Add back machine code deleter pass until we get a MachineCode pass
that will be responsible for the creation of MachineFunctions and will
be required by all MachineFunctionPass passes.

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

20 years agoModularize implementation of LeakDetector into a typed template
Alkis Evlogimenos [Sat, 14 Feb 2004 23:33:39 +0000 (23:33 +0000)]
Modularize implementation of LeakDetector into a typed template
implementation class. This makes the code simpler and allows for more
types to be added easily. It also implements caching for generic
objects (it was only available for llvm objects).

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

20 years agoAdd support for the 'pop' instruction
Chris Lattner [Sat, 14 Feb 2004 21:06:02 +0000 (21:06 +0000)]
Add support for the 'pop' instruction

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

20 years agoThere is no reason to align the stack pointer if there are no callees of this
Chris Lattner [Sat, 14 Feb 2004 20:11:07 +0000 (20:11 +0000)]
There is no reason to align the stack pointer if there are no callees of this
function!

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

20 years agoThere is no reason to align the stack pointer if there are no callees of this function!
Chris Lattner [Sat, 14 Feb 2004 20:10:59 +0000 (20:10 +0000)]
There is no reason to align the stack pointer if there are no callees of this function!

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

20 years agoThe prologue/epilogue related method calls have no reason to return a value,
Chris Lattner [Sat, 14 Feb 2004 19:49:54 +0000 (19:49 +0000)]
The prologue/epilogue related method calls have no reason to return a value,
make them return void.

This allows us to avoid some costly MBB.size() calls

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

20 years agoThe prologue/epilogue related method calls have no reason to return a value,
Chris Lattner [Sat, 14 Feb 2004 19:49:05 +0000 (19:49 +0000)]
The prologue/epilogue related method calls have no reason to return a value,
make them return void.

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

20 years agofix typeo
Chris Lattner [Sat, 14 Feb 2004 19:27:26 +0000 (19:27 +0000)]
fix typeo

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

20 years agofinegrainify namespacification, fix 80col prob
Chris Lattner [Sat, 14 Feb 2004 06:00:36 +0000 (06:00 +0000)]
finegrainify namespacification, fix 80col prob

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