This is an archive of the discontinued LLVM Phabricator instance.

[NFC][ValueTracking] Remove calls to computeKnownBits for non-intrinsic CallInsts in isKnownNonZeroFromOperator
ClosedPublic

Authored by 0xdc03 on Aug 16 2023, 8:48 AM.

Details

Summary

For non-intrinsic CallInsts, computeKnownBits only handles range
metadata and checking getReturnedArgOperand(). Both of these are now
handled in isKnownNonZero, so there is no need to fall through to
a call to computeKnownBits anymore.

Diff Detail

Event Timeline

0xdc03 created this revision.Aug 16 2023, 8:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 16 2023, 8:48 AM
0xdc03 requested review of this revision.Aug 16 2023, 8:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 16 2023, 8:48 AM
0xdc03 added inline comments.Aug 16 2023, 8:56 AM
llvm/lib/Analysis/ValueTracking.cpp
2734

I suppose this can also be

} else if (const Value *RV = cast<CallBase>(I)->getReturnedArgOperand();
           RV && isKnownNonZero(RV, Depth, Q))
    return true;
This revision is now accepted and ready to land.Aug 16 2023, 9:42 AM