Commit Graph

17144 Commits

Author SHA1 Message Date
Chris Lattner 24f0f0e28f Update this pass to set PhysRegsUsed info in MachineFunction.
llvm-svn: 19792
2005-01-23 22:51:56 +00:00
Chris Lattner ae09d93b35 Update these register allocators to set the PhysRegUsed info in MachineFunction.
llvm-svn: 19791
2005-01-23 22:45:13 +00:00
Chris Lattner 304053c6ec Add support for the PhysRegsUsed array.
llvm-svn: 19789
2005-01-23 22:13:58 +00:00
Chris Lattner 1def519f3d Expose more information from register allocation to passes that run after
it.

llvm-svn: 19788
2005-01-23 22:13:36 +00:00
Chris Lattner ef2de322c6 Speed this up a bit by making ModifiedRegs a vector<char> not vector<bool>
llvm-svn: 19787
2005-01-23 21:45:01 +00:00
Chris Lattner 9e2c7facb2 Get rid of a several dozen more and instructions in specint.
llvm-svn: 19786
2005-01-23 20:26:55 +00:00
Chris Lattner 6c43f5e5fe Fix crash comparing empty file against nonempty file.
llvm-svn: 19782
2005-01-23 06:02:40 +00:00
Chris Lattner 4add7e356f Adjust to changes in SelectionDAG interfaces
The first half of correct chain insertion for libcalls. This is not enough
to fix Fhourstones yet though.

llvm-svn: 19781
2005-01-23 04:42:50 +00:00
Chris Lattner 90b7c13f3a Remove the 3 HACK HACK HACKs I put in before, fixing them properly with
the new TLI that is available.

Implement support for handling out of range shifts.  This allows us to
compile this code (a 64-bit rotate):

unsigned long long f3(unsigned long long x) {
  return (x << 32) | (x >> (64-32));
}

into this:

f3:
        mov %EDX, DWORD PTR [%ESP + 4]
        mov %EAX, DWORD PTR [%ESP + 8]
        ret

GCC produces this:

$ gcc t.c -masm=intel -O3 -S -o - -fomit-frame-pointer
..
f3:
        push    %ebx
        mov     %ebx, DWORD PTR [%esp+12]
        mov     %ecx, DWORD PTR [%esp+8]
        mov     %eax, %ebx
        mov     %edx, %ecx
        pop     %ebx
        ret

The Simple ISEL produces (eww gross):

f3:
        sub %ESP, 4
        mov DWORD PTR [%ESP], %ESI
        mov %EDX, DWORD PTR [%ESP + 8]
        mov %ECX, DWORD PTR [%ESP + 12]
        mov %EAX, 0
        mov %ESI, 0
        or %EAX, %ECX
        or %EDX, %ESI
        mov %ESI, DWORD PTR [%ESP]
        add %ESP, 4
        ret

llvm-svn: 19780
2005-01-23 04:39:44 +00:00
Chris Lattner ffcb0ae329 Adjust to changes in SelectionDAG interface.
llvm-svn: 19779
2005-01-23 04:36:26 +00:00
Chris Lattner 2877e9e826 Give SelectionDAG a TargetLowering instance instead of TM instance.
llvm-svn: 19778
2005-01-23 04:36:06 +00:00
Chris Lattner 28939a222e Build Alpha by default.
llvm-svn: 19777
2005-01-23 04:34:46 +00:00
Reid Spencer d5d45b8d1a Fix alloca support for Cygwin. On cygwin its __alloca not __builtin_alloca
llvm-svn: 19776
2005-01-23 04:32:47 +00:00
Reid Spencer 30226da5b3 Support Cygwin assembly generation. The cygwin version of Gnu ASsembler
doesn't support certain directives and symbols on cygwin are prefixed with
an underscore. This patch makes the necessary adjustments to the output.

llvm-svn: 19775
2005-01-23 03:52:14 +00:00
Chris Lattner ece10a420e Add support for fp tolerances
llvm-svn: 19774
2005-01-23 03:45:26 +00:00
Chris Lattner 580f5bfae3 This method takes sys::Path objects now.
llvm-svn: 19773
2005-01-23 03:32:16 +00:00
Chris Lattner 411bbeeac7 Adjust to changed interface.
llvm-svn: 19772
2005-01-23 03:31:39 +00:00
Chris Lattner b782187b32 Make DiffFilesWithTolerance take sys::Path's instead of std::strings
Delete dead functions.

llvm-svn: 19771
2005-01-23 03:31:02 +00:00
Chris Lattner 7e264b2ec6 Remove two dead methods and improve the comments for DiffFilesWithTolerance.
Also, make DiffFilesWithTolerance take sys::Path objects instead of std::strings.

