diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-12-10 13:07:12 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-12-10 13:07:12 +0000 |
commit | 5fb974b74ad7da80d16f96099e0b70f5fa55e2fd (patch) | |
tree | f9866a11876572647a5ab1540fe501130664e963 | |
parent | 9a672d17aeab8d017753961136376dce8ab0d4b2 (diff) | |
download | bcm5719-llvm-5fb974b74ad7da80d16f96099e0b70f5fa55e2fd.tar.gz bcm5719-llvm-5fb974b74ad7da80d16f96099e0b70f5fa55e2fd.zip |
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
-rw-r--r-- | llvm/include/llvm/Transforms/Utils/DemoteRegToStack.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/include/llvm/Transforms/Utils/DemoteRegToStack.h b/llvm/include/llvm/Transforms/Utils/DemoteRegToStack.h new file mode 100644 index 00000000000..915a19f1125 --- /dev/null +++ b/llvm/include/llvm/Transforms/Utils/DemoteRegToStack.h @@ -0,0 +1,21 @@ +//===- DemoteRegToStack.h - Move a virtual reg. to stack --------*- C++ -*-===// +// This file provides the function: +// AllocaInst* DemoteRegToStack(Instruction& X): +// +// This function takes a virtual register computed by an +// Instruction& X and replaces it with a slot in the stack frame, +// allocated via alloca. It has to: +// (1) Identify all Phi operations that have X as an operand and +// transitively other Phis that use such Phis; +// (2) Store all values merged with X via Phi operations to the stack slot; +// (3) Load the value from the stack slot just before any use of X or any +// of the Phis that were eliminated; and +// (4) Delete X and all the Phis, which should all now be dead. +// +// Returns the pointer to the alloca inserted to create a stack slot for X. +//---------------------------------------------------------------------------- + +class Instruction; +class AllocaInst; + +extern AllocaInst* DemoteRegToStack(Instruction& X); |