[llvm] r287013 - AMDGPU: Replace assert(false) with unreachable
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 15 11:34:37 PST 2016
Author: arsenm
Date: Tue Nov 15 13:34:37 2016
New Revision: 287013
URL: http://llvm.org/viewvc/llvm-project?rev=287013&view=rev
Log:
AMDGPU: Replace assert(false) with unreachable
Modified:
llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
llvm/trunk/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
llvm/trunk/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h
Modified: llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp?rev=287013&r1=287012&r2=287013&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp Tue Nov 15 13:34:37 2016
@@ -1056,7 +1056,7 @@ bool AMDGPUAsmParser::AddNextRegisterToL
RegWidth++;
return true;
default:
- assert(false); return false;
+ llvm_unreachable("unexpected register kind");
}
}
@@ -1178,7 +1178,7 @@ bool AMDGPUAsmParser::ParseAMDGPURegiste
}
default:
- assert(false); return false;
+ llvm_unreachable("unexpected register kind");
}
if (!subtargetHasRegister(*TRI, Reg))
@@ -2462,7 +2462,7 @@ void AMDGPUAsmParser::cvtMIMG(MCInst &In
} else if (Op.isImmModifier()) {
OptionalIdx[Op.getImmTy()] = I;
} else {
- assert(false);
+ llvm_unreachable("unexpected operand type");
}
}
@@ -2498,7 +2498,7 @@ void AMDGPUAsmParser::cvtMIMGAtomic(MCIn
} else if (Op.isImmModifier()) {
OptionalIdx[Op.getImmTy()] = I;
} else {
- assert(false);
+ llvm_unreachable("unexpected operand type");
}
}
@@ -2708,7 +2708,7 @@ void AMDGPUAsmParser::cvtVOP3(MCInst &In
} else if (Op.isImm()) {
OptionalIdx[Op.getImmTy()] = I;
} else {
- assert(false);
+ llvm_unreachable("unhandled operand type");
}
}
Modified: llvm/trunk/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp?rev=287013&r1=287012&r2=287013&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp Tue Nov 15 13:34:37 2016
@@ -230,12 +230,14 @@ MCOperand AMDGPUDisassembler::createSReg
// 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);
}
@@ -475,6 +477,12 @@ bool AMDGPUSymbolizer::tryAddingSymbolic
return false;
}
+void AMDGPUSymbolizer::tryAddingPcLoadReferenceComment(raw_ostream &cStream,
+ int64_t Value,
+ uint64_t Address) {
+ llvm_unreachable("unimplemented");
+}
+
//===----------------------------------------------------------------------===//
// Initialization
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h?rev=287013&r1=287012&r2=287013&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h (original)
+++ llvm/trunk/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h Tue Nov 15 13:34:37 2016
@@ -114,9 +114,7 @@ public:
void tryAddingPcLoadReferenceComment(raw_ostream &cStream,
int64_t Value,
- uint64_t Address) override {
- assert(false && "Implement if needed");
- }
+ uint64_t Address) override;
};
} // namespace llvm
More information about the llvm-commits
mailing list