[instsimplify] When compare allocas, consider their minimal size
authorPhilip Reames <listmail@philipreames.com>
Thu, 17 Feb 2022 17:50:32 +0000 (09:50 -0800)
committerPhilip Reames <listmail@philipreames.com>
Thu, 17 Feb 2022 17:53:24 +0000 (09:53 -0800)
commitcf5e88864b286e5b3433cd2d7995fe9465d57804
treea55905770b400209ff21e095bdcdb9171f5291b2
parent9de4fc0f2d3b60542956f7e5254951d049edeb1f
[instsimplify] When compare allocas, consider their minimal size

The code was using exact sizing only, but since what we really need is just to make sure the offsets are in bounds, a minimum bound on the object size is sufficient.

To demonstrate the difference, support computing minimum sizes from obects of scalable vector type.
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/lib/Analysis/MemoryBuiltins.cpp
llvm/test/Transforms/InstSimplify/compare.ll