This is an archive of the discontinued LLVM Phabricator instance.

[NFC] PHINode: introduce replaceIncomingBlockWith() function, use it
ClosedPublic

Authored by lebedev.ri on Apr 23 2019, 6:34 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

lebedev.ri created this revision.Apr 23 2019, 6:34 AM
craig.topper added inline comments.Apr 23 2019, 10:05 PM
include/llvm/IR/Instructions.h
2742 ↗(On Diff #196235)

Would 'replace' be more consistent with other functions than 'change'? And I think we often include 'With' at the end for methods like this. For example User::replaceUsesOfWith

lebedev.ri marked an inline comment as done.
lebedev.ri retitled this revision from [NFC] PHINode: introduce changeIncomingBlock() function, use it to [NFC] PHINode: introduce replaceIncomingBlockWith() function, use it.
craig.topper added inline comments.Apr 25 2019, 5:04 PM
include/llvm/IR/Instructions.h
2745 ↗(On Diff #196412)

Drop the temporary variable. And then you can probably drop the curly braces.

lebedev.ri marked an inline comment as done.

Address review notes.

lebedev.ri marked an inline comment as done.Apr 26 2019, 12:49 AM
lebedev.ri added inline comments.
lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
1366 ↗(On Diff #196811)

This one is weird.
replacePHIBlock() would already iterate over every operand, so it's basically dead code i suppose.

This revision is now accepted and ready to land.May 5 2019, 10:09 AM
This revision was automatically updated to reflect the committed changes.