[PATCH] D62936: Fix a bug w/inbounds invalidation in LFTR

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 17:57:02 PDT 2019


reames created this revision.
reames added a reviewer: nikic.
Herald added subscribers: sanjoy, bollu, mcrosier.
Herald added a project: LLVM.

(Mostly for discussion, not yet ready for real review)

This contains fixes for two cases where we might invalidate inbounds and leave it stale in the IR (a miscompile).  Case 1 is when switching to an IV with no dynamically live uses, and case 2 is when doing pre-to-post conversion on the same pointer type IV.

Regardless of whether we actually take this approach for the bugs, the move from hasConcreteDef to the programHasUB approach is worthwhile.  Several test cases *improve* substantially with only that part.

In fact, the fix for case 1 is minor in terms of test quality, possible a positive.  It's case 2 which is seen to have fairly wide impact (as expected).  The core question is, do we have a better approach for case 2?


Repository:
  rL LLVM

https://reviews.llvm.org/D62936

Files:
  lib/Transforms/Scalar/IndVarSimplify.cpp
  test/Transforms/IndVarSimplify/2011-10-27-lftrnull.ll
  test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll
  test/Transforms/IndVarSimplify/lftr-address-space-pointers.ll
  test/Transforms/IndVarSimplify/lftr-reuse.ll
  test/Transforms/IndVarSimplify/lftr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62936.203270.patch
Type: text/x-patch
Size: 27610 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190606/f5cccf16/attachment-0001.bin>


More information about the llvm-commits mailing list