1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

[MergeICmps] Try to fix MSVC build failure

Apparently this fails to line up the types -- try to sidestep the
issue entirely by writing the code in a more reasonable way: Walk
over the operands and perform a set lookup, rather than walking
over the set and performing an operand scan.
This commit is contained in:
Nikita Popov 2021-07-26 17:29:07 +02:00
parent 24ba96f75f
commit fa9a368e39

View File

@ -256,11 +256,10 @@ bool BCECmpBlock::canSinkBCECmpInst(const Instruction *Inst,
}
// Make sure this instruction does not use any of the BCE cmp block
// instructions as operand.
for (auto BI : BlockInsts) {
if (is_contained(Inst->operands(), BI))
return false;
}
return true;
return llvm::none_of(Inst->operands(), [&](const Value *Op) {
const Instruction *OpI = dyn_cast<Instruction>(Op);
return OpI && BlockInsts.contains(OpI);
});
}
void BCECmpBlock::split(BasicBlock *NewParent, AliasAnalysis &AA) const {