1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 06:22:51 +01:00
Commit Graph

4899 Commits

Author SHA1 Message Date
Chris Lattner
416a9ca8f1 Code gen phi's correctly
llvm-svn: 5004
2002-12-13 10:09:43 +00:00
Chris Lattner
505ace489e Print X86 PHI nodes in a sane manner
llvm-svn: 5003
2002-12-13 09:59:26 +00:00
Misha Brukman
af40b6adcd This should handle register allocating PHI nodes.
llvm-svn: 5002
2002-12-13 09:54:36 +00:00
Misha Brukman
fb02408496 Added moveReg2Reg() and moveImm2Reg() to accomodate moving data around due to
PHI nodes.

llvm-svn: 5001
2002-12-13 09:54:12 +00:00
Chris Lattner
74e9df0627 Final version of BuildMI for symmetry and because I want to use it
llvm-svn: 5000
2002-12-13 09:33:06 +00:00
Brian Gaeke
34ad176df5 lib/Target/X86/InstSelectSimple.cpp: Start counting arguments with 2,
because arguments start two stack slots off of EBP. Break out of the
 for loop once the argument is found. Increment the counter at the end
 of the loop instead of the beginning. Use addRegOffset and compute
 the scale * index part at compile time instead of using the fancy
 load instruction. Just because an instruction set has wacky addressing
 modes doesn't mean we ought to use them (at least, if you believe Dave
 Patterson).

lib/Target/X86/X86InstrBuilder.h: Add some comments.

test/Regression/Jello/test-loadstore.ll:  Let main return int 0.

llvm-svn: 4999
2002-12-13 09:28:50 +00:00
Brian Gaeke
5da234a1d7 InstSelectSimple.cpp: Give promote32 a comment. Add initial
implementation of getReg() for arguments.

MachineCodeEmitter.cpp: Fix using EBP with index, scale and no
 displacement (whew!) due to Chris.

Printer.cpp: Fix printing out index and scale in memory references.

llvm-svn: 4998
2002-12-13 07:56:18 +00:00
Chris Lattner
329956d9f9 Get rid of deprecated function
llvm-svn: 4997
2002-12-13 07:30:45 +00:00
Chris Lattner
beb18ff2dd return 0 on success
llvm-svn: 4996
2002-12-13 06:57:24 +00:00
Chris Lattner
9e7b73b55f Implement getelementptr constant exprs
Implement ConstantPointerRefs
Treat long/ulongs as if they were integers.  A hack, but an effective one

llvm-svn: 4995
2002-12-13 06:56:29 +00:00
Brian Gaeke
641c6fa60a brg
InstSelectSimple.cpp: Add stub implementation of visitFreeInst.
 Add comments that mention how we are failing to implement malloc/free.
 Add initial implementation of visitAllocaInst.

X86TargetMachine.cpp: Include llvm/Transforms/Scalar.h.
 Add LowerAllocations pass before instruction selection.

jello/Makefile: Add scalaropts.a.

llvm-svn: 4994
2002-12-13 06:46:31 +00:00
Chris Lattner
8fa0bebfd9 getelementptr uses long instead of uint indexes
llvm-svn: 4993
2002-12-13 06:01:21 +00:00
Chris Lattner
8ed9bdc80a Stop sucking
llvm-svn: 4992
2002-12-13 05:51:32 +00:00
Misha Brukman
02f2676eac Making main() return 0 so that we know it ran successfully when it exits.
llvm-svn: 4991
2002-12-13 05:44:21 +00:00
Misha Brukman
a60d5f394d Making main() return 0 to exit without error when no error actually occurs.
llvm-svn: 4990
2002-12-13 05:43:36 +00:00
Chris Lattner
071795caf3 Fix testcase
llvm-svn: 4989
2002-12-13 05:42:57 +00:00
Chris Lattner
73433b07b9 Implement branches
llvm-svn: 4988
2002-12-13 05:40:28 +00:00
Chris Lattner
c2871e6cfb Infinite loops, are, well, not good
llvm-svn: 4987
2002-12-13 05:28:50 +00:00
Chris Lattner
62454d83f0 Emit the right form of mod/rm mod field
llvm-svn: 4986
2002-12-13 05:05:05 +00:00
Chris Lattner
7ec625a157 Nicify a bit
llvm-svn: 4985
2002-12-13 05:04:37 +00:00
Misha Brukman
37ebb1a55f This way it's easier to test: if the call to external exit(0) succeeded,
program exits with code 0, no error. If the call does not work/succeed, main
returns 1, so we notice it. The other way around doesn't work. :)

