From: Vikram S. Adve Date: Mon, 1 Oct 2001 00:18:12 +0000 (+0000) Subject: Add vector `implicitUses' to class MachineCodeForVMInstr to hold values X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=2a97dd1fc335cb8fd87c1fe6fada5f64006712c8;p=oota-llvm.git Add vector `implicitUses' to class MachineCodeForVMInstr to hold values that are used by the VM instruction but not explicit operands of the m/c instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@684 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index fa96a53e45b..c9c5c51ed19 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -363,29 +363,36 @@ public: // // Purpose: // Representation of the sequence of machine instructions created -// for a single VM instruction. Additionally records any temporary -// "values" used as intermediate values in this sequence. -// Note that such values should be treated as pure SSA values with -// no interpretation of their operands (i.e., as a TmpInstruction object -// which actually represents such a value). +// for a single VM instruction. Additionally records information +// about hidden and implicit values used by the machine instructions: +// +// (1) "Temporary values" are intermediate values used in the machine +// instruction sequence, but not in the VM instruction +// Note that such values should be treated as pure SSA values with +// no interpretation of their operands (i.e., as a TmpInstruction +// object which actually represents such a value). +// +// (2) "Implicit uses" are values used in the VM instruction but not in +// the machine instruction sequence // //--------------------------------------------------------------------------- class MachineCodeForVMInstr: public vector { private: - vector tempVec; + vector< Value*> tempVec; // used by m/c instr but not VM instr + vector implicitUses; // used by VM instr but not m/c instr public: /*ctor*/ MachineCodeForVMInstr () {} /*ctor*/ ~MachineCodeForVMInstr (); - const vector& - getTempValues () const { return tempVec; } + const vector< Value*>& getTempValues () const { return tempVec; } + const vector& getImplicitUses() const { return implicitUses; } + + void addTempValue ( Value* val) { tempVec.push_back(val); } + void addImplicitUse(const Value* val) { implicitUses.push_back(val);} - void addTempValue (Value* val) - { tempVec.push_back(val); } - // dropAllReferences() - This function drops all references within // temporary (hidden) instructions created in implementing the original // VM intruction. This ensures there are no remaining "uses" within @@ -396,7 +403,7 @@ public: inline void dropAllReferences() { for (unsigned i=0, N=tempVec.size(); i < N; i++) if (Instruction *I = tempVec[i]->castInstruction()) - I->dropAllReferences(); + I->dropAllReferences(); } };