[PATCH] D131427: [ARM] Do not use LOAD_STACK_GUARD with ROPI/RWPI

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 9 12:41:57 PDT 2022


rengolin accepted this revision.
rengolin added inline comments.


================
Comment at: llvm/test/CodeGen/ARM/stack-guard-rwpi.ll:5
+;CHECK:        .LCPI0_0:
+;CHECK-NEXT:           .long   __stack_chk_guard(sbrel)
+define dso_local i32 @foo(i32 %t) nounwind sspstrong {
----------------
pzheng wrote:
> rengolin wrote:
> > I'm not fully aware how the stack guard works in practice, is this an example of it not lowered?
> Yes, this is an example of how the stack guard is lowered when LOAD_STACK_GUARD is not used. If LOAD_STACK_GUARD is used for rwpi/ropi (which is what this patch is trying to avoid), there is an assertion coming from lvm/lib/Target/ARM/ARMBaseInstrInfo.cpp.
> 
> void llvm::ARMBaseInstrInfo::expandLoadStackGuardBase(MachineBasicBlock::iterator, unsigned int, unsigned int) const: Assertion `!Subtarget.isROPI() && !Subtarget.isRWPI() && "ROPI/RWPI not currently supported with stack guard"' failed.
> 
> This patch basically prevents the assertion from happening since we already know ropi/rwpi are not supported with LOAD_STACK_GUARD yet .
Ack, makes sense, just checking, thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131427/new/

https://reviews.llvm.org/D131427



More information about the llvm-commits mailing list