[llvm] Optimize count leading ones if promoted type (PR #99591)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 24 04:47:05 PDT 2024
================
@@ -2298,8 +2298,29 @@ static bool despeculateCountZeros(IntrinsicInst *CountZeros,
if (match(CountZeros->getOperand(1), m_One()))
return false;
- // If it's cheap to speculate, there's nothing to do.
Type *Ty = CountZeros->getType();
+ EVT VTy = TLI->getValueType(*DL, Ty);
+
+ // do not despeculate if we have (ctlz (xor op -1)) if the operand is
----------------
arsenm wrote:
The vector case is skipped above, so I guess it doesn't matter.
The problem with checking the promotion logic like this, and in many other places, is there may be multiple type legalization steps before the operation is legal, so this isn't a 100% accurate way of determining the type this will ultimately use
https://github.com/llvm/llvm-project/pull/99591
More information about the llvm-commits
mailing list