[PATCH] D100046: [AArch64] ACLE: Fix issue for mismatching enum types with builtins.

Sander de Smalen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 7 09:33:35 PDT 2021


sdesmalen created this revision.
Herald added subscribers: danielkiss, kristof.beyls.
sdesmalen requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This patch fixes an issue with the SVE prefetch and qinc/qdec intrinsics
that take an `enum` argument, but where the builtin prototype encodes
these as `int`. Some code in SemaDecl finds the mismatch, and chooses
to forget about the builtin altogether, which means that any future
code using that builtin will fail.

This patch fixes the issue by marking the builtin as 'T', which allows
for a type-mismatch, and then only discarding the builtin when
`allowTypeMismatch()` returns false.

This patch also fixes another issue with the SVE prefetch intrinsic
when built with C++, where the builtin didn't accept the correct
pointer type, which should be `const void *`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100046

Files:
  clang/include/clang/Basic/arm_sve.td
  clang/lib/Sema/SemaDecl.cpp
  clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_prfb.c
  clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_prfd.c
  clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_prfh.c
  clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_prfw.c
  clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_qdecb.c
  clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_qdecd.c
  clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_qdech.c
  clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_qdecp.c
  clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_qdecw.c
  clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_qincb.c
  clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_qincd.c
  clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_qinch.c
  clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_qincp.c
  clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_qincw.c
  clang/utils/TableGen/SveEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100046.335842.patch
Type: text/x-patch
Size: 20606 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210407/0c20e441/attachment-0001.bin>


More information about the cfe-commits mailing list