We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9cccde2 commit ab6bcb2Copy full SHA for ab6bcb2
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -463,6 +463,11 @@ static bool dominatesMergePoint(
463
if (!isSafeToSpeculativelyExecute(I, InsertPt, AC))
464
return false;
465
466
+ // Overflow arithmetic instruction plus extract value are usually generated
467
+ // when a division is being replaced. But, in this case, the zero check may
468
+ // still be kept in the code. In that case it would be worth to hoist these
469
+ // two instruction out of the basic block. Let's treat this pattern as one
470
+ // single cheap instruction here!
471
WithOverflowInst *OverflowInst;
472
if (match(I, m_ExtractValue<1>(m_OneUse(m_WithOverflowInst(OverflowInst))))) {
473
ZeroCostInstructions.insert(OverflowInst);
0 commit comments