Commit Graph

4792 Commits

Author SHA1 Message Date
Chris Lattner a8d8e0d9dd Get rid of deprecated function
llvm-svn: 4997
2002-12-13 07:30:45 +00:00
Chris Lattner c93799b779 return 0 on success
llvm-svn: 4996
2002-12-13 06:57:24 +00:00
Chris Lattner 179519bf77 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 4e2c30d894 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 588806f5af getelementptr uses long instead of uint indexes
llvm-svn: 4993
2002-12-13 06:01:21 +00:00
Chris Lattner 295a415a31 Stop sucking
llvm-svn: 4992
2002-12-13 05:51:32 +00:00
Misha Brukman 999f5d6fb8 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 3bbfca1401 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 f243ce960a Fix testcase
llvm-svn: 4989
2002-12-13 05:42:57 +00:00
Chris Lattner 7ccef07786 Implement branches
llvm-svn: 4988
2002-12-13 05:40:28 +00:00
Chris Lattner 0a6e0562a3 Infinite loops, are, well, not good
llvm-svn: 4987
2002-12-13 05:28:50 +00:00
Chris Lattner e791322602 Emit the right form of mod/rm mod field
llvm-svn: 4986
2002-12-13 05:05:05 +00:00
Chris Lattner e600a4ebe8 Nicify a bit
llvm-svn: 4985
2002-12-13 05:04:37 +00:00
Misha Brukman 2a0baf1a2b 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 82f1580ee8 Fix encoding of CBW instruction
llvm-svn: 4983
2002-12-13 04:41:31 +00:00
Misha Brukman 4ef74c8079 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 862f3ef8bc Moves now select correct opcode based on the data size.
llvm-svn: 4981
2002-12-13 04:24:53 +00:00
Chris Lattner 1176170c16 Remove extranous #include
llvm-svn: 4980
2002-12-13 04:12:24 +00:00
Chris Lattner ec0bc92146 Rename MemArg* to Arg*
llvm-svn: 4979
2002-12-13 03:51:55 +00:00
Chris Lattner 343e4b1810 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 2ef75daf78 This is supposed to provide correct size for datatypes. Supposedly.
llvm-svn: 4977
2002-12-13 02:13:15 +00:00
Misha Brukman 260dbc79fc 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 eedcef4f92 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 7b21678aed 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 5e91d38ecb 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 1028ac46d6 '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 c1ba0cddd6 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 356163f48a 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 0d19db3c34 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 c42ada2e5e Remove #includes
llvm-svn: 4968
2002-12-12 03:47:27 +00:00
Chris Lattner 6307208258 Include tablegen
llvm-svn: 4967
2002-12-12 03:44:42 +00:00
Chris Lattner 5bd7897ac2 Fix header
llvm-svn: 4966
2002-12-12 03:43:30 +00:00
Vikram S. Adve d9676ed983 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 c864ab1e33 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 5fb974b74a 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 9a672d17ae 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 41aab86c40 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 3425529fc5 Fix link errors due to new IPModRef pass.
llvm-svn: 4960
2002-12-09 05:53:11 +00:00
Vikram S. Adve 42b7335d7c 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 775e51d87a 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 8975afdfc4 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 3552d79ac1 Namespacify more
llvm-svn: 4956
2002-12-08 06:01:34 +00:00
Chris Lattner 4f96aa450e Add support to count the number of dynamic instructions executed by LLI
llvm-svn: 4955
2002-12-08 05:51:08 +00:00
Chris Lattner 3935d2b1ec Add total instruction, bb, & function counts
llvm-svn: 4954
2002-12-07 23:24:24 +00:00
Chris Lattner 1ee7f8e6bb Fix bug that was bugging bugpoint
llvm-svn: 4953
2002-12-07 21:27:16 +00:00
Chris Lattner 688ac5b723 Remove dead code
llvm-svn: 4952
2002-12-07 18:42:13 +00:00
Chris Lattner 55dfb8230e Check in an old testcase
llvm-svn: 4951
2002-12-07 17:08:07 +00:00
Chris Lattner 906eea0e43 Give better error message if two passes of the same argument are registered
llvm-svn: 4950
2002-12-07 04:41:22 +00:00
Vikram S. Adve d1665d2bab Stronger assertion in getNodeId(): node id must exist in the map.
llvm-svn: 4949
2002-12-06 21:19:07 +00:00
Vikram S. Adve 04aee9478c Two bug fixes:
(1) Make entries for Constant values in the ScalarMap.
(2) Set MOD bit for the node pointed to by the
    argument of a free instruction.

llvm-svn: 4948
2002-12-06 21:17:10 +00:00