Also fix a typo in the surrounding code.
Fixes: https://github.com/llvm/llvm-project/issues/62318
Reviewed By: qedawkins
Differential Revision: https://reviews.llvm.org/
D149069
static constexpr unsigned maxFreeID = 1 << 20;
-/// Returns an unsed symbol in `module` for `oldSymbolName` by trying numeric
+/// Returns an unused symbol in `module` for `oldSymbolName` by trying numeric
/// suffix in `lastUsedID`.
static StringAttr renameSymbol(StringRef oldSymName, unsigned &lastUsedID,
spirv::ModuleOp module) {
}
}
+// -----
+
+// No spir-v modules to combine.
+module {
+ func.func @foo(%arg0: i32) -> i32 {
+ return %arg0 : i32
+ }
+}
void TestModuleCombinerPass::runOnOperation() {
auto modules = llvm::to_vector<4>(getOperation().getOps<spirv::ModuleOp>());
+ if (modules.empty())
+ return;
OpBuilder combinedModuleBuilder(modules[0]);