[llvm-commits] [vector_llvm] CVS: llvm/lib/Bytecode/Writer/Writer.cpp
Robert Bocchino
bocchino at cs.uiuc.edu
Tue Oct 18 12:22:22 PDT 2005
Changes in directory llvm/lib/Bytecode/Writer:
Writer.cpp updated: 1.108 -> 1.108.2.1
---
Log message:
Initial commit of Vector LLVM.
---
Diffs of the changes: (+20 -5)
Writer.cpp | 25 ++++++++++++++++++++-----
1 files changed, 20 insertions(+), 5 deletions(-)
Index: llvm/lib/Bytecode/Writer/Writer.cpp
diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.108 llvm/lib/Bytecode/Writer/Writer.cpp:1.108.2.1
--- llvm/lib/Bytecode/Writer/Writer.cpp:1.108 Wed Aug 17 14:23:14 2005
+++ llvm/lib/Bytecode/Writer/Writer.cpp Tue Oct 18 14:21:57 2005
@@ -234,8 +234,8 @@
break;
}
- case Type::PackedTyID: {
- const PackedType *PT = cast<PackedType>(T);
+ case Type::FixedVectorTyID: {
+ const FixedVectorType *PT = cast<FixedVectorType>(T);
int Slot = Table.getSlot(PT->getElementType());
assert(Slot != -1 && "Type used but not available!!");
output_typeid((unsigned)Slot);
@@ -268,6 +268,14 @@
break;
}
+ case Type::VectorTyID: {
+ const VectorType *VT = cast<VectorType>(T);
+ int Slot = Table.getSlot(VT->getElementType());
+ assert(Slot != -1 && "Type used but not available!!");
+ output_vbr((unsigned)Slot);
+ break;
+ }
+
case Type::OpaqueTyID:
// No need to emit anything, just the count of opaque types is enough.
break;
@@ -342,8 +350,8 @@
break;
}
- case Type::PackedTyID: {
- const ConstantPacked *CP = cast<ConstantPacked>(CPV);
+ case Type::FixedVectorTyID: {
+ const ConstantVector *CP = cast<ConstantVector>(CPV);
for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) {
int Slot = Table.getSlot(CP->getOperand(i));
@@ -432,7 +440,7 @@
output_typeid(Type); // Result type
unsigned NumArgs = I->getNumOperands();
- output_vbr(NumArgs + (isa<CastInst>(I) ||
+ output_vbr(NumArgs + (isa<CastInst>(I) || isa<CombineInst>(I) ||
isa<VAArgInst>(I) || Opcode == 56 || Opcode == 58));
if (!isa<GetElementPtrInst>(&I)) {
@@ -446,6 +454,10 @@
int Slot = Table.getSlot(I->getType());
assert(Slot != -1 && "Cast return type unknown?");
output_typeid((unsigned)Slot);
+ } else if (const CombineInst *CI = dyn_cast<CombineInst>(I)) {
+ int Slot = Table.getSlot(I->getOperand(1)->getType());
+ assert(Slot != -1 && "Combine operand 1 type unknown?");
+ output_typeid((unsigned)Slot);
} else if (Opcode == 56) { // Invoke escape sequence
output_vbr(cast<InvokeInst>(I)->getCallingConv());
} else if (Opcode == 58) { // Call escape sequence
@@ -637,11 +649,14 @@
const Type *Ty;
switch (I.getOpcode()) {
case Instruction::Select:
+ case Instruction::VSelect:
case Instruction::Malloc:
case Instruction::Alloca:
+ case Instruction::VImm:
Ty = I.getType(); // These ALWAYS want to encode the return type
break;
case Instruction::Store:
+ case Instruction::VScatter:
Ty = I.getOperand(1)->getType(); // Encode the pointer type...
assert(isa<PointerType>(Ty) && "Store to nonpointer type!?!?");
break;
More information about the llvm-commits
mailing list