[PATCH] D81242: [StackSafety] Run ThinLTO

Vitaly Buka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 12 18:15:29 PDT 2020


vitalybuka added inline comments.


================
Comment at: llvm/lib/Analysis/StackSafetyAnalysis.cpp:618
+    ConstantRange Access = Found->sextOrTrunc(Use.Range.getBitWidth());
+    if (Access.signedAddMayOverflow(C.Offset) !=
+        ConstantRange::OverflowResult::NeverOverflows)
----------------
eugenis wrote:
> vitalybuka wrote:
> > eugenis wrote:
> > > Do we have a test for this overflow check?
> > yes
> > Example, in bit width 8
> > [-128,-127)+[-128,-127) = [0,1)
> > both non-wrapped and result is non-wrapped so we have no way to spot overflow
> Sure. I was asking if we have a testcase that covers the overflow check.
I've extracted this into function and added test to cover that.
It is possible to test this check, however we discussed clamping offsets to something more useful, e.g. 2^(ptrwidth/2). This way we will not be able to hit this check.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81242/new/

https://reviews.llvm.org/D81242





More information about the cfe-commits mailing list