GlobalISel: translate "unreachable" (into nothing)

Easiest instruction ever!

llvm-svn: 277225
This commit is contained in:
Tim Northover 2016-07-29 22:41:55 +00:00
parent 5fb414d870
commit 5fc93b75d9
2 changed files with 13 additions and 0 deletions

View File

@ -269,6 +269,9 @@ bool IRTranslator::translate(const Instruction &Inst) {
case Instruction::Alloca:
return translateStaticAlloca(cast<AllocaInst>(Inst));
case Instruction::Unreachable:
return true;
default:
llvm_unreachable("Opcode not supported");
}

View File

@ -271,3 +271,13 @@ define void @intrinsics(i32 %cur, i32 %bits) {
call void @llvm.aarch64.neon.st2.v8i8.p0i8(<8 x i8> %vec, <8 x i8> %vec, i8* %ptr)
ret void
}
; CHECK-LABEL: name: unreachable
; CHECK: G_ADD
; CHECK-NEXT: {{^$}}
; CHECK-NEXT: ...
define void @unreachable(i32 %a) {
%sum = add i32 %a, %a
unreachable
}