diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-08-24 21:03:10 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-08-24 21:03:10 +0000 |
commit | df3fe55e5734c591d6af272f675389e33a42ab3d (patch) | |
tree | 1f8e94daa784ceb156e705532e1b8e954b2e29e5 | |
parent | 2730a38485af1bf0ddb3ca714e89925122f1104f (diff) |
Added function GetMemInstArgs and made FoldGetElemChain private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3503 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/CodeGen/InstrSelectionSupport.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/include/llvm/CodeGen/InstrSelectionSupport.h b/include/llvm/CodeGen/InstrSelectionSupport.h index a134e35b86..39d9d18072 100644 --- a/include/llvm/CodeGen/InstrSelectionSupport.h +++ b/include/llvm/CodeGen/InstrSelectionSupport.h @@ -37,16 +37,25 @@ int64_t GetConstantValueAsSignedInt (const Value *V, //--------------------------------------------------------------------------- -// Function: FoldGetElemChain +// Function: GetMemInstArgs // // Purpose: -// Fold a chain of GetElementPtr instructions into an equivalent -// (Pointer, IndexVector) pair. Returns the pointer Value, and -// stores the resulting IndexVector in argument chainIdxVec. +// Get the pointer value and the index vector for a memory operation +// (GetElementPtr, Load, or Store). If all indices of the given memory +// operation are constant, fold in constant indices in a chain of +// preceding GetElementPtr instructions (if any), and return the +// pointer value of the first instruction in the chain. +// All folded instructions are marked so no code is generated for them. +// +// Return values: +// Returns the pointer Value to use. +// Returns the resulting IndexVector in idxVec. +// Returns true/false in allConstantIndices if all indices are/aren't const. //--------------------------------------------------------------------------- -Value* FoldGetElemChain (const InstructionNode* getElemInstrNode, - std::vector<Value*>& chainIdxVec); +Value* GetMemInstArgs (const InstructionNode* memInstrNode, + vector<Value*>& idxVec, + bool& allConstantIndices); //------------------------------------------------------------------------ |