Replace some of the calls to getVectorNumElements() with
getVectorElementCount(). These warnings were being hit by
this test:
llvm/test/CodeGen/AArch64/sve-gep.ll
As part of this patch I have introduced another comparison
operator in ElementCount, namely to check if one count
is > than another. However, when doing mathematical
operations we do not always know the answer at compile
time and therefore we have two functions:
bool isGT(const ElementCount &RHS, bool &Known);
bool knownGT(const ElementCount &RHS);
The first function returns true if the answer is known at
compile time to be >, otherwise it returns false. The Known
boolean is set true if the answer is known at compile time.
The second function also does the comparison, but asserts
that the answer is known at compile time.
Is it ever safe to ignore the value of Known? If not, I'd suggest making this method private so people are forced to use knownGT. Alternatively, you could define a 'compare' function and have it return an enum value saying Unknown, GT, LE etc.