[PATCH] D63152: [FIX] Forces shrink wrapping to consider any memory access as aliasing with the stack

Diogo N. Sampaio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 11 10:47:23 PDT 2019


dnsampaio created this revision.
dnsampaio added reviewers: dmgreen, lebedev.ri.
Herald added subscribers: llvm-commits, javed.absar.
Herald added a project: LLVM.

Relate bug: https://bugs.llvm.org/show_bug.cgi?id=37472

The shrink wrapping pass prematurally restores the stack, at a point where the stack might still be accessed.
Taking an exception can cause the stack to be corrupted.

As a first approach, this patch is overly conservative, assuming that any instruction that may load or store could access
the stack.


Repository:
  rL LLVM

https://reviews.llvm.org/D63152

Files:
  lib/CodeGen/ShrinkWrap.cpp
  test/CodeGen/AArch64/arm64-shrink-wrapping.ll
  test/CodeGen/AArch64/branch-relax-cbz.ll
  test/CodeGen/AArch64/taildup-cfi.ll
  test/CodeGen/ARM/arm-shrink-wrapping-linux.ll
  test/CodeGen/ARM/arm-shrink-wrapping.ll
  test/CodeGen/Thumb/thumb-shrink-wrapping.ll
  test/CodeGen/X86/2010-08-04-MaskedSignedCompare.ll
  test/CodeGen/X86/MachineSink-eflags.ll
  test/CodeGen/X86/cmov.ll
  test/CodeGen/X86/copy-eflags.ll
  test/CodeGen/X86/fold-pcmpeqd-2.ll
  test/CodeGen/X86/i386-shrink-wrapping.ll
  test/CodeGen/X86/shrink-wrap-chkstk-x86_64.ll
  test/CodeGen/X86/x86-shrink-wrapping.ll
  test/CodeGen/X86/xchg-nofold.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63152.204108.patch
Type: text/x-patch
Size: 33935 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190611/e8f915c4/attachment-0001.bin>


More information about the llvm-commits mailing list