Consider some simple cases like this:
icmp ugt i64 %vscale, 1024 icmp ugt i64 (mul i64 %vscale, 32), 1024
where
%vscale = call i64 @llvm.vscale.i64()
We may know at compile time what the maximum value of vscale is
and therefore we may know the result of the comparison. In such cases
we can fold examples like those above away completely to return a
boolean value.
Tests added here:
Transforms/InstCombine/icmp-vscale.ll
Hi @dmgreen, I just realised that I can probably remove the check for m_Shl now as this should be covered by D109883