Conversation
| Type ptrTy = cp.getDst().getType(); | ||
|
|
||
| auto forOp = scf::ForOp::create(builder, loc, c0, n, c1); | ||
| OpBuilder body(forOp.getBody()->getTerminator()); |
There was a problem hiding this comment.
better to use the provided builder with setInsertionPoint as it can have hooks
There was a problem hiding this comment.
@Pangoraw thanks, I have modified
we will need to include scftocf and cftollvm lowering passes in pipelines
we have covert-polygeist-to-llvm in the downstream, I guess it may could work for it
https://github.com/EnzymeAD/Enzyme-JAX/blob/5db2b680308c38613ed6d5d01ed7d9d9a1353a65/src/enzyme_ad/jax/Passes/ConvertPolygeistToLLVM.cpp#L4573
There was a problem hiding this comment.
ah yes perfect in this case
| return t; | ||
| if (Type t = walk(cp.getSrc())) | ||
| return t; | ||
| return Float64Type::get(cp.getContext()); |
There was a problem hiding this comment.
this is wrong, we should throw an error if things can't be deduced. This is also somewhat hacky and we should use type analysis
There was a problem hiding this comment.
I have fixed it, but only for the case where the inferred element type is a scalar int or float and using upstream MLIR for inferring types. The memcpy ops in RSBench that copy arrays of struct<(f64, f64)> and array<10 x f64> need to handle it recursively, I plan to open a new PR for it.
llvm.intr.memcpy has no registry in reverse AD, which cause "could not compute the adjoint for this operation "llvm.intr.memcpy"".
Reverse rule used here: