Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 9e96445

Browse files
TNorthoverahmedbougacha
authored andcommitted
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 (cherry picked from commit 946288f)
1 parent 1b793ce commit 9e96445

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/CodeGen/GlobalISel/IRTranslator.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,8 @@ bool IRTranslator::translateMemcpy(const CallInst &CI,
477477

478478
void IRTranslator::getStackGuard(unsigned DstReg,
479479
MachineIRBuilder &MIRBuilder) {
480+
const TargetRegisterInfo *TRI = MF->getSubtarget().getRegisterInfo();
481+
MRI->setRegClass(DstReg, TRI->getPointerRegClass(*MF));
480482
auto MIB = MIRBuilder.buildInstr(TargetOpcode::LOAD_STACK_GUARD);
481483
MIB.addDef(DstReg);
482484

test/CodeGen/AArch64/GlobalISel/arm64-irtranslator-stackprotect.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc -mtriple=aarch64-apple-ios %s -stop-after=irtranslator -o - -global-isel | FileCheck %s
1+
; RUN: llc -verify-machineinstrs -mtriple=aarch64-apple-ios %s -stop-after=irtranslator -o - -global-isel | FileCheck %s
22

33

44
; CHECK: name: test_stack_guard

0 commit comments

Comments
 (0)