Skip to content

Commit 1e4f5d9

Browse files
committed
add NYI
1 parent 92bf363 commit 1e4f5d9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

clang/lib/CIR/Dialect/Transforms/TargetLowering/LowerFunction.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,15 @@ mlir::Value createCoercedValue(mlir::Value Src, mlir::Type Ty,
336336
return CGF.buildAggregateBitcast(Src, Ty);
337337
}
338338

339-
auto alloca = createTmpAlloca(CGF, Src.getLoc(), Ty);
340339
Src = findAlloca(Src.getDefiningOp());
341-
createMemCpy(CGF, alloca, Src, SrcSize.getFixedValue());
342-
return CGF.getRewriter().create<LoadOp>(Src.getLoc(), alloca.getResult());
340+
if (Src) {
341+
auto tmpAlloca = createTmpAlloca(CGF, Src.getLoc(), Ty);
342+
createMemCpy(CGF, tmpAlloca, Src, SrcSize.getFixedValue());
343+
return CGF.getRewriter().create<LoadOp>(Src.getLoc(),
344+
tmpAlloca.getResult());
345+
}
346+
347+
cir_cconv_unreachable("NYI");
343348
}
344349

345350
mlir::Value emitAddressAtOffset(LowerFunction &LF, mlir::Value addr,

0 commit comments

Comments
 (0)