HomePhabricator

[ConstantFold] Handle vectors in ConstantFoldLoadThroughBitcast()

Authored by nikic on Mar 6 2021, 3:14 AM.

Description

[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.