This is an archive of the discontinued LLVM Phabricator instance.

Support base vector types of __attribute__((mode))
ClosedPublic

Authored by alexfrol on May 27 2015, 5:03 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

alexfrol updated this revision to Diff 26586.May 27 2015, 5:03 AM
alexfrol retitled this revision from to Support base vector types of __attribute__((mode)).
alexfrol updated this object.
alexfrol edited the test plan for this revision. (Show Details)
alexfrol added reviewers: aaron.ballman, rsmith.
alexfrol set the repository for this revision to rL LLVM.
alexfrol added a subscriber: Unknown Object (MLST).
alexfrol updated this revision to Diff 26611.May 27 2015, 9:50 AM

Aaron Ballman wrote:
"I am unfamiliar with attribute((mode)); is there documentation that supports this assertion, or popular code in the wild that is relying on it? GCC's docs are very spartan on the >topic, and there was an (unanswered) question in the PR regarding why we would want to support this."

attribute((mode)) is a GCC extension. It is already supported in Clang, but only partially as the current implementation does not cover cases with base vector types.
I tend to claim this issue (described in PR17453) a missing feature/incomplete implementation as GCC compiler does support base vector types.
The community already accepted similar patches for this attribute (issues described in PR16752, PR8703 and PR3691, for example). I hope to think this patch is desirable too.

Aaron Ballman wrote: "The diagnostic you added does not accept any arguments."

+    if (ComplexMode) {
+      S.Diag(Attr.getLoc(), diag::err_complex_mode_vector_type) << Name;

Aaron Ballman wrote: "This diagnostic also does not accept any arguments."

+  if (NewTy.isNull()) {
+    S.Diag(Attr.getLoc(), diag::err_mode_wrong_type) << Name;

I removed arguments for the two mentioned diagnostics and updated the patch.

aaron.ballman edited edge metadata.May 28 2015, 7:50 AM

CC'ing in Chris, who had expressed concerns in the original PR.

Given the fact that WWDC is happening, I suspect Chris is a bit busy
to chime in with his opinions. ;-)

~Aaron

alexfrol accepted this revision.Jun 19 2015, 12:00 AM
alexfrol added a reviewer: alexfrol.

Aaron said LGTM, thus I accept the revision.

18.06.2015, 19:26, "Aaron Ballman" <aaron.ballman@gmail.com>:

Since Chris isn't strongly opposed, I think the patch LGTM.

~Aaron

On Thu, Jun 18, 2015 at 12:24 PM, Chris Lattner <clattner@apple.com> wrote:

 On Jun 18, 2015, at 3:02 AM, Alexey Frolov <alexfrolov1878@yandex.ru> wrote:

 Hi Chris,

 Sorry for disturbing :)

 In comment 1 of http://llvm.org/PR17453 you wrote:
   >> It isn't clear that we want to support this. Our goal is not to pass the GCC testsuite.
 What in your opinion should be done with this PR - fixed or closed as "WONTFIX”?

 I don’t have strong opinions about this. On the one hand, I don’t see this as a commonly used extension, so I don’t see it as critical to support. OTOH, if the patch is small and self contained, it is better to be compatible.

 -Chris

 Thank you,
 Alexey Frolov
 =============
 Software Engineer
 Intel Compiler Team
 Intel

This revision is now accepted and ready to land.Jun 19 2015, 12:00 AM
This revision was automatically updated to reflect the committed changes.