llvm-svn: 4984
2002-12-13 04:43:32 +00:00
Chris Lattner
4cc9894c71 Fix encoding of CBW instruction
llvm-svn: 4983
2002-12-13 04:41:31 +00:00
Misha Brukman
e5a8dcc695 Start allocating stack space at [ebp-4] to not overwrite the return address.
Also make all loads & stores 4-byte aligned for performance. ;)

llvm-svn: 4982
2002-12-13 04:34:02 +00:00
Misha Brukman
20c9c61c6d Moves now select correct opcode based on the data size.
llvm-svn: 4981
2002-12-13 04:24:53 +00:00
Chris Lattner
10f305cec7 Remove extranous #include
llvm-svn: 4980
2002-12-13 04:12:24 +00:00
Chris Lattner
723ca2522d Rename MemArg* to Arg*
llvm-svn: 4979
2002-12-13 03:51:55 +00:00
Chris Lattner
b698cd8236 Make mem size an assert
Add mem size flags to all instructions using an imm

llvm-svn: 4978
2002-12-13 03:50:13 +00:00
Misha Brukman
6a5788bb6f This is supposed to provide correct size for datatypes. Supposedly.
llvm-svn: 4977
2002-12-13 02:13:15 +00:00
Misha Brukman
12bec4ecef Take advantage of our knowledge of 2-address X86 instructions and
register-allocated them appropriately.

llvm-svn: 4976
2002-12-12 23:20:31 +00:00
Misha Brukman
bc60f65211 Define the 2-address flag used by X86 instructions (add,sub,and,or,xor) that
need to be declared as such.

llvm-svn: 4975
2002-12-12 23:19:51 +00:00
Misha Brukman
bf2857eb5c Added the flag to mark instructions which are really 2-address instructions in
X86, but would be 3-address in any normail architecture.

llvm-svn: 4974
2002-12-12 23:19:11 +00:00
Brian Gaeke
9b38597288 This checkin is brought to you by the brian gaeke allnighter fund.
(lib/Target/X86) InstSelectSimple.cpp:
 Include llvm/DerivedTypes.h and iostream.
 Refactor visitMul out into a wrapper around doMultiply(), so that we
  can do multiplications on temporary values when we are doing
  getelementptrs.
 Refactor part of getReg out into makeAnotherReg, so that we can create
  registers willy-nilly to hold temporary values, when we are doing
  getelementptrs.
 Add stub implementations of visitMallocInst and visitAllocaInst.
 Add initial implementation of visitGetElementPtrInst.
 In copyConstantToRegister:
  We throw a *lot* of our asserts here. So, when we want to throw an
   assert, print out to stderr whatever expr or whatever constant made
   us barf.
  Support copying ConstantPointerNull to register, using a move immediate
   of zero.
 Rename FLDr4 and FLDr8 to FLDr32 and FLDr64, so that they match the meanings
  of the numbers in the other instruction names. All uses modified.
 Teach visitCallInst to extract byte- and short-class return values
  from subregs of EAX.  Add a FIXME note about how we would do it for
  float-class return values.
 Add a FIXME note about how we would cast float to int and back.

X86InstrInfo.def:
 Rename FLDr4 and FLDr8 to FLDr32 and FLDr64, so that they match the meanings
  of the numbers in the other instruction names. All uses modified.

