[PATCH] D152275: Use memory region declaration intrinsic when generating code for array subscripts

Simeon Krastnikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 15 01:39:43 PDT 2023


simeon added a comment.

> - The compile-time overhead of creating a bunch of extra intrinsics might be significant.  Maybe we can mitigate to some extent by avoiding emitting the intrinsic in simple cases where it doesn't actually help (constant indexes?).

Yes, that would make sense.

> - User code might not actually obey the language rules; do we have any sanitizer that checks if user code trips over this?

I believe AddressSanitizer <https://clang.llvm.org/docs/AddressSanitizer.html> should be able to detect out-of-bounds accesses.

> - Not sure how this interacts with full restrict and related proposals.

So far as alias analysis goes, the two approaches should be orthogonal, but nevertheless we'd still have to go through the usual procedure of modifying the direct `GetElementPtrInst` checks and casts used by such patches.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152275



More information about the cfe-commits mailing list