[Mlir-commits] [mlir] f735b3a - [mlir] Prevent argStorage relocations

Vitaly Buka llvmlistbot at llvm.org
Fri Apr 29 11:09:45 PDT 2022


Author: Vitaly Buka
Date: 2022-04-29T11:09:32-07:00
New Revision: f735b3a2b0ce348a5e3149622325c2d676703ef0

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

LOG: [mlir] Prevent argStorage relocations

This fixes msan reports like https://reviews.llvm.org/P8285

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D124576

Added: 
    

Modified: 
    mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp b/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp
index 9030013b0568..6b6511101bc3 100644
--- a/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp
+++ b/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp
@@ -705,6 +705,7 @@ static LogicalResult simplifyPassThroughSwitch(SwitchOp op,
   SmallVector<ValueRange> newCaseOperands;
   SmallVector<SmallVector<Value>> argStorage;
   auto caseValues = op.getCaseValues();
+  argStorage.reserve(caseValues->size() + 1);
   auto caseDests = op.getCaseDestinations();
   bool requiresChange = false;
   for (int64_t i = 0, size = caseValues->size(); i < size; ++i) {


        


More information about the Mlir-commits mailing list