[SimplifyCFG] Fix if conversion with opaque pointers
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 21 Jul 2021 20:22:26 +0000 (22:22 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 21 Jul 2021 20:24:07 +0000 (22:24 +0200)
commitaa5adc0c1cd011c4861b609c0cf0db3221289810
tree14c6f8654a43d5579edd25b15de992b76449ad9b
parenta8f1ec5d6710c2b2c25eadccf58f010a2f2334c0
[SimplifyCFG] Fix if conversion with opaque pointers

We need to make sure that the value types are the same. Otherwise
we both may not have the necessary dereferenceability implication,
nor can we directly form the desired select pattern.

Without opaque pointers this is enforced implicitly through the
pointer comparison.
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/speculate-store.ll