[llvm] r293335 - GlobalISel: set correct regclass for LOAD_STACK_GUARD.

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 13:31:25 PST 2017


Author: tnorthover
Date: Fri Jan 27 15:31:24 2017
New Revision: 293335

URL: http://llvm.org/viewvc/llvm-project?rev=293335&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
    llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator-stackprotect.ll

Modified: llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp?rev=293335&r1=293334&r2=293335&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp Fri Jan 27 15:31:24 2017
@@ -477,6 +477,8 @@ bool IRTranslator::translateMemcpy(const
 
 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);
 

Modified: llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator-stackprotect.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator-stackprotect.ll?rev=293335&r1=293334&r2=293335&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator-stackprotect.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator-stackprotect.ll Fri Jan 27 15:31:24 2017
@@ -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




More information about the llvm-commits mailing list