Skip to content

Commit

Permalink
AMDGPU: Replace assert(false) with unreachable
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287013 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
arsenm committed Nov 15, 2016
1 parent 4e7cf47 commit 7946b10
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
10 changes: 5 additions & 5 deletions lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ bool AMDGPUAsmParser::AddNextRegisterToList(unsigned& Reg, unsigned& RegWidth, R
RegWidth++;
return true;
default:
assert(false); return false;
llvm_unreachable("unexpected register kind");
}
}

Expand Down Expand Up @@ -1178,7 +1178,7 @@ bool AMDGPUAsmParser::ParseAMDGPURegister(RegisterKind& RegKind, unsigned& Reg,
}

default:
assert(false); return false;
llvm_unreachable("unexpected register kind");
}

if (!subtargetHasRegister(*TRI, Reg))
Expand Down Expand Up @@ -2462,7 +2462,7 @@ void AMDGPUAsmParser::cvtMIMG(MCInst &Inst, const OperandVector &Operands) {
} else if (Op.isImmModifier()) {
OptionalIdx[Op.getImmTy()] = I;
} else {
assert(false);
llvm_unreachable("unexpected operand type");
}
}

Expand Down Expand Up @@ -2498,7 +2498,7 @@ void AMDGPUAsmParser::cvtMIMGAtomic(MCInst &Inst, const OperandVector &Operands)
} else if (Op.isImmModifier()) {
OptionalIdx[Op.getImmTy()] = I;
} else {
assert(false);
llvm_unreachable("unexpected operand type");
}
}

Expand Down Expand Up @@ -2708,7 +2708,7 @@ void AMDGPUAsmParser::cvtVOP3(MCInst &Inst, const OperandVector &Operands) {
} else if (Op.isImm()) {
OptionalIdx[Op.getImmTy()] = I;
} else {
assert(false);
llvm_unreachable("unhandled operand type");
}
}

Expand Down
14 changes: 11 additions & 3 deletions lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,14 @@ MCOperand AMDGPUDisassembler::createSRegOperand(unsigned SRegClassID,
// ToDo: unclear if s[88:104] is available on VI. Can we use VCC as SGPR in
// this bundle?
default:
assert(false);
break;
llvm_unreachable("unhandled register class");
}
if (Val % (1 << shift))

if (Val % (1 << shift)) {
*CommentStream << "Warning: " << getRegClassName(SRegClassID)
<< ": scalar reg isn't aligned " << Val;
}

return createRegOperand(SRegClassID, Val >> shift);
}

Expand Down Expand Up @@ -475,6 +477,12 @@ bool AMDGPUSymbolizer::tryAddingSymbolicOperand(MCInst &Inst,
return false;
}

void AMDGPUSymbolizer::tryAddingPcLoadReferenceComment(raw_ostream &cStream,
int64_t Value,
uint64_t Address) {
llvm_unreachable("unimplemented");
}

//===----------------------------------------------------------------------===//
// Initialization
//===----------------------------------------------------------------------===//
Expand Down
4 changes: 1 addition & 3 deletions lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ class AMDGPUSymbolizer : public MCSymbolizer {

void tryAddingPcLoadReferenceComment(raw_ostream &cStream,
int64_t Value,
uint64_t Address) override {
assert(false && "Implement if needed");
}
uint64_t Address) override;
};

} // namespace llvm
Expand Down

0 comments on commit 7946b10

Please sign in to comment.