[PATCH] D128934: [X86] Add RDPRU instruction

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 30 12:13:41 PDT 2022


craig.topper added a comment.

In D128934#3623182 <https://reviews.llvm.org/D128934#3623182>, @probinson wrote:

> If this patch is too big, I'm happy to break it into two (LLVM/Clang) or 4 (piecemeal features) parts.
>
> Two questions:
>
> - Should the clang builtin be in BuiltinsX86_64.td instead of BuiltinsX86.td?  It's supported only by Zen.

BuiltinsX86_64.def generates a check that the triple is x86_64 and not i386/i686. It doesn't look like this instruction is 64-bit mode only so BuiltinsX86.def is the right place

> - I didn't need to add a case for this in CGBuiltin.cpp, which was surprising; just adding the entry to BuiltinsX86.def was enough to automatically lower the Clang builtin to the IR intrinsic. Does that auto-magic mean there are cases that could be removed from CGBuiltin.cpp?

The `ClangBuiltin` in IntrinsicsX86.td sets this up. All X86 code in CGBuiltin.cpp should be for builtins that don't appear in `ClangBuiltin` because they require some special handling.


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

https://reviews.llvm.org/D128934



More information about the llvm-commits mailing list