[ConstantFold] Handle vectors in ConstantFoldLoadThroughBitcast()
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 6 Mar 2021 11:14:48 +0000 (12:14 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 6 Mar 2021 11:17:56 +0000 (12:17 +0100)
commitedf7004851519464f86b0f641da4d6c9506decb1
tree974f0406f57d8a4825c7fa527a8bf62115575ca9
parentbe58465591c777ab942efef5fb22b84715fc776b
[ConstantFold] Handle vectors in ConstantFoldLoadThroughBitcast()

There seems to be an impedance mismatch between what the type
system considers an aggregate (structs and arrays) and what
constants consider an aggregate (structs, arrays and vectors).

Rather than adjusting the type check, simply drop it entirely,
as getAggregateElement() is well-defined for non-aggregates: It
simply returns null in that case.
llvm/lib/Analysis/ConstantFolding.cpp
llvm/test/Transforms/GVN/non-integral-pointers-inseltpoison.ll
llvm/test/Transforms/GVN/non-integral-pointers.ll