[builtin_object_size] Basic support for posix_memalign
authorserge-sans-paille <sguelton@redhat.com>
Wed, 23 Mar 2022 10:03:40 +0000 (11:03 +0100)
committerserge-sans-paille <sguelton@redhat.com>
Fri, 8 Apr 2022 07:31:11 +0000 (09:31 +0200)
commitaa15ea47e20fbce5814f4a0d69521f8270b70e69
tree7babd31744a9550c75bebc26c3bacf338182268a
parentb672638dbc7cec9a51826520e8f8aef276bac3ee
[builtin_object_size] Basic support for posix_memalign

It actually implements support for seeing through loads, using alias analysis to
refine the result.

This is rather limited, but I didn't want to rely on more than available
analysis at that point (to be gentle with compilation time), and it does seem to
catch common scenario, as showcased by the included tests.

Differential Revision: https://reviews.llvm.org/D122431
llvm/include/llvm/Analysis/MemoryBuiltins.h
llvm/lib/Analysis/MemoryBuiltins.cpp
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/LowerConstantIntrinsics/builtin-object-size-load.ll [new file with mode: 0644]
llvm/test/Transforms/LowerConstantIntrinsics/builtin-object-size-posix-memalign.ll [new file with mode: 0644]