[PATCH] D100408: [ValueTracking][InstSimplify] improve efficiency for detecting non-zero value

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 13 13:01:17 PDT 2021


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LG, but please apply the two changes separately.



================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:2232
+      if (!StartC->isNullValue() && !StepC->isNullValue())
+        return true;
+    }
----------------
I'd directly `return !StartC->isNullValue() && !StepC->isNullValue();` here and below.

As a side note, the requirement that `StepC` is non-zero is unnecessary here -- which also means that we don't need it to be a constant. But that's independent of your patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100408/new/

https://reviews.llvm.org/D100408



More information about the llvm-commits mailing list