1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

[ValueTracking] Short-circuit GEP known bits calculation (NFC)

Don't compute known bits of all GEP operands, if we already know
that we don't know anything.
This commit is contained in:
Nikita Popov 2020-05-02 11:47:04 +02:00
parent 7ebedbc5c8
commit f4d2738f55

View File

@ -1454,6 +1454,10 @@ static void computeKnownBitsFromOperator(const Operator *I,
gep_type_iterator GTI = gep_type_begin(I);
for (unsigned i = 1, e = I->getNumOperands(); i != e; ++i, ++GTI) {
// TrailZ can only become smaller, short-circuit if we hit zero.
if (TrailZ == 0)
break;
Value *Index = I->getOperand(i);
if (StructType *STy = GTI.getStructTypeOrNull()) {
// Handle struct member offset arithmetic.