function from normal regalloc code
* Make the regalloc for a block a function instead of part of runOnMachineBB, which
makes it easier to see what's going on in runOnMBB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5051 91177308-0d34-0410-b5e6-96231b3b80d8
* Reword comment to make more clear
* Don't print out BB's after modification made
* Don't delete and new an instruction when we need to move something, just move it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5029 91177308-0d34-0410-b5e6-96231b3b80d8
The MachineBasicBlock variable name patrol hereby fines Chris Lattner
one bag of nachos, for shadowing global names while his license to do so
was under suspension.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5014 91177308-0d34-0410-b5e6-96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4999 91177308-0d34-0410-b5e6-96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4998 91177308-0d34-0410-b5e6-96231b3b80d8
Implement ConstantPointerRefs
Treat long/ulongs as if they were integers. A hack, but an effective one
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4995 91177308-0d34-0410-b5e6-96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4994 91177308-0d34-0410-b5e6-96231b3b80d8
(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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4973 91177308-0d34-0410-b5e6-96231b3b80d8
virtual register computed by an Instruction& X and replaces it with
a slot in the stack frame, allocated via alloca.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4964 91177308-0d34-0410-b5e6-96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4962 91177308-0d34-0410-b5e6-96231b3b80d8
computes a dependence graph for data dependences on memory locations
using interprocedural Mod/Ref information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4957 91177308-0d34-0410-b5e6-96231b3b80d8
(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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4948 91177308-0d34-0410-b5e6-96231b3b80d8
fact that the incoming nodes may be merged away at intermediate
steps. Use an extra level of indirection via DSNodeHandles
to track the nodes being merged. All this now happens in a
static helper function MergeNodes().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4947 91177308-0d34-0410-b5e6-96231b3b80d8
been missed if node *this got merged away due to recursive merging!
Also, links were not moved correctly if a node is collapsed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4933 91177308-0d34-0410-b5e6-96231b3b80d8
" <SIZE> PTR " string when emitting assembly.
Target/X86/X86InstrInfo.def: Tidy up a bit:
Squashed everything down to 118 chars wide, wrapping lines so that
comment is at the same point on each line. Rename "NoImpRegs" as
"NoIR". (most instructions have NoImpRegs twice on a line, so this
saves 10 columns).
Also, annotate various instructions with flags for size of memory operand.
(MemArg16, MemArg32, MemArg64, etc.)
Target/X86/X86InstrInfo.h: Define flags for size of memory operand.
(MemArg16, MemArg32, MemArg64, etc.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4932 91177308-0d34-0410-b5e6-96231b3b80d8
correctly: skipping instructions by incorrectly incrementing the pointer.
Also adds support for building a reg-to-regclass map, and splits the function
for saving register to stack into two, one suitable for virtual registers
(which also assigns it a physical register) and one for simply storing back
physical registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4898 91177308-0d34-0410-b5e6-96231b3b80d8
X86Implicit.cpp, X86Implicit.h: New files.
InstSelectSimple.cpp: Add some clarifications in visitCallInst comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4874 91177308-0d34-0410-b5e6-96231b3b80d8