diff options
author | Matthias Braun <matze@braunis.de> | 2017-09-06 20:45:24 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2017-09-06 20:45:24 +0000 |
commit | c9056b834dd7343204228a93ad54b7e8dda70dab (patch) | |
tree | 4a1d309d43e68ddec515dac260af5b5a60b53ee6 /llvm/lib/CodeGen/BranchFolding.h | |
parent | d147f522525ac091a5e3235b2c26c47733fe9ed9 (diff) | |
download | bcm5719-llvm-c9056b834dd7343204228a93ad54b7e8dda70dab.tar.gz bcm5719-llvm-c9056b834dd7343204228a93ad54b7e8dda70dab.zip |
Insert IMPLICIT_DEFS for undef uses in tail merging
Tail merging can convert an undef use into a normal one when creating a
common tail. Doing so can make the register live out from a block which
previously contained the undef use. To keep the liveness up-to-date,
insert IMPLICIT_DEFs in such blocks when necessary.
To enable this patch the computeLiveIns() function which used to
compute live-ins for a block and set them immediately is split into new
functions:
- computeLiveIns() just computes the live-ins in a LivePhysRegs set.
- addLiveIns() applies the live-ins to a block live-in list.
- computeAndAddLiveIns() is a convenience function combining the other
two functions and behaving like computeLiveIns() before this patch.
Based on a patch by Krzysztof Parzyszek <kparzysz@codeaurora.org>
Differential Revision: https://reviews.llvm.org/D37034
llvm-svn: 312668
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.h')
-rw-r--r-- | llvm/lib/CodeGen/BranchFolding.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.h b/llvm/lib/CodeGen/BranchFolding.h index 92681137e4c..f6efcb718c9 100644 --- a/llvm/lib/CodeGen/BranchFolding.h +++ b/llvm/lib/CodeGen/BranchFolding.h @@ -146,8 +146,8 @@ namespace llvm { /// Delete the instruction OldInst and everything after it, replacing it /// with an unconditional branch to NewDest. - void ReplaceTailWithBranchTo(MachineBasicBlock::iterator OldInst, - MachineBasicBlock *NewDest); + void replaceTailWithBranchTo(MachineBasicBlock::iterator OldInst, + MachineBasicBlock &NewDest); /// Given a machine basic block and an iterator into it, split the MBB so /// that the part before the iterator falls into the part starting at the @@ -182,8 +182,8 @@ namespace llvm { unsigned &commonTailIndex); /// Create merged DebugLocs of identical instructions across SameTails and - /// assign it to the instruction in common tail. - void MergeCommonTailDebugLocs(unsigned commonTailIndex); + /// assign it to the instruction in common tail; merge MMOs and undef flags. + void mergeCommonTails(unsigned commonTailIndex); bool OptimizeBranches(MachineFunction &MF); |