[PATCH] D114425: [clang] Add __builtin_bswap128

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 6 12:07:11 PST 2022


erichkeane added a comment.

In D114425#3225892 <https://reviews.llvm.org/D114425#3225892>, @craig.topper wrote:

> I kind of wonder if we should detect the __int128 type being requested in ASTContext::GetBuiltinType and return an error up to Sema::LazilyCreateBuiltin. Probably requires a new error code and handling for it in LazilyCreateBuiltin. I assume that would catch the bad builtin earlier. As it stands now we'd still allow it if it constant folds away in ExprConstant.cpp so that it never reaches CGBuiltin.cpp. But I'm not a frontend expert. Adding more potential reviewers

I think I like that idea, "DecodeTypeFromStr" should probably test if __int128 is supported.  Having us only diagnose in codegen is the wrong approach here, we need to reject it in Sema.

I would also want to see some IR-tests to show how this looks in IR, particularly one where it takes an __int128 as parameter (plus others that show the return value is valid?).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114425



More information about the cfe-commits mailing list