Hi all, I want to set a name loc to each op. But I set the location when creating ops, when I dump the SSA, there is no loc infomations.
Can anyone show me how I am wrong with it?
std::vector locs;
auto loc = NameLoc::get(builder_.getStringAttr(“123456”));
locs.push_back(Location(loc));
auto loc1 = builder_.getFusedLoc(llvm::makeArrayRef(locs));
auto noneOp = builder_.create<mlir::NoneOp>(loc1, builder_.getNoneType());
you can see no loc info printed as follows:
module {
func.func @main_func(%arg0: none) → tensor<1x2x3x4xsi10> {
%0 = “xgt.None”() : () → none
%1 = “xgt.Constant”() {value = dense<1> : tensor<1x2x3x4xi32>} : () → tensor<1x2x3x4xsi10>
return %1 : tensor<1x2x3x4xsi10>
}
}