FailedChanges

Summary

  1. [NFC] BasicBlock: generalize replaceSuccessorsPhiUsesWith(), take Old bb Thus it does not assume that the old basic block is the basic block for which we are looking at successors. Not reviewed, but seems rather trivial, in line with the rest of previous few patches.
  2. [NFC] BasicBlock: refactor changePhiUses() out of replacePhiUsesWith(), use it Summary: It is a common thing to loop over every `PHINode` in some `BasicBlock` and change old `BasicBlock` incoming block to a new `BasicBlock` incoming block. `replaceSuccessorsPhiUsesWith()` already had code to do that, it just wasn't a function. So outline it into a new function, and use it. Reviewers: chandlerc, craig.topper, spatel, danielcdh Reviewed By: craig.topper Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61013
  3. [NFC] PHINode: introduce replaceIncomingBlockWith() function, use it Summary: There is `PHINode::getBasicBlockIndex()`, `PHINode::setIncomingBlock()` and `PHINode::getNumOperands()`, but no function to replace every specified `BasicBlock*` predecessor with some other specified `BasicBlock*`. Clearly, there are a lot of places that could use that functionality. Reviewers: chandlerc, craig.topper, spatel, danielcdh Reviewed By: craig.topper Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61011
  4. [NFC] Instruction: introduce replaceSuccessorWith() function, use it Summary: There is `Instruction::getNumSuccessors()`, `Instruction::getSuccessor()` and `Instruction::setSuccessor()`, but no function to replace every specified `BasicBlock*` successor with some other specified `BasicBlock*`. I've found one place where it should clearly be used. Reviewers: chandlerc, craig.topper, spatel, danielcdh Reviewed By: craig.topper Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61010
  5. [NFC][Utils] deleteDeadLoop(): add an assert that exit block has some non-PHI instruction Summary: If `deleteDeadLoop()` is called on such a loop, that has "bad" exit block, one that e.g. has no terminator instruction, the `DIBuilder::insertDbgValueIntrinsic()` will be told to insert the Dbg Value Intrinsic after `nullptr` (since there is no first non-PHI instruction), which will cause it to not insert those instructions into any basic block. The instructions will be parent-less, and IR verifier will complain. It is rather obvious to track down the root cause when that happens, so let's just assert it never happens. Reviewers: sanjoy, davide, vsk Reviewed By: vsk Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61008
Revision 359997 by lebedevri:
[NFC] BasicBlock: generalize replaceSuccessorsPhiUsesWith(), take Old bb

Thus it does not assume that the old basic block is the basic block
for which we are looking at successors.

Not reviewed, but seems rather trivial, in line with the rest of
previous few patches.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/include/llvm/IR/BasicBlock.htrunk/include/llvm/IR/BasicBlock.h
The file was modified/llvm/trunk/lib/IR/BasicBlock.cpptrunk/lib/IR/BasicBlock.cpp
Revision 359996 by lebedevri:
[NFC] BasicBlock: refactor changePhiUses() out of replacePhiUsesWith(), use it

Summary:
It is a common thing to loop over every `PHINode` in some `BasicBlock`
and change old `BasicBlock` incoming block to a new `BasicBlock` incoming block.
`replaceSuccessorsPhiUsesWith()` already had code to do that,
it just wasn't a function.
So outline it into a new function, and use it.

Reviewers: chandlerc, craig.topper, spatel, danielcdh

Reviewed By: craig.topper

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61013
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/include/llvm/IR/BasicBlock.htrunk/include/llvm/IR/BasicBlock.h
The file was modified/llvm/trunk/lib/CodeGen/CodeGenPrepare.cpptrunk/lib/CodeGen/CodeGenPrepare.cpp
The file was modified/llvm/trunk/lib/IR/BasicBlock.cpptrunk/lib/IR/BasicBlock.cpp
The file was modified/llvm/trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpptrunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
The file was modified/llvm/trunk/lib/Transforms/Scalar/LoopInterchange.cpptrunk/lib/Transforms/Scalar/LoopInterchange.cpp
Revision 359995 by lebedevri:
[NFC] PHINode: introduce replaceIncomingBlockWith() function, use it

Summary:
There is `PHINode::getBasicBlockIndex()`, `PHINode::setIncomingBlock()`
and `PHINode::getNumOperands()`, but no function to replace every
specified `BasicBlock*` predecessor with some other specified `BasicBlock*`.
Clearly, there are a lot of places that could use that functionality.

Reviewers: chandlerc, craig.topper, spatel, danielcdh

Reviewed By: craig.topper

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61011
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/include/llvm/IR/Instructions.htrunk/include/llvm/IR/Instructions.h
The file was modified/llvm/trunk/lib/CodeGen/CodeGenPrepare.cpptrunk/lib/CodeGen/CodeGenPrepare.cpp
The file was modified/llvm/trunk/lib/IR/BasicBlock.cpptrunk/lib/IR/BasicBlock.cpp
The file was modified/llvm/trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpptrunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
The file was modified/llvm/trunk/lib/Transforms/Scalar/LoopInterchange.cpptrunk/lib/Transforms/Scalar/LoopInterchange.cpp
Revision 359994 by lebedevri:
[NFC] Instruction: introduce replaceSuccessorWith() function, use it

Summary:
There is `Instruction::getNumSuccessors()`, `Instruction::getSuccessor()`
and `Instruction::setSuccessor()`, but no function to replace every
specified `BasicBlock*` successor with some other specified `BasicBlock*`.
I've found one place where it should clearly be used.

Reviewers: chandlerc, craig.topper, spatel, danielcdh

Reviewed By: craig.topper

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61010
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/include/llvm/IR/Instruction.htrunk/include/llvm/IR/Instruction.h
The file was modified/llvm/trunk/lib/IR/Instruction.cpptrunk/lib/IR/Instruction.cpp
The file was modified/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpptrunk/lib/Transforms/Utils/LoopSimplify.cpp
Revision 359993 by lebedevri:
[NFC][Utils] deleteDeadLoop(): add an assert that exit block has some non-PHI instruction

Summary:
If `deleteDeadLoop()` is called on such a loop, that has "bad" exit block,
one that e.g. has no terminator instruction, the `DIBuilder::insertDbgValueIntrinsic()`
will be told to insert the Dbg Value Intrinsic after `nullptr`
(since there is no first non-PHI instruction), which will cause it to not insert
those instructions into any basic block. The instructions will be parent-less,
and IR verifier will complain. It is rather obvious to track down the root cause
when that happens, so let's just assert it never happens.

Reviewers: sanjoy, davide, vsk

Reviewed By: vsk

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61008
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Transforms/Utils/LoopUtils.cpptrunk/lib/Transforms/Utils/LoopUtils.cpp