This is an archive of the discontinued LLVM Phabricator instance.

[IR] Value: add replaceUsesWithIf() utility
ClosedPublic

Authored by lebedev.ri on Jul 31 2019, 11:48 AM.

Details

Summary

While there is always a Value::replaceAllUsesWith(),
sometimes the replacement needs to be conditional.

I have only cleaned a few cases where replaceUsesWithIf()
could be used, to both add test coverage,
and show that it is actually useful.

Diff Detail

Repository
rL LLVM

Event Timeline

lebedev.ri created this revision.Jul 31 2019, 11:48 AM

Test plan: $ ninja check-llvm

asbirlea added inline comments.Jul 31 2019, 11:56 AM
llvm/lib/Analysis/MemorySSAUpdater.cpp
276 ↗(On Diff #212633)

Could you move this comment inside the lambda?

lebedev.ri marked an inline comment as done.

Move comment in MemorySSAUpdater.cpp

jdoerfert accepted this revision.Jul 31 2019, 12:36 PM

for (; UI != E;) aka. while (UI != E)

LGTM.

This revision is now accepted and ready to land.Jul 31 2019, 12:36 PM
This revision was automatically updated to reflect the committed changes.