[llvm] c1bf3df - [NFC][StackLifetime] Remove local variable

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 23:07:17 PDT 2022


Author: Vitaly Buka
Date: 2022-09-27T23:07:03-07:00
New Revision: c1bf3df576d09a76ee7d485d1cb7ea7c791f488e

URL: https://github.com/llvm/llvm-project/commit/c1bf3df576d09a76ee7d485d1cb7ea7c791f488e
DIFF: https://github.com/llvm/llvm-project/commit/c1bf3df576d09a76ee7d485d1cb7ea7c791f488e.diff

LOG: [NFC][StackLifetime] Remove local variable

Added: 
    

Modified: 
    llvm/lib/Analysis/StackLifetime.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/StackLifetime.cpp b/llvm/lib/Analysis/StackLifetime.cpp
index 162fd75c73e0..0374c9c04944 100644
--- a/llvm/lib/Analysis/StackLifetime.cpp
+++ b/llvm/lib/Analysis/StackLifetime.cpp
@@ -200,6 +200,11 @@ void StackLifetime::calculateLocalLiveness() {
         }
       }
 
+      // Update block LiveIn set, noting whether it has changed.
+      if (LocalLiveIn.test(BlockInfo.LiveIn)) {
+        BlockInfo.LiveIn |= LocalLiveIn;
+      }
+
       // Compute LiveOut by subtracting out lifetimes that end in this
       // block, then adding in lifetimes that begin in this block.  If
       // we have both BEGIN and END markers in the same basic block
@@ -207,19 +212,13 @@ void StackLifetime::calculateLocalLiveness() {
       // because we already handle the case where the BEGIN comes
       // before the END when collecting the markers (and building the
       // BEGIN/END vectors).
-      BitVector LocalLiveOut = LocalLiveIn;
-      LocalLiveOut.reset(BlockInfo.End);
-      LocalLiveOut |= BlockInfo.Begin;
-
-      // Update block LiveIn set, noting whether it has changed.
-      if (LocalLiveIn.test(BlockInfo.LiveIn)) {
-        BlockInfo.LiveIn |= LocalLiveIn;
-      }
+      LocalLiveIn.reset(BlockInfo.End);
+      LocalLiveIn |= BlockInfo.Begin;
 
       // Update block LiveOut set, noting whether it has changed.
-      if (LocalLiveOut.test(BlockInfo.LiveOut)) {
+      if (LocalLiveIn.test(BlockInfo.LiveOut)) {
         Changed = true;
-        BlockInfo.LiveOut |= LocalLiveOut;
+        BlockInfo.LiveOut |= LocalLiveIn;
       }
     }
   } // while changed.


        


More information about the llvm-commits mailing list