StackProtector: ensure stack checks are inserted before the tail call
authorLiqiang Tao <taolq@outlook.com>
Fri, 16 Sep 2022 14:15:15 +0000 (22:15 +0800)
committerLiqiang Tao <taolq@outlook.com>
Fri, 16 Sep 2022 14:24:46 +0000 (22:24 +0800)
commit2e37557fdeed381e8e790e20702ededb13c9cef3
tree3179a30cf820f7915d1cbc75b6cb4b3e4b73c19c
parent1b445cada51e247116ef934c3394bcc6f22589f7
StackProtector: ensure stack checks are inserted before the tail call

The IR stack protector pass should insert stack checks before the tail
calls not only the musttail calls. So that the attributes `ssqreq` and
`tail call`, which are emited by llvm-opt, could be both enabled by
llvm-llc.

Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D133860
llvm/lib/CodeGen/StackProtector.cpp
llvm/test/CodeGen/AArch64/stack-protector-musttail.ll
llvm/test/CodeGen/ARM/Windows/stack-protector-musttail.ll
llvm/test/CodeGen/X86/stack-protector-musttail.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/tailcc-ssp.ll