jgalenson added a comment.

In https://reviews.llvm.org/D49492#1167064, @efriedma wrote:

> Are you sure this will actually do what you want, in general?  I suspect it 
> will end up missing bounds checks in some cases because it's running it too 
> early (before mem2reg/inlining/etc).


No, I'm not sure; that's one reason I'm asking for comments.  But I don't see 
any specific problems.  For example, I don't see why inlining would matter; the 
checks should still be added, just before inlining instead of after (which of 
course affects the inlining heuristic, but that's another matter).  I don't 
understand mem2reg as well, though.  Do you have specific examples you think 
might fail?

I was thinking about this in terms of other sanitizers I know, specifically the 
integer overflow sanitizer.  That adds overflow checks in Clang, which is 
before all of these LLVM passes.  So my thought was that moving bounds checks 
to be inserted earlier brings it closer to how the integer overflow sanitizer 
works.


Repository:
  rC Clang

https://reviews.llvm.org/D49492



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to