[SimplifyCFG] mergeConditionalStoreToAddress(): try to pacify MSAN
authorRoman Lebedev <lebedev.ri@gmail.com>
Wed, 18 Sep 2019 21:04:39 +0000 (21:04 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Wed, 18 Sep 2019 21:04:39 +0000 (21:04 +0000)
MSAN bot complains that there is use-of-uninitialized-value
of this FreeStores later in IsWorthwhile().
Perhaps FreeStores needs to be stored in a vector?

llvm-svn: 372262

llvm/lib/Transforms/Utils/SimplifyCFG.cpp

index 5ce19b1..f1f16ee 100644 (file)
@@ -3022,7 +3022,7 @@ static bool mergeConditionalStoreToAddress(BasicBlock *PTB, BasicBlock *PFB,
     return true;
   };
 
-  ArrayRef<StoreInst *> FreeStores = {PStore, QStore};
+  const SmallVector<StoreInst *, 2> FreeStores = {PStore, QStore};
   if (!MergeCondStoresAggressively &&
       (!IsWorthwhile(PTB, FreeStores) || !IsWorthwhile(PFB, FreeStores) ||
        !IsWorthwhile(QTB, FreeStores) || !IsWorthwhile(QFB, FreeStores)))