[Analysis] isDereferenceableAndAlignedPointer(): recurse into select's hands
authorRoman Lebedev <lebedev.ri@gmail.com>
Fri, 9 Apr 2021 21:31:56 +0000 (00:31 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Fri, 9 Apr 2021 21:56:28 +0000 (00:56 +0300)
commit077bff39d46364035a5dcfa32fc69910ad0975d0
treebb125d668e537244529013b0265ab57bbffa494c
parent99d6e31e0bd02d484c213a7446fd707c62dec45b
[Analysis] isDereferenceableAndAlignedPointer(): recurse into select's hands

By doing this within the method itself,
we support traversing multiple levels of selects (TODO: PHI's),
fixing the SROA `std::clamp()` testcase.

Fixes https://bugs.llvm.org/show_bug.cgi?id=47271
Mostly fixes https://bugs.llvm.org/show_bug.cgi?id=49909
llvm/lib/Analysis/Loads.cpp
llvm/test/Transforms/SROA/std-clamp.ll