llvm.org GIT mirror llvm / 94687ac
add some abbrevs for ret and unreachable, shrinking kc++ from 2717360->2705388 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36823 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 12 years ago
1 changed file(s) with 31 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
4242 CONSTANTS_NULL_Abbrev,
4343
4444 // FUNCTION_BLOCK abbrev id's.
45 FUNCTION_INST_LOAD_ABBREV = bitc::FIRST_APPLICATION_ABBREV
45 FUNCTION_INST_LOAD_ABBREV = bitc::FIRST_APPLICATION_ABBREV,
46 FUNCTION_INST_RET_VOID_ABBREV,
47 FUNCTION_INST_RET_VAL_ABBREV,
48 FUNCTION_INST_UNREACHABLE_ABBREV
4649 };
4750
4851
696699
697700 case Instruction::Ret:
698701 Code = bitc::FUNC_CODE_INST_RET;
699 if (I.getNumOperands())
700 PushValueAndType(I.getOperand(0), InstID, Vals, VE);
702 if (!I.getNumOperands())
703 AbbrevToUse = FUNCTION_INST_RET_VOID_ABBREV;
704 else if (!PushValueAndType(I.getOperand(0), InstID, Vals, VE))
705 AbbrevToUse = FUNCTION_INST_RET_VAL_ABBREV;
701706 break;
702707 case Instruction::Br:
703708 Code = bitc::FUNC_CODE_INST_BR;
739744 break;
740745 case Instruction::Unreachable:
741746 Code = bitc::FUNC_CODE_INST_UNREACHABLE;
747 AbbrevToUse = FUNCTION_INST_UNREACHABLE_ABBREV;
742748 break;
743749
744750 case Instruction::PHI:
10551061 Abbv) != FUNCTION_INST_LOAD_ABBREV)
10561062 assert(0 && "Unexpected abbrev ordering!");
10571063 }
1064 { // INST_RET abbrev for FUNCTION_BLOCK.
1065 BitCodeAbbrev *Abbv = new BitCodeAbbrev();
1066 Abbv->Add(BitCodeAbbrevOp(bitc::FUNC_CODE_INST_RET));
1067 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
1068 Abbv) != FUNCTION_INST_RET_VOID_ABBREV)
1069 assert(0 && "Unexpected abbrev ordering!");
1070 }
1071 { // INST_RET abbrev for FUNCTION_BLOCK.
1072 BitCodeAbbrev *Abbv = new BitCodeAbbrev();
1073 Abbv->Add(BitCodeAbbrevOp(bitc::FUNC_CODE_INST_RET));
1074 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // ValID
1075 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
1076 Abbv) != FUNCTION_INST_RET_VAL_ABBREV)
1077 assert(0 && "Unexpected abbrev ordering!");
1078 }
1079 { // INST_UNREACHABLE abbrev for FUNCTION_BLOCK.
1080 BitCodeAbbrev *Abbv = new BitCodeAbbrev();
1081 Abbv->Add(BitCodeAbbrevOp(bitc::FUNC_CODE_INST_UNREACHABLE));
1082 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
1083 Abbv) != FUNCTION_INST_UNREACHABLE_ABBREV)
1084 assert(0 && "Unexpected abbrev ordering!");
1085 }
10581086
10591087 Stream.ExitBlock();
10601088 }