@@ -77,6 +77,7 @@ enum TypeKind {
77
77
78
78
enum CastKind {
79
79
CastKindSignExt = 0 ,
80
+ CastKindZeroExt = 1 ,
80
81
};
81
82
82
83
// A predicate used in a numeric comparison.
@@ -843,7 +844,7 @@ class YkIRWriter {
843
844
844
845
void serialiseCastKind (enum CastKind Cast) { OutStreamer.emitInt8 (Cast); }
845
846
846
- // / Serialise a cast-like insruction .
847
+ // / Serialise a cast-like instruction .
847
848
void serialiseSExtInst (SExtInst *I, FuncLowerCtxt &FLCtxt, unsigned BBIdx,
848
849
unsigned &InstIdx) {
849
850
// opcode:
@@ -859,6 +860,22 @@ class YkIRWriter {
859
860
InstIdx++;
860
861
}
861
862
863
+ // / Serialise a cast-like instruction.
864
+ void serialiseZExtInst (ZExtInst *I, FuncLowerCtxt &FLCtxt, unsigned BBIdx,
865
+ unsigned &InstIdx) {
866
+ // opcode:
867
+ serialiseOpcode (OpCodeCast);
868
+ // cast_kind:
869
+ serialiseCastKind (CastKindZeroExt);
870
+ // val:
871
+ serialiseOperand (I, FLCtxt, I->getOperand (0 ));
872
+ // dest_type_idx:
873
+ OutStreamer.emitSizeT (typeIndex (I->getDestTy ()));
874
+
875
+ FLCtxt.updateVLMap (I, InstIdx);
876
+ InstIdx++;
877
+ }
878
+
862
879
void serialiseSwitchInst (SwitchInst *I, FuncLowerCtxt &FLCtxt, unsigned BBIdx,
863
880
unsigned &InstIdx) {
864
881
// opcode:
@@ -925,6 +942,7 @@ class YkIRWriter {
925
942
INST_SERIALISE (I, LoadInst, serialiseLoadInst);
926
943
INST_SERIALISE (I, PHINode, serialisePhiInst);
927
944
INST_SERIALISE (I, ReturnInst, serialiseReturnInst);
945
+ INST_SERIALISE (I, ZExtInst, serialiseZExtInst);
928
946
INST_SERIALISE (I, SExtInst, serialiseSExtInst);
929
947
INST_SERIALISE (I, StoreInst, serialiseStoreInst);
930
948
INST_SERIALISE (I, SwitchInst, serialiseSwitchInst);
0 commit comments