[GISel] Check useLoadStackGuardNode() before generating LOAD_STACK_GUARD
authorKai Nacke <kai.peter.nacke@ibm.com>
Mon, 11 Jul 2022 18:32:42 +0000 (14:32 -0400)
committerKai Nacke <kai.nacke@de.ibm.com>
Tue, 12 Jul 2022 15:44:42 +0000 (11:44 -0400)
commit42f7364fcb239a4d57b54a20244a1564314455a8
tree5e7f6b04e106a2eadb638e02b24fca35e260b634
parenta280043b523182ab6bb3ce5caf75e931a26eaf3f
[GISel] Check useLoadStackGuardNode() before generating LOAD_STACK_GUARD

When lowering llvm::stackprotect intrinsic, the SDAG implementation
checks useLoadStackGuardNode() to either create a LOAD_STACK_GUARD or use
the first argument of the intrinsic. This check is not present in the
IRTranslator, which results in always generating a LOAD_STACK_GUARD even
if the target does not support it.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D129505
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/test/CodeGen/PowerPC/GlobalISel/ppc-irtranslator-stackprotect.ll [new file with mode: 0644]