OSRA: improve handling of equality comparisons

Equality comparisons used to be ignored more often than required due to
the fact that they give no hint on the signedness of the tracked value.

This commits removes some assertions and improves the handling of OSRs
without a known signedness. In particular, now, inequalities can be
solved even in absence of signedness information, as long as the result
that you would get with a signed OSR and an unsigned OSR matches (i.e.,
the signedness doesn't matter).
This commit is contained in:
Alessandro Di Federico
2018-08-17 21:50:02 +02:00
parent 88e2a6eff1
commit f2e1ea68f1
3 changed files with 85 additions and 35 deletions
+1 -1
View File
@@ -545,7 +545,7 @@ bool SET::handleInstructionWithOSRA(Instruction *Target, Value *V) {
OS.explore(CI::get(Int64, O->constant()));
} else {
// Hard limit
if (O->size() >= 10000)
if (not O->boundedValue()->hasSignedness() or O->size() >= 10000)
return false;
// We have a limited range, let's use it all