[GVNHoist] add cast to unbreak windows build

Follow up to
commit 831e99fee9 ("[GVNHoist] don't hoist callbr users into the callbr's block")

Looks like MSVC has trouble with llvm::is_contained. Unbreak the build.

Link: https://lab.llvm.org/buildbot/#/builders/127/builds/45021/steps/7/logs/stdio

Reviewed By: hans, kuhar

Differential Revision: https://reviews.llvm.org/D145969
This commit is contained in:
Nick Desaulniers 2023-03-13 11:22:25 -07:00
parent bcad161db3
commit b7a33893f5

View File

@ -816,7 +816,7 @@ void GVNHoist::checkSafety(CHIArgs C, BasicBlock *BB, GVNHoist::InsKind K,
// If the Terminator is some kind of "exotic terminator" that produces a
// value (such as InvokeInst, CallBrInst, or CatchSwitchInst) which the CHI
// uses, it is not safe to hoist the use above the def.
if (!T->use_empty() && is_contained(Insn->operands(), T))
if (!T->use_empty() && is_contained(Insn->operands(), cast<const Value>(T)))
continue;
if (K == InsKind::Scalar) {
if (safeToHoistScalar(BB, Insn->getParent(), NumBBsOnAllPaths))