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 Type | Path in Repository | Path in Workspace |
---|
 | /llvm/trunk/include/llvm/IR/BasicBlock.h | trunk/include/llvm/IR/BasicBlock.h |
 | /llvm/trunk/lib/IR/BasicBlock.cpp | trunk/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 Type | Path in Repository | Path in Workspace |
---|
 | /llvm/trunk/include/llvm/IR/BasicBlock.h | trunk/include/llvm/IR/BasicBlock.h |
 | /llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp | trunk/lib/CodeGen/CodeGenPrepare.cpp |
 | /llvm/trunk/lib/IR/BasicBlock.cpp | trunk/lib/IR/BasicBlock.cpp |
 | /llvm/trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp | trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp |
 | /llvm/trunk/lib/Transforms/Scalar/LoopInterchange.cpp | trunk/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 Type | Path in Repository | Path in Workspace |
---|
 | /llvm/trunk/include/llvm/IR/Instructions.h | trunk/include/llvm/IR/Instructions.h |
 | /llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp | trunk/lib/CodeGen/CodeGenPrepare.cpp |
 | /llvm/trunk/lib/IR/BasicBlock.cpp | trunk/lib/IR/BasicBlock.cpp |
 | /llvm/trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp | trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp |
 | /llvm/trunk/lib/Transforms/Scalar/LoopInterchange.cpp | trunk/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 Type | Path in Repository | Path in Workspace |
---|
 | /llvm/trunk/include/llvm/IR/Instruction.h | trunk/include/llvm/IR/Instruction.h |
 | /llvm/trunk/lib/IR/Instruction.cpp | trunk/lib/IR/Instruction.cpp |
 | /llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp | trunk/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 Type | Path in Repository | Path in Workspace |
---|
 | /llvm/trunk/lib/Transforms/Utils/LoopUtils.cpp | trunk/lib/Transforms/Utils/LoopUtils.cpp |