[PATCH] D14599: [safestack] Rewrite isAllocaSafe using SCEV.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 11 16:59:17 PST 2015


eugenis created this revision.
eugenis added a reviewer: pcc.
eugenis added a subscriber: llvm-commits.
eugenis set the repository for this revision to rL LLVM.
Herald added a subscriber: sanjoy.

Use ScalarEvolution to calculate memory access bounds.
Handle function calls based on readnone/nocapture attributes.
Handle memory intrinsics with constant size.

This change improves both recall and precision of IsAllocaSafe.
See the new tests (ex. BitCastWide) for the kind of code that was wrongly
classified as safe.

SCEV efficiency seems to be limited by the fact the SafeStack runs late
(in CodeGenPrepare), and many loops are unrolled or otherwise not in LCSSA.


Repository:
  rL LLVM

http://reviews.llvm.org/D14599

Files:
  lib/Transforms/Instrumentation/SafeStack.cpp
  test/Transforms/SafeStack/call.ll
  test/Transforms/SafeStack/cast.ll
  test/Transforms/SafeStack/ret.ll
  test/Transforms/SafeStack/store.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14599.39993.patch
Type: text/x-patch
Size: 23734 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151112/edd3bee1/attachment.bin>


More information about the llvm-commits mailing list