From: Konrad Dobros Date: Tue, 6 Oct 2020 17:33:41 +0000 (-0400) Subject: [mlir][spirv] Fix extended insts deserialization generation X-Git-Tag: llvmorg-13-init~9972 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9f1c50fc092fa99ba3f527a7401205a59a73c45;p=platform%2Fupstream%2Fllvm.git [mlir][spirv] Fix extended insts deserialization generation This change replaces container used for storing temporary strings for generated code to std::list. SmallVector may reallocate internal data, which will invalidate references when more than one extended instruction set is generated. Reviewed By: mravishankar, antiagainst Differential Revision: https://reviews.llvm.org/D88626 --- diff --git a/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp b/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp index 21f7349..442afc1 100644 --- a/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp +++ b/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp @@ -27,6 +27,8 @@ #include "llvm/TableGen/Record.h" #include "llvm/TableGen/TableGenBackend.h" +#include + using llvm::ArrayRef; using llvm::formatv; using llvm::raw_ostream; @@ -1031,7 +1033,7 @@ emitExtendedSetDeserializationDispatch(const RecordKeeper &recordKeeper, // raw_string_ostream needs a string&, use a vector to store all the string // that are captured by reference within raw_string_ostream. StringMap extensionSets; - SmallVector extensionSetNames; + std::list extensionSetNames; initExtendedSetDeserializationDispatch(extensionSetName, instructionID, words, os);