[llvm] b7a3389 - [GVNHoist] add cast to unbreak windows build
Nick Desaulniers via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 13 11:23:03 PDT 2023
Author: Nick Desaulniers
Date: 2023-03-13T11:22:49-07:00
New Revision: b7a33893f59844e265aad2587fe899b83c80dfe5
URL: https://github.com/llvm/llvm-project/commit/b7a33893f59844e265aad2587fe899b83c80dfe5
DIFF: https://github.com/llvm/llvm-project/commit/b7a33893f59844e265aad2587fe899b83c80dfe5.diff
LOG: [GVNHoist] add cast to unbreak windows build
Follow up to
commit 831e99fee90e ("[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
Added:
Modified:
llvm/lib/Transforms/Scalar/GVNHoist.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/GVNHoist.cpp b/llvm/lib/Transforms/Scalar/GVNHoist.cpp
index f13b52fecba3..abe38aa2a357 100644
--- a/llvm/lib/Transforms/Scalar/GVNHoist.cpp
+++ b/llvm/lib/Transforms/Scalar/GVNHoist.cpp
@@ -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))
More information about the llvm-commits
mailing list