[PowerPC] Fix wrong codegen when stack pointer has to realign in prologue
authorKai Luo <lkail@cn.ibm.com>
Wed, 22 Jul 2020 04:13:18 +0000 (04:13 +0000)
committerKai Luo <lkail@cn.ibm.com>
Wed, 22 Jul 2020 06:35:12 +0000 (06:35 +0000)
commit8912252252c87d8ef6623ecf9fdde444560ee4b9
tree843804c68711f42ebc31413104bda09e87e7b79a
parente9f5ca0b7977bb3886feae0d35617a0ea9349a2a
[PowerPC] Fix wrong codegen when stack pointer has to realign in prologue

Current powerpc backend generates wrong code sequence if stack pointer
has to realign if -fstack-clash-protection enabled. When probing in
prologue, backend should generate a subtraction instruction rather
than a `stux` instruction to realign the stack pointer.

This patch is part of fix of
https://bugs.llvm.org/show_bug.cgi?id=46759.

Differential Revision: https://reviews.llvm.org/D84218
llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
llvm/test/CodeGen/PowerPC/pr46759.ll