[Intrinsics] Add initial support for NonNull attribute
authorAlexander Shaposhnikov <ashaposhnikov@google.com>
Tue, 16 Aug 2022 21:25:19 +0000 (21:25 +0000)
committerAlexander Shaposhnikov <ashaposhnikov@google.com>
Tue, 16 Aug 2022 21:28:23 +0000 (21:28 +0000)
commitd68ba43ad24791181280fdb0f34b6be380db7a32
tree65c7bbf29bdb81cd455ff364ad25c5a2a84af851
parent585f62be1a438ca132aa443e556d102bc908a072
[Intrinsics] Add initial support for NonNull attribute

Add initial support for NonNull attribute.
(https://github.com/llvm/llvm-project/issues/57113)

Test plan:

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

Differential revision: https://reviews.llvm.org/D131872
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