[PATCH] D73233: [mlir] Add option to use custom base class for dialect in LLVMIRIntrinsicGen.

Marcello Maggioni via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 10:36:49 PST 2020


kariddi updated this revision to Diff 239939.
kariddi added a comment.

Ok, in this patch I'm stripping away the "TargetPrefix" off the intrinsics.
I don't know if there are some users that might want to keep that (at which point we might add it as a command line option)
but this avoids the nvvm.intr.nvvm.barrier0 problem, making the output just nvvm.intr.barrier0

An example of the new output here:

def LLVM_nvvm_barrier0 : NVVM_Op<"barrier0", [NoSideEffect]>, Arguments<(ins)>, Results<(outs)> {
...
}

I couldn't solve the problem of llvm.is.constant though, because this instrinsic is special ...
It actually sets the "name" field in the Intrinsic<> definition, which just a handful of intrinsic
do.

I don't feel is safe to try to strip elements off user defined names, so I preferred to keep it untouched.

I changed the test to use another intrinsic instead of is_constant that is more representative.
(as it doesn't use the "name" field like most of the intrinsics and has both overloadable result and operands.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73233/new/

https://reviews.llvm.org/D73233

Files:
  mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
  mlir/test/mlir-tblgen/llvm-intrinsics.td
  mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73233.239939.patch
Type: text/x-patch
Size: 4624 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200123/a5370340/attachment.bin>


More information about the llvm-commits mailing list