Files
clang-p2996/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
Florian Hahn 0af5c0668a [InstCombine] Don't consider aligned_alloc removable if icmp uses result (#69474)
At the moment, all alloc-like functions are assumed to return non-null
pointers, if their return value is only used in a compare. This is based
on being allowed to substitute the allocation function with one that
doesn't fail to allocate the required memory.

aligned_alloc however must also return null if the required alignment
cannot be satisfied, so I don't think the same reasoning as above can be
applied to it.

This patch adds a bail-out for aligned_alloc calls to
isAllocSiteRemovable.
2023-10-19 18:35:27 +01:00

174 KiB