(tools/jello) GlobalVars.cpp:
 Include iostream.
 If we have to emit a floating-point constant to memory, gamble and use
  the same method as for ints.
 If we have to emit a ConstantPointerNull to memory, try using a "void *"
  and "NULL".
 Otherwise, if we are going to throw an assert, print out whatever constant
  made us barf, first.

llvm-svn: 4973
2002-12-12 15:33:40 +00:00
Misha Brukman
1264a03c8a 'graph' is spelled without a 'c'.
Also added Statistic counters for NoAlias and MayAlias.

llvm-svn: 4972
2002-12-12 05:34:10 +00:00
Chris Lattner
4e607715ce Make a release build compile. This field is not really an enum, it's really a bitfield
llvm-svn: 4971
2002-12-12 05:31:26 +00:00
Misha Brukman
46aa1be828 ipa.a only needs to be mentioned once, and spaces should be used instead of
tabs for readability.

llvm-svn: 4970
2002-12-12 05:29:32 +00:00
Misha Brukman
9fbca4e8ea No need to specify the class if the method is within the class declaration.
llvm-svn: 4969
2002-12-12 05:28:39 +00:00
Chris Lattner
8d4b4b020e Remove #includes
llvm-svn: 4968
2002-12-12 03:47:27 +00:00
Chris Lattner
8cbd9febdb Include tablegen
llvm-svn: 4967
2002-12-12 03:44:42 +00:00
Chris Lattner
8911afb9c1 Fix header
llvm-svn: 4966
2002-12-12 03:43:30 +00:00
Vikram S. Adve
6c46fba526 External routines used to identify Cilk operations inserted by the
parallelization pass.

llvm-svn: 4965
2002-12-10 13:08:48 +00:00
Vikram S. Adve
a9966ae8ad This file implements the function DemoteRegToStack(), which takes a
virtual register computed by an Instruction& X and replaces it with
a slot in the stack frame, allocated via alloca.

llvm-svn: 4964
2002-12-10 13:07:58 +00:00
Vikram S. Adve
8ea96d8162 This file provides the function DemoteRegToStack(), which takes a
virtual register computed by an Instruction& X and replaces it with
a slot in the stack frame, allocated via alloca.

llvm-svn: 4963
2002-12-10 13:07:12 +00:00
Vikram S. Adve
849346ee23 This file implements a pass that automatically parallelizes a program,
using the Cilk multi-threaded runtime system to execute parallel code.
The current version inserts too many sync() operations in the program
because it does not attempt to optimize their placement.

llvm-svn: 4962
2002-12-10 00:43:34 +00:00
Vikram S. Adve
c8ea11cf8e The pass Parallelize automatically parallelizes a program using the
Cilk multi-threaded runtime system to execute parallel code.  This file
exposes some routines needed for code generation for that pass.

llvm-svn: 4961
2002-12-10 00:42:22 +00:00
Vikram S. Adve
03e6fa5804 Fix link errors due to new IPModRef pass.
llvm-svn: 4960
2002-12-09 05:53:11 +00:00
Vikram S. Adve
4c20f7764d Repeat ipa.a. Since IPModRef is currently only used in analysis.o,
it was causing linking errors.

llvm-svn: 4959
2002-12-09 04:46:25 +00:00
Vikram S. Adve
c9617fde54 Iterator that enumerates the ProgramDependenceGraph (PDG) for a function,
i.e., enumerates all data and control dependences for the function.

llvm-svn: 4958
2002-12-08 14:13:19 +00:00
Vikram S. Adve
90bc3110b6 An explicit representation of dependence graphs, and a pass that
computes a dependence graph for data dependences on memory locations
using interprocedural Mod/Ref information.

llvm-svn: 4957
2002-12-08 13:26:29 +00:00
Chris Lattner
883827db1c Namespacify more
llvm-svn: 4956
2002-12-08 06:01:34 +00:00
Chris Lattner
f525e2f95e Add support to count the number of dynamic instructions executed by LLI
llvm-svn: 4955
2002-12-08 05:51:08 +00:00