[PATCH] D49602: Use SCEV to avoid inserting some bounds checks.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 20 10:04:55 PDT 2018


eugenis added a comment.

This looks about right.
Do the tests cover cases where only one or two of the checks can be omitted, but not all of them? Does not look that way.



================
Comment at: lib/Transforms/Instrumentation/BoundsChecking.cpp:211
+  LoopInfo LI(DT);
+  ScalarEvolution SE(F, TLI, ACT, DT, LI);
 
----------------
Non-legacy pass should request ScalarEvolution from the analysis manager instead of recomputing it.


================
Comment at: lib/Transforms/Instrumentation/BoundsChecking.cpp:233
+    ScalarEvolution SE(F, TLI, ACT, DT, LI);
+    return addBoundsChecking(F, TLI, SE);
   }
----------------
Legacy pass should also request SCEV with getAnalysis.

If you were looking at SafeStack, the difference is that SafeStack is added to the pipeline unconditionally and needs to avoid computing SCEV for functions without the attribute, while this pass is only added by the frontend when needed and runs on most functions it sees.

See SafeStack code prior to https://reviews.llvm.org/D31302



Repository:
  rL LLVM

https://reviews.llvm.org/D49602





More information about the llvm-commits mailing list