This artifact can appear from the vectorizer. (add X, -1) is the
backedge taken count. It gets zero extended and then 1 is added to
it to get the trip count.
There is usually a dominating branch that rules out X being zero.
Alive: https://alive2.llvm.org/ce/z/NsRDwX
Alternatively, we could try to fix this in the vectorizer or the
SCEV expander maybe?
Still need to add InstCombine specific test, but hopefully the vectorizer tests serve as a demonstration.
clang-format not found in user’s local PATH; not linting file.