GlobalISel: set correct regclass for LOAD_STACK_GUARD.

Since it's not actually a generic MI, its register operands need a RegClass,
which is conveniently the target's pointer RegClass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293335 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Tim Northover 2017-01-27 21:31:24 +00:00
parent 5041a6cc20
commit 946288f92c
2 changed files with 3 additions and 1 deletions

View File

@ -477,6 +477,8 @@ bool IRTranslator::translateMemcpy(const CallInst &CI,
void IRTranslator::getStackGuard(unsigned DstReg,
MachineIRBuilder &MIRBuilder) {
const TargetRegisterInfo *TRI = MF->getSubtarget().getRegisterInfo();
MRI->setRegClass(DstReg, TRI->getPointerRegClass(*MF));
auto MIB = MIRBuilder.buildInstr(TargetOpcode::LOAD_STACK_GUARD);
MIB.addDef(DstReg);

View File

@ -1,4 +1,4 @@
; RUN: llc -mtriple=aarch64-apple-ios %s -stop-after=irtranslator -o - -global-isel | FileCheck %s
; RUN: llc -verify-machineinstrs -mtriple=aarch64-apple-ios %s -stop-after=irtranslator -o - -global-isel | FileCheck %s
; CHECK: name: test_stack_guard