diff options
author | Martin Storsjo <martin@martin.st> | 2018-08-30 08:06:50 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2018-08-30 08:06:50 +0000 |
commit | 22dcddf6510ca540b380fdc04a02311b0e299c14 (patch) | |
tree | 70a2869304e187dacf702eedd1092eabe193a692 /llvm/lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | edf11fd4500da15f0de49ed0854ff85e4b66966f (diff) | |
download | bcm5719-llvm-22dcddf6510ca540b380fdc04a02311b0e299c14.tar.gz bcm5719-llvm-22dcddf6510ca540b380fdc04a02311b0e299c14.zip |
Revert "[SimplifyCFG] Common debug handling [NFC]"
This reverts commit r340997.
This change turned out not to be NFC after all, but e.g. causes
clang to crash when building the linux kernel for aarch64.
llvm-svn: 341031
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 62a635fa38e..b2b8c248b99 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -2694,6 +2694,8 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, unsigned BonusInstThreshold) { // all instructions before Cond other than DbgInfoIntrinsic are bonus // instructions. for (auto BonusInst = BB->begin(); Cond != &*BonusInst; ++BonusInst) { + if (isa<DbgInfoIntrinsic>(BonusInst)) + continue; Instruction *NewBonusInst = BonusInst->clone(); RemapInstruction(NewBonusInst, VMap, RF_NoModuleLevelChanges | RF_IgnoreMissingLocals); @@ -2821,6 +2823,12 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, unsigned BonusInstThreshold) { // TODO: If BB is reachable from all paths through PredBlock, then we // could replace PBI's branch probabilities with BI's. + + // Copy any debug value intrinsics into the end of PredBlock. + for (Instruction &I : *BB) + if (isa<DbgInfoIntrinsic>(I)) + I.clone()->insertBefore(PBI); + return true; } return false; |