[llvm] [SimplifyCFG] Treat umul + extract pattern as cheap single instruction. (PR #124933)
Gábor Spaits via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 2 08:41:56 PST 2025
================
@@ -3324,26 +3338,36 @@ bool SimplifyCFGOpt::speculativelyExecuteBB(BranchInst *BI,
HoistLoadsStoresWithCondFaultingThreshold;
// Not count load/store into cost if target supports conditional faulting
// b/c it's cheap to speculate it.
+ WithOverflowInst *OI;
if (IsSafeCheapLoadStore)
SpeculatedConditionalLoadsStores.push_back(&I);
+ else if (match(&I,
+ m_ExtractValue<1>(m_OneUse(
+ m_WithOverflowInst(OI))))) {
+ MaxSpeculatedInstructionsToHoist = 3;
----------------
spaits wrote:
And when we match the pattern, we are consuming one instruction from the pattern, so you are also right here, we shall increment counter.
Sorry for not paying attention to this earlier.
https://github.com/llvm/llvm-project/pull/124933
More information about the llvm-commits
mailing list