[IR] Convert null-pointer-is-valid into an enum attribute
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 25 Apr 2020 10:57:07 +0000 (12:57 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 15 May 2020 17:41:07 +0000 (19:41 +0200)
commitf89f7da999f362e4213c69923328dd1033276e59
tree63f17f52b9d77ffec7c62fe9c5332603d83f007f
parent9de4ee3815db2b49960e931bcc3c0cc6a28ad0de
[IR] Convert null-pointer-is-valid into an enum attribute

The "null-pointer-is-valid" attribute needs to be checked by many
pointer-related combines. To make the check more efficient, convert
it from a string into an enum attribute.

In the future, this attribute may be replaced with data layout
properties.

Differential Revision: https://reviews.llvm.org/D78862
79 files changed:
clang/lib/CodeGen/CGCall.cpp
clang/test/CodeGen/delete-null-pointer-checks.c
llvm/docs/LangRef.rst
llvm/include/llvm/Bitcode/LLVMBitCodes.h
llvm/include/llvm/IR/Attributes.td
llvm/include/llvm/IR/AutoUpgrade.h
llvm/lib/AsmParser/LLLexer.cpp
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/AsmParser/LLToken.h
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/lib/IR/Attributes.cpp
llvm/lib/IR/AutoUpgrade.cpp
llvm/lib/IR/Function.cpp
llvm/lib/IR/Verifier.cpp
llvm/lib/Transforms/Utils/CodeExtractor.cpp
llvm/test/Analysis/MemorySSA/cyclicphi.ll
llvm/test/Analysis/ValueTracking/assume.ll
llvm/test/Bitcode/attributes.ll
llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll
llvm/test/Transforms/Attributor/align.ll
llvm/test/Transforms/Attributor/nocapture-1.ll
llvm/test/Transforms/Attributor/nonnull.ll
llvm/test/Transforms/Attributor/norecurse.ll
llvm/test/Transforms/Attributor/undefined_behavior.ll
llvm/test/Transforms/CorrelatedValuePropagation/non-null.ll
llvm/test/Transforms/FunctionAttrs/nocapture.ll
llvm/test/Transforms/FunctionAttrs/nonnull.ll
llvm/test/Transforms/GVN/PRE/2018-06-08-pre-load-dbgloc-no-null-opt.ll
llvm/test/Transforms/GlobalOpt/MallocSROA-section-no-null-opt.ll
llvm/test/Transforms/GlobalOpt/heap-sra-1-no-null-opt.ll
llvm/test/Transforms/GlobalOpt/heap-sra-1.ll
llvm/test/Transforms/GlobalOpt/heap-sra-2-no-null-opt.ll
llvm/test/Transforms/GlobalOpt/heap-sra-2.ll
llvm/test/Transforms/GlobalOpt/heap-sra-3-no-null-opt.ll
llvm/test/Transforms/GlobalOpt/heap-sra-3.ll
llvm/test/Transforms/GlobalOpt/heap-sra-4-no-null-opt.ll
llvm/test/Transforms/GlobalOpt/heap-sra-4.ll
llvm/test/Transforms/GlobalOpt/heap-sra-phi-no-null-opt.ll
llvm/test/Transforms/GlobalOpt/heap-sra-phi.ll
llvm/test/Transforms/GlobalOpt/load-store-global-no-null-opt.ll
llvm/test/Transforms/GlobalOpt/malloc-promote-1-no-null-opt.ll
llvm/test/Transforms/GlobalOpt/malloc-promote-1.ll
llvm/test/Transforms/GlobalOpt/malloc-promote-2-no-null-opt.ll
llvm/test/Transforms/GlobalOpt/malloc-promote-2.ll
llvm/test/Transforms/GlobalOpt/storepointer-compare-no-null-opt.ll
llvm/test/Transforms/GlobalOpt/storepointer-no-null-opt.ll
llvm/test/Transforms/IPConstantProp/PR26044.ll
llvm/test/Transforms/Inline/attributes.ll
llvm/test/Transforms/InstCombine/atomic.ll
llvm/test/Transforms/InstCombine/invariant.group.ll
llvm/test/Transforms/InstCombine/invoke.ll
llvm/test/Transforms/InstCombine/lifetime-no-null-opt.ll
llvm/test/Transforms/InstCombine/load.ll
llvm/test/Transforms/InstCombine/mem-deref-bytes.ll
llvm/test/Transforms/InstCombine/memchr.ll
llvm/test/Transforms/InstCombine/memcpy-addrspace.ll
llvm/test/Transforms/InstCombine/memcpy-from-global.ll
llvm/test/Transforms/InstCombine/memrchr.ll
llvm/test/Transforms/InstCombine/select.ll
llvm/test/Transforms/InstCombine/store.ll
llvm/test/Transforms/InstCombine/strchr-1.ll
llvm/test/Transforms/InstCombine/strcpy_chk-64.ll
llvm/test/Transforms/InstCombine/strlen-1.ll
llvm/test/Transforms/InstCombine/strncat-2.ll
llvm/test/Transforms/InstCombine/strncmp-1.ll
llvm/test/Transforms/InstCombine/strrchr-1.ll
llvm/test/Transforms/InstCombine/strstr-1.ll
llvm/test/Transforms/InstCombine/wcslen-1.ll
llvm/test/Transforms/InstSimplify/compare.ll
llvm/test/Transforms/LoopIdiom/pr28196.ll
llvm/test/Transforms/LoopVersioning/lcssa.ll
llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll
llvm/test/Transforms/SimplifyCFG/invoke.ll
llvm/test/Transforms/SimplifyCFG/phi-undef-loadstore.ll
llvm/test/Transforms/SimplifyCFG/trap-no-null-opt-debugloc.ll
llvm/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll
llvm/test/Transforms/Util/assume-builder.ll
mlir/test/Target/llvmir.mlir