[llvm-exegesis] Early out if the scheduler models have no extra info.

We were calling getExtraProcessorInfo() without checking hasExtraProcessorInfo(), resulting in an assertion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330263 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Simon Pilgrim 2018-04-18 14:46:54 +00:00
parent 331449e7a8
commit c5db21b266

View File

@ -57,7 +57,7 @@ namespace exegesis {
void main() {
if (OpcodeName.empty() == (OpcodeIndex == 0)) {
llvm::report_fatal_error(
"please provide one and only one of 'opcode-index' or 'opcode-name' ");
"please provide one and only one of 'opcode-index' or 'opcode-name'");
}
llvm::InitializeNativeTarget();
@ -68,6 +68,9 @@ void main() {
const LLVMState State;
if (!State.getSubtargetInfo().getSchedModel().hasExtraProcessorInfo())
llvm::report_fatal_error("sched model is missing extra processor info!");
unsigned Opcode = OpcodeIndex;
if (Opcode == 0) {
// Resolve opcode name -> opcode.