Skip to content

Commit c0313be

Browse files
yuri91alexp-sssup
authored andcommitted
icf: support the fence instruction
1 parent b08b9a5 commit c0313be

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/CheerpUtils/IdenticalCodeFolding.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,12 @@ bool IdenticalCodeFolding::equivalentInstruction(const llvm::Instruction* A, con
571571
equivalentOperand(a->getCompareOperand(), b->getCompareOperand()) &&
572572
equivalentOperand(a->getNewValOperand(), b->getNewValOperand()));
573573
}
574+
case Instruction::Fence:
575+
{
576+
const FenceInst* a = cast<FenceInst>(A);
577+
const FenceInst* b = cast<FenceInst>(B);
578+
return CacheAndReturn(a->getOrdering() == b->getOrdering() && a->getSyncScopeID() == b->getSyncScopeID());
579+
}
574580
default:
575581
{
576582
#ifndef NDEBUG

0 commit comments

Comments
 (0)