[PATCH] D131872: [Intrinsics] Add initial support for NonNull attribute

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 14 22:00:22 PDT 2022


alexander-shaposhnikov created this revision.
alexander-shaposhnikov added reviewers: nikic, ChuanqiXu.
alexander-shaposhnikov created this object with visibility "All Users".
Herald added a subscriber: pengfei.
Herald added a project: All.
alexander-shaposhnikov requested review of this revision.
Herald added subscribers: cfe-commits, jdoerfert.
Herald added projects: clang, LLVM.

Add initial support for NonNull attribute.

Test plan:
1/ ninja check-all
2/ verify that for 
__thread int x;
int main() {

  int* y = &x;
  return *y;

}
(with this patch) clang -O -fsanitize=null -S -emit-llvm -o - 
doesn't emit a  null-pointer check


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131872

Files:
  clang/test/CodeGenCXX/threadlocal_address.cpp
  llvm/include/llvm/IR/Intrinsics.td
  llvm/test/CodeGen/X86/peephole-nofold-tpoff-x86.mir
  llvm/test/CodeGen/X86/peephole-nofold-tpoff-x86_64.mir
  llvm/test/CodeGen/X86/threadlocal_address.ll
  llvm/utils/TableGen/CodeGenIntrinsics.h
  llvm/utils/TableGen/CodeGenTarget.cpp
  llvm/utils/TableGen/IntrinsicEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131872.452589.patch
Type: text/x-patch
Size: 6672 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220815/75ca3413/attachment.bin>


More information about the llvm-commits mailing list