From 6093b14c2c1fc785bfb7040ecebfe4127e1ab9ab Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 29 Aug 2020 14:49:57 +0200 Subject: [PATCH] [InstCombine] Return replaceInstUsesWith() result (NFC) Follow the usual usage pattern for this function and return the result. --- llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp | 3 +-- llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp index 448b14e..4a7e50a 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp @@ -1439,8 +1439,7 @@ Instruction *InstCombinerImpl::visitPHINode(PHINode &PN) { continue; // Just use that PHI instead then. ++NumPHICSEs; - replaceInstUsesWith(PN, &Src); - return &PN; + return replaceInstUsesWith(PN, &Src); } } diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index 14de00f..7fd1f7d 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -975,10 +975,7 @@ Instruction *InstCombinerImpl::foldAggregateConstructionIntoAggregateReuse( PHI->addIncoming(SourceAggregates[Pred], Pred); ++NumAggregateReconstructionsSimplified; - replaceInstUsesWith(OrigIVI, PHI); - - // Just signal that the fold happened, we've already inserted instructions. - return &OrigIVI; + return replaceInstUsesWith(OrigIVI, PHI); } /// Try to find redundant insertvalue instructions, like the following ones: -- 2.7.4