Restrict scope of variables [NFC]
authorPhilip Reames <listmail@philipreames.com>
Thu, 18 Feb 2016 19:45:31 +0000 (19:45 +0000)
committerPhilip Reames <listmail@philipreames.com>
Thu, 18 Feb 2016 19:45:31 +0000 (19:45 +0000)
llvm-svn: 261250

llvm/lib/CodeGen/AtomicExpandPass.cpp

index d12fdb246984e9db8949340221ec2935d99883ba..88db509f0076b2f38bfbade3927786400e3ce943 100644 (file)
@@ -99,9 +99,9 @@ bool AtomicExpand::runOnFunction(Function &F) {
     assert((LI || SI || RMWI || CASI || isa<FenceInst>(I)) &&
            "Unknown atomic instruction");
 
-    auto FenceOrdering = Monotonic;
-    bool IsStore, IsLoad;
     if (TLI->getInsertFencesForAtomic()) {
+      auto FenceOrdering = Monotonic;
+      bool IsStore, IsLoad;
       if (LI && isAtLeastAcquire(LI->getOrdering())) {
         FenceOrdering = LI->getOrdering();
         LI->setOrdering(Monotonic);