[PATCH] D142584: [CodeGen] Add a boolean flag to `Address::getPointer` and `Lvalue::getPointer` that indicates whether the pointer is known not to be null

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 25 14:50:23 PST 2023


ahatanak created this revision.
ahatanak added reviewers: rjmccall, ab, efriedma.
ahatanak added a project: clang.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
ahatanak requested review of this revision.

The flag will be used for the arm64e work we plan to upstream in the future (see https://lists.llvm.org/pipermail/llvm-dev/2019-October/136091.html). Passing `KnownNonNull_t::True` allows clang to avoid emitting null checks on arm64e. Currently the flag has no effect on code generation on other targets.

This is the first patch and there are many more places where `KnownNonNull_t::True` can be passed. I plan to fix those places in future patches.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142584

Files:
  clang/lib/CodeGen/Address.h
  clang/lib/CodeGen/CGBlocks.cpp
  clang/lib/CodeGen/CGBuilder.h
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/CodeGen/CGCXXABI.cpp
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/CodeGen/CGClass.cpp
  clang/lib/CodeGen/CGCleanup.cpp
  clang/lib/CodeGen/CGDecl.cpp
  clang/lib/CodeGen/CGException.cpp
  clang/lib/CodeGen/CGExpr.cpp
  clang/lib/CodeGen/CGExprAgg.cpp
  clang/lib/CodeGen/CGExprCXX.cpp
  clang/lib/CodeGen/CGExprScalar.cpp
  clang/lib/CodeGen/CGNonTrivialStruct.cpp
  clang/lib/CodeGen/CGValue.h
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/ItaniumCXXABI.cpp
  clang/lib/CodeGen/MicrosoftCXXABI.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142584.492261.patch
Type: text/x-patch
Size: 30888 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230125/00770640/attachment-0001.bin>


More information about the cfe-commits mailing list