forked from OSchip/llvm-project
Add the LLVM IR unreachable instruction to the LLVMIR dialect.
http://llvm.org/docs/LangRef.html#unreachable-instruction Closes tensorflow/mlir#64 PiperOrigin-RevId: 262301557
This commit is contained in:
parent
f56494f537
commit
881b238d7e
|
@ -300,6 +300,11 @@ def LLVM_ReturnOp : LLVM_TerminatorOp<"return", []> {
|
|||
let parser = [{ return parseReturnOp(parser, result); }];
|
||||
let printer = [{ printReturnOp(p, *this); }];
|
||||
}
|
||||
def LLVM_UnreachableOp : LLVM_TerminatorOp<"unreachable", []> {
|
||||
string llvmBuilder = [{ builder.CreateUnreachable(); }];
|
||||
let parser = [{ return success(); }];
|
||||
let printer = [{ *p << getOperationName(); }];
|
||||
}
|
||||
|
||||
// Pseudo-operations (do not appear in LLVM IR but necessary for the dialect to
|
||||
// work correctly).
|
||||
|
|
|
@ -825,3 +825,7 @@ func @stringconstant() -> !llvm<"i8*"> {
|
|||
llvm.return %1 : !llvm<"i8*">
|
||||
}
|
||||
|
||||
func @noreach() {
|
||||
// CHECK: unreachable
|
||||
llvm.unreachable
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue