[PATCH] D66588: [ARM NEON] Avoid duplicated decarations

Diogo N. Sampaio via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 22 06:25:36 PDT 2019


dnsampaio created this revision.
dnsampaio added reviewers: t.p.northover, ostannard.
Herald added subscribers: cfe-commits, kristof.beyls, javed.absar.
Herald added a project: clang.

The declaration of arm neon intrinsics that are
"big endian safe" print the same code for big
and small endian targets.
This patch avoids duplicates by checking if an
intrinsic is safe to have a single definition.
(decreases header 6030 lines out of 73k).


Repository:
  rC Clang

https://reviews.llvm.org/D66588

Files:
  utils/TableGen/NeonEmitter.cpp


Index: utils/TableGen/NeonEmitter.cpp
===================================================================
--- utils/TableGen/NeonEmitter.cpp
+++ utils/TableGen/NeonEmitter.cpp
@@ -1889,6 +1889,11 @@
 }
 
 std::string Intrinsic::generate() {
+  // Avoid duplicated code for big and small endians
+  if (BigEndianSafe) {
+    generateImpl(false, "", "");
+    return OS.str();
+  }
   // Little endian intrinsics are simple and don't require any argument
   // swapping.
   OS << "#ifdef __LITTLE_ENDIAN__\n";


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66588.216598.patch
Type: text/x-patch
Size: 508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190822/bc3c8fb1/attachment.bin>


More information about the cfe-commits mailing list