Skip to content

Commit 204d89f

Browse files
fix more tests
1 parent 0fd0c2c commit 204d89f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,10 @@ static void restoreByValRefArgumentType(
284284
for (const auto &[arg, oldArg, byValRefAttr] :
285285
llvm::zip(funcOp.getArguments(), oldBlockArgs, byValRefNonPtrAttrs)) {
286286
// Skip argument if no `llvm.byval` or `llvm.byref` attribute.
287-
if (!byValRefAttr)
287+
if (!byValRefAttr) {
288+
llvm::errs() << "NO ATTR!\n";
288289
continue;
290+
}
289291

290292
// Insert load to retrieve the actual argument passed by value/reference.
291293
assert(isa<LLVM::LLVMPointerType>(arg.getType()) &&

mlir/lib/Transforms/Utils/DialectConversion.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,9 @@ void ConversionPatternRewriter::replaceUsesOfBlockArgument(BlockArgument from,
16771677
<< "'(" << from.getOwner()->getParentOp() << ")\n";
16781678
});
16791679
impl->appendRewrite<ReplaceBlockArgRewrite>(from.getOwner(), from);
1680-
impl->mapping.map(from, to);
1680+
SmallVector<Value, 1> mapped = impl->mapping.lookupOrDefault(from);
1681+
assert(mapped.size() == 1 && "replaceUsesOfBlockArgument is not supported for 1:N replacements");
1682+
impl->mapping.map(mapped.front(), to);
16811683
}
16821684

16831685
Value ConversionPatternRewriter::getRemappedValue(Value key) {

0 commit comments

Comments
 (0)