[Mlir-commits] [mlir] c9f1c50 - [mlir][spirv] Fix extended insts deserialization generation
Lei Zhang
llvmlistbot at llvm.org
Tue Oct 6 10:36:20 PDT 2020
Author: Konrad Dobros
Date: 2020-10-06T13:34:58-04:00
New Revision: c9f1c50fc092fa99ba3f527a7401205a59a73c45
URL: https://github.com/llvm/llvm-project/commit/c9f1c50fc092fa99ba3f527a7401205a59a73c45
DIFF: https://github.com/llvm/llvm-project/commit/c9f1c50fc092fa99ba3f527a7401205a59a73c45.diff
LOG: [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
Added:
Modified:
mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
Removed:
################################################################################
diff --git a/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp b/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
index 21f7349763db..442afc14c291 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 <list>
+
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<raw_string_ostream> extensionSets;
- SmallVector<std::string, 1> extensionSetNames;
+ std::list<std::string> extensionSetNames;
initExtendedSetDeserializationDispatch(extensionSetName, instructionID, words,
os);
More information about the Mlir-commits
mailing list