[ConstantFold] Delay fetching pointer element type
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 22 Jun 2021 10:00:42 +0000 (12:00 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 22 Jun 2021 13:51:00 +0000 (15:51 +0200)
commite638a290f7d0bb85dbf81ba34eaaeef8c8d1b42d
treee84f082754ab2bea951c9dc8d7d5dabe1f216ad9
parent87bdde4962ea926e81a3534119ac8f02901b75b9
[ConstantFold] Delay fetching pointer element type

Don't do this while stipping pointer casts, instead fetch it at
the end. This improves compatibility with opaque pointers for the
case where the base object is not opaque.
llvm/lib/Analysis/ConstantFolding.cpp
llvm/test/Transforms/InstCombine/opaque-ptr.ll