[llvm] r371937 - [GlobalISel] findGISelOptimalMemOpLowering - remove dead initalization. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 15 09:56:06 PDT 2019


Author: rksimon
Date: Sun Sep 15 09:56:06 2019
New Revision: 371937

URL: http://llvm.org/viewvc/llvm-project?rev=371937&view=rev
Log:
[GlobalISel] findGISelOptimalMemOpLowering - remove dead initalization. NFCI.

Fixes static analyzer warning that "Value stored to 'NewTySize' during its initialization is never read".

Modified:
    llvm/trunk/lib/CodeGen/GlobalISel/CombinerHelper.cpp

Modified: llvm/trunk/lib/CodeGen/GlobalISel/CombinerHelper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/CombinerHelper.cpp?rev=371937&r1=371936&r2=371937&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/CombinerHelper.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/CombinerHelper.cpp Sun Sep 15 09:56:06 2019
@@ -673,10 +673,8 @@ static bool findGISelOptimalMemOpLowerin
       // SDAGisms map cleanly to GISel concepts.
       if (NewTy.isVector())
         NewTy = NewTy.getSizeInBits() > 64 ? LLT::scalar(64) : LLT::scalar(32);
+      NewTy = LLT::scalar(PowerOf2Floor(NewTy.getSizeInBits() - 1));
       unsigned NewTySize = NewTy.getSizeInBytes();
-
-      NewTy = LLT::scalar(PowerOf2Floor(NewTy.getSizeInBits()-1));
-      NewTySize = NewTy.getSizeInBytes();
       assert(NewTySize > 0 && "Could not find appropriate type");
 
       // If the new LLT cannot cover all of the remaining bits, then consider




More information about the llvm-commits mailing list