-
Notifications
You must be signed in to change notification settings - Fork 14
Add command to generate two dot files for e2e kernels #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks @HobbitQia, can you paste the two DFGs in png here? |
Sure! Here I provided two DFGs before our transformations: And I admit that here are some unnecessary nodes outside the core loop and I can try to remove them for cleanup. |
|
Thanks @HobbitQia, I meant two DFGs for FIR. original and last level. Also, can you please include the FIR's mlir.llvm IR as well? I don't get the |
For FIR, the DFG before transformation: And the IR before transformation: %0 = llvm.mlir.constant(0 : i64) : i64
%1 = llvm.mlir.constant(0 : i32) : i32
%2 = llvm.mlir.constant(1 : i64) : i64
%3 = llvm.mlir.constant(32 : i64) : i64
llvm.br ^bb1(%0, %1 : i64, i32)
^bb1(%4: i64, %5: i32): // 2 preds: ^bb0, ^bb1
%6 = llvm.getelementptr inbounds %arg0[%4] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%7 = llvm.load %6 {alignment = 4 : i64, tbaa = [#tbaa_tag]} : !llvm.ptr -> i32
%8 = llvm.getelementptr inbounds %arg2[%4] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%9 = llvm.load %8 {alignment = 4 : i64, tbaa = [#tbaa_tag]} : !llvm.ptr -> i32
%10 = llvm.mul %9, %7 overflow<nsw> : i32
%11 = llvm.add %10, %5 overflow<nsw> : i32
%12 = llvm.add %4, %2 overflow<nsw, nuw> : i64
%13 = llvm.icmp "eq" %12, %3 : i64
llvm.cond_br %13, ^bb2, ^bb1(%12, %11 : i64, i32) {loop_annotation = #loop_annotation}
^bb2: // pred: ^bb1
llvm.return %11 : i32I think some nodes that are constant or arguments of functions, which make the DFG look redundant. I am not sure whether I can remove them from DFG or not... |
|
Oh, they are necessary. The issue is the dot or MLIR dot parser cannot represent |
|
Hi @syifan, two json files are generated for illustration of DFGs. |
|
Got it. So what does the "transformation" do here? |
"transformation" transforms original ctrl flow IRs to dataflow IRs. For example, |




For issue 196