This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Update implied reasoning to accept expanded cmp (NFC).
ClosedPublic

Authored by fhahn on Feb 5 2020, 9:02 AM.

Details

Summary

This patch adds versions of isImpliedCondition and
isImpliedByDomCondition that take a predicate, LHS and RHS operands as
instead of a Value representing the condition.

This allows using those functions to check conditions without having a
concrete ICmp instruction.

Diff Detail

Event Timeline

fhahn created this revision.Feb 5 2020, 9:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 5 2020, 9:02 AM
Herald added a subscriber: hiraditya. · View Herald Transcript

Unit tests: unknown.

clang-tidy: pass.

clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.

Build artifacts: clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

nikic accepted this revision.Feb 5 2020, 9:33 AM

LG, seems like a reasonable extension.

PS: What's up with the clang-format spam? Looks entirely bogus.

llvm/lib/Analysis/ValueTracking.cpp
5687–5688

Something went wrong with the //// here.

5714

Add comment for what the pair means? (Cond and CondIsTrue)

This revision is now accepted and ready to land.Feb 5 2020, 9:33 AM
fhahn marked 2 inline comments as done.Feb 7 2020, 2:26 AM

Thanks for taking a look!

PS: What's up with the clang-format spam? Looks entirely bogus.

Not sure TBH, it seems like some kind of glitch. I'll make sure to run clang-format before committing.

This revision was automatically updated to reflect the committed changes.