ROPI/RWPI are not supported with LOAD_STACK_GUARD currently.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for reviewing the patch, @nickdesaulniers. I have added a test for the change.
llvm/test/CodeGen/ARM/stack-guard-rwpi.ll | ||
---|---|---|
2 | Perhaps add a second RUN line with another relocation model showing that you do see the stack guard? Maybe even a third, for ROPI, just to make sure neither of them are removed by accident in the future. | |
6 | I'm not fully aware how the stack guard works in practice, is this an example of it not lowered? |
llvm/test/CodeGen/ARM/stack-guard-rwpi.ll | ||
---|---|---|
2 | Makes sense to me, will add two more RUN lines as you suggested. | |
6 | 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 . |
llvm/test/CodeGen/ARM/stack-guard-rwpi.ll | ||
---|---|---|
6 | Ack, makes sense, just checking, thanks! |
Perhaps add a second RUN line with another relocation model showing that you do see the stack guard?
Maybe even a third, for ROPI, just to make sure neither of them are removed by accident in the future.