[llvm] [CodeGen] Remove redundant vector checks (NFC) (PR #99524)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 11:39:36 PDT 2024


================
@@ -5226,6 +5224,8 @@ MachineInstr *CombinerHelper::buildUDivUsingMul(MachineInstr &MI) {
     // TODO: Use undef values for divisor of 1.
     if (!Divisor.isOne()) {
 
+      unsigned KnownLeadingZeros =
----------------
topperc wrote:

This will get called for every element of a vector, but will always calculate the same value since it's using `LHS` which doesn't change. This is bad for compile time.

Either put it back where it was or count the leading zeros of `C`.

https://github.com/llvm/llvm-project/pull/99524


More information about the llvm-commits mailing list