[llvm] 59bd206 - [NFC][ScalarizeMaskedMemIntrin] Fix unused variable warning

Roman Lebedev via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 29 01:06:30 PST 2021


Thank you!

On Fri, Jan 29, 2021 at 10:17 AM Yang Fan via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
>
> Author: Yang Fan
> Date: 2021-01-29T15:15:58+08:00
> New Revision: 59bd2068e954e5d6d8396c4f27b94ad7f3abf3b1
>
> URL: https://github.com/llvm/llvm-project/commit/59bd2068e954e5d6d8396c4f27b94ad7f3abf3b1
> DIFF: https://github.com/llvm/llvm-project/commit/59bd2068e954e5d6d8396c4f27b94ad7f3abf3b1.diff
>
> LOG: [NFC][ScalarizeMaskedMemIntrin] Fix unused variable warning
>
> GCC warning:
> ```
> /llvm-project/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp: In function ‘void scalarizeMaskedStore(llvm::CallInst*, llvm::DomTreeUpdater*, bool&)’:
> /llvm-project/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp:295:15: warning: variable ‘IfBlock’ set but not used [-Wunused-but-set-variable]
>   295 |   BasicBlock *IfBlock = CI->getParent();
>       |               ^~~~~~~
> /llvm-project/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp: In function ‘void scalarizeMaskedScatter(llvm::CallInst*, llvm::DomTreeUpdater*, bool&)’:
> /llvm-project/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp:555:15: warning: variable ‘IfBlock’ set but not used [-Wunused-but-set-variable]
>   555 |   BasicBlock *IfBlock = CI->getParent();
>       |               ^~~~~~~
> ```
>
> Added:
>
>
> Modified:
>     llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp
>
> Removed:
>
>
>
> ################################################################################
> diff  --git a/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp b/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp
> index a520ab3c63a4..11bd92c4334b 100644
> --- a/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp
> +++ b/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp
> @@ -292,7 +292,6 @@ static void scalarizeMaskedStore(CallInst *CI, DomTreeUpdater *DTU,
>
>    IRBuilder<> Builder(CI->getContext());
>    Instruction *InsertPt = CI;
> -  BasicBlock *IfBlock = CI->getParent();
>    Builder.SetInsertPoint(InsertPt);
>    Builder.SetCurrentDebugLocation(CI->getDebugLoc());
>
> @@ -369,7 +368,6 @@ static void scalarizeMaskedStore(CallInst *CI, DomTreeUpdater *DTU,
>      // Create "else" block, fill it in the next iteration
>      BasicBlock *NewIfBlock = ThenTerm->getSuccessor(0);
>      NewIfBlock->setName("else");
> -    IfBlock = NewIfBlock;
>
>      Builder.SetInsertPoint(NewIfBlock, NewIfBlock->begin());
>    }
> @@ -552,7 +550,6 @@ static void scalarizeMaskedScatter(CallInst *CI, DomTreeUpdater *DTU,
>
>    IRBuilder<> Builder(CI->getContext());
>    Instruction *InsertPt = CI;
> -  BasicBlock *IfBlock = CI->getParent();
>    Builder.SetInsertPoint(InsertPt);
>    Builder.SetCurrentDebugLocation(CI->getDebugLoc());
>
> @@ -618,7 +615,6 @@ static void scalarizeMaskedScatter(CallInst *CI, DomTreeUpdater *DTU,
>      // Create "else" block, fill it in the next iteration
>      BasicBlock *NewIfBlock = ThenTerm->getSuccessor(0);
>      NewIfBlock->setName("else");
> -    IfBlock = NewIfBlock;
>
>      Builder.SetInsertPoint(NewIfBlock, NewIfBlock->begin());
>    }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list