[PATCH] D64759: [CodeGen] Don't resolve the stack protector frame accesses until PEI
Oliver Stannard (Linaro) via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 24 06:19:19 PDT 2019
ostannard added inline comments.
Herald added a subscriber: wuzish.
================
Comment at: llvm/test/CodeGen/Thumb/stack_guard_remat.ll:6
;PIC: foo2
+;PIC: ldr {{r[0-9]+}}, {{LCPI[0-9_]+}}
;PIC: ldr [[R0:r[0-9]+]], [[LABEL0:LCPI[0-9_]+]]
----------------
john.brawn wrote:
> It would be better here to check that this value is being used to construct a stack offset that's being loaded from (i.e. check that we have ldr ra, LCP; add ra, SP; ldr rb, [ra]). Also it would be good to have an explicit check that the stack canary address isn't being spilled at the start of the function.
I think this comment still needs addressing - this just checks that a value is loaded from a constant pool. What we want to test is the sequence `ldr r0, LCPI0_0; add r0, sp; ldr r0, [r0]`, which loads the stack protector without relying on any potentially-spilled values.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64759/new/
https://reviews.llvm.org/D64759
More information about the llvm-commits
mailing list