llvm-svn: 19770
2005-01-23 03:30:39 +00:00
Chris Lattner 364e8b771d Fix a bug in previous checkin
llvm-svn: 19769
2005-01-23 03:19:13 +00:00
Chris Lattner dff29cd72e Drop dead #include
llvm-svn: 19768
2005-01-23 03:16:56 +00:00
Chris Lattner c5a20a5dd4 The meat of this utility has been moved to FileUtilities, where it can be
used by other tools.

llvm-svn: 19767
2005-01-23 03:15:47 +00:00
Chris Lattner 16a4368c40 Add a new method, refactored out of fpcmp
llvm-svn: 19766
2005-01-23 03:13:43 +00:00
Chris Lattner ca2bf0b67a New method.
llvm-svn: 19765
2005-01-23 03:11:38 +00:00
Andrew Lenharth a1b5ca2b9d Let me introduce you to the early stages of the llvm backend for the alpha processor
llvm-svn: 19764
2005-01-22 23:41:55 +00:00
Chris Lattner eccb73d57f Get this to work for 64-bit systems.
llvm-svn: 19763
2005-01-22 23:04:37 +00:00
Reid Spencer 12b25a12a6 We're working towards LLVM 1.5 now so bump the version number. This change
won't be propagated to the configure script until there's a need to change
configure.ac for some larger purpose.

llvm-svn: 19762
2005-01-22 21:29:42 +00:00
Chris Lattner 97cf8fd4a9 Minor fix.
llvm-svn: 19761
2005-01-22 20:59:38 +00:00
Chris Lattner 59a7f5c2f3 This is the final big of factoring. This shares cases in suboperand
differences, which means that identical instructions (after stripping off
the first literal string) do not run any different code at all.  On the X86,
this turns this code:

    switch (MI->getOpcode()) {
    case X86::ADC32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::ADC32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::ADC32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::ADD32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::ADD32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::ADD32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::AND32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::AND32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::AND32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::CMP32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::CMP32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::MOV32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::MOV32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::OR32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::OR32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::OR32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::ROL32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::ROR32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SAR32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SBB32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::SBB32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::SBB32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::SHL32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SHLD32mrCL: printOperand(MI, 4, MVT::i32); break;
    case X86::SHR32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SHRD32mrCL: printOperand(MI, 4, MVT::i32); break;
    case X86::SUB32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::SUB32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::SUB32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::TEST32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::TEST32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::TEST8mi: printOperand(MI, 4, MVT::i8); break;
    case X86::XCHG32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::XOR32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::XOR32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::XOR32mr: printOperand(MI, 4, MVT::i32); break;
    }

into this:

    switch (MI->getOpcode()) {
    case X86::ADC32mi:
    case X86::ADC32mr:
    case X86::ADD32mi:
    case X86::ADD32mr:
    case X86::AND32mi:
    case X86::AND32mr:
    case X86::CMP32mi:
    case X86::CMP32mr:
    case X86::MOV32mi:
    case X86::MOV32mr:
    case X86::OR32mi:
    case X86::OR32mr:
    case X86::SBB32mi:
    case X86::SBB32mr:
    case X86::SHLD32mrCL:
    case X86::SHRD32mrCL:
    case X86::SUB32mi:
    case X86::SUB32mr:
    case X86::TEST32mi:
    case X86::TEST32mr:
    case X86::XCHG32mr:
    case X86::XOR32mi:
    case X86::XOR32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::ADC32mi8:
    case X86::ADD32mi8:
    case X86::AND32mi8:
    case X86::OR32mi8:
    case X86::ROL32mi:
    case X86::ROR32mi:
    case X86::SAR32mi:
    case X86::SBB32mi8:
    case X86::SHL32mi:
    case X86::SHR32mi:
    case X86::SUB32mi8:
    case X86::TEST8mi:
    case X86::XOR32mi8: printOperand(MI, 4, MVT::i8); break;
    }

After this, the generated asmwriters look pretty much as though they were
generated by hand.  This shrinks the X86 asmwriter.inc files from 55101->39669
and 55429->39551 bytes each, and PPC from 16766->12859 bytes.

llvm-svn: 19760
2005-01-22 20:31:17 +00:00
Chris Lattner 92275bb6bb Implement *even more* factoring. In particular, if all of the instruction
strings starts out with a constant string, we emit the string first, using
a table lookup (instead of a switch statement).

Because this is usually the opcode portion of the asm string, the differences
between the instructions have now been greatly reduced.  This allows many
more case statements to be grouped together.

This patch also allows instruction cases to be grouped together when the
instruction patterns are exactly identical (common after the opcode string
has been ripped off), and when the differing operand is a MachineInstr
operand that needs to be formatted.

The end result of this is a mean and lean generated AsmPrinter!

llvm-svn: 19759
2005-01-22 19:22:23 +00:00
Chris Lattner 945e8655dd Refactor code for numbering instructions into CodeGenTarget.
llvm-svn: 19758
2005-01-22 18:58:51 +00:00
Jeff Cohen da636b3783 Fix VC++ compilation error
llvm-svn: 19757
2005-01-22 18:50:10 +00:00
Chris Lattner 64d9d2b819 QOI feature implemented.
llvm-svn: 19756
2005-01-22 18:45:35 +00:00
Chris Lattner 9ceb7c8f23 Implement factoring of instruction pattern strings. In particular, instead of
emitting code like this:

  case PPC::ADD: O  << "add ";  printOperand(MI, 0, MVT::i64); O  << ", ";  prin
tOperand(MI, 1, MVT::i64); O  << ", ";  printOperand(MI, 2, MVT::i64); O  << '\n
'; break;
  case PPC::ADDC: O  << "addc ";  printOperand(MI, 0, MVT::i64); O  << ", ";  pr
intOperand(MI, 1, MVT::i64); O  << ", ";  printOperand(MI, 2, MVT::i64); O  << '
\n'; break;
  case PPC::ADDE: O  << "adde ";  printOperand(MI, 0, MVT::i64); O  << ", ";  pr
intOperand(MI, 1, MVT::i64); O  << ", ";  printOperand(MI, 2, MVT::i64); O  << '
\n'; break;
...

Emit code like this:

  case PPC::ADD:
  case PPC::ADDC:
  case PPC::ADDE:
  ...
    switch (MI->getOpcode()) {
    case PPC::ADD: O << "add "; break;
    case PPC::ADDC: O << "addc "; break;
    case PPC::ADDE: O << "adde "; break;
    ...
    }
    printOperand(MI, 0, MVT::i64);
    O << ", ";
    printOperand(MI, 1, MVT::i64);
    O << ", ";
    printOperand(MI, 2, MVT::i64);
    O << "\n";
    break;

This shrinks the PPC asm writer from 24785->15205 bytes (even though the new
asmwriter has much more whitespace than the old one), and the X86 printers shrink
quite a bit too.  The important implication of this is that GCC no longer hits swap
when building the PPC backend in optimized mode.  Thus this fixes PR448.

-Chris

llvm-svn: 19755
2005-01-22 18:38:13 +00:00
Chris Lattner b6f5d9a82a Fix the ::: problem
llvm-svn: 19754
2005-01-22 18:18:59 +00:00
Chris Lattner 3baf682110 Minor refactoring, no functionality change.
llvm-svn: 19753
2005-01-22 17:40:38 +00:00
Jeff Cohen ff696def84 oops
llvm-svn: 19752
2005-01-22 17:37:13 +00:00
Jeff Cohen c8f1f4bc8e Use binary mode for reading/writing bytecode files
llvm-svn: 19751
2005-01-22 17:36:17 +00:00
Jeff Cohen e90b0c5469 Add (non-working) project bugpoint to Visual Studio
llvm-svn: 19750
2005-01-22 17:35:30 +00:00
Chris Lattner 0c23ba5c0f Seperate asmstring parsing from emission. This allows the code to be simpler
and more understandable.  It also allows us to do simple things like fold
consequtive literal strings together.  For example, instead of emitting this
for the X86 backend:

  O  << "adc" << "l" << " ";

we now generate this:

  O << "adcl ";

*whoa* :)

This shrinks the X86 asmwriters from 62729->58267 and 65176->58644 bytes
for the intel/att asm writers respectively.

llvm-svn: 19749
2005-01-22 17:32:42 +00:00
Jeff Cohen 0e64c73e67 Don't exclude FileUtilies and ToolRunner from VC++ build
llvm-svn: 19748
2005-01-22 16:32:47 +00:00
Jeff Cohen 142b4a721f Fix VC++ complaint
llvm-svn: 19747
2005-01-22 16:30:58 +00:00
Jeff Cohen ccbd3f0d57 Fix destroyDirectory bug
llvm-svn: 19746
2005-01-22 16:28:33 +00:00
Chris Lattner 52c97fbea9 Implicitly defined registers can clobber callee saved registers too!
This fixes the return-address-not-being-saved problem in the Alpha backend.

llvm-svn: 19741
2005-01-22 00:49:16 +00:00
Andrew Lenharth 67e2e21353 make double-dollar properly escape asmstrings
llvm-svn: 19740
2005-01-22 00:35:22 +00:00
Chris Lattner 3bc78b2e0b More bugfixes for IA64 shifts.
llvm-svn: 19739
2005-01-22 00:33:03 +00:00
Chris Lattner ec2183713c Fix problems with non-x86 targets.
llvm-svn: 19738
2005-01-22 00:31:52 +00:00
Chris Lattner d637c96fac Add a nasty hack to fix Alpha/IA64 multiplies by a power of two.
llvm-svn: 19737
2005-01-22 00:20:42 +00:00
Chris Lattner d53e763f18 Remove unneeded line.
llvm-svn: 19736
2005-01-21 23:43:12 +00:00
Chris Lattner 4f987bf16d test commit
llvm-svn: 19735
2005-01-21 23:38:56 +00:00