[PATCH] D51234: [Driver] Change MipsLinux default linker from "lld" to "ld.lld"
atanasyan accepted this revision. atanasyan added a comment. This revision is now accepted and ready to land. LGTM Repository: rC Clang https://reviews.llvm.org/D51234 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D34329: [clang-diff] Initial implementation.
sylvestre.ledru added a comment. Herald added subscribers: llvm-commits, kadircet, mgrang. @arphaman @johannes Is that normal that clang-diff isn't installed by cmake? (like clang-format?) Repository: rL LLVM https://reviews.llvm.org/D34329 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D51269: [Xray] Enable in the driver side
devnexen created this revision. devnexen added a reviewer: dberris. devnexen created this object with visibility "All Users". Herald added a subscriber: cfe-commits. Repository: rC Clang https://reviews.llvm.org/D51269 Files: lib/Driver/ToolChains/Darwin.cpp lib/Driver/ToolChains/Darwin.h lib/Driver/XRayArgs.cpp Index: lib/Driver/XRayArgs.cpp === --- lib/Driver/XRayArgs.cpp +++ lib/Driver/XRayArgs.cpp @@ -52,7 +52,8 @@ } } else if (Triple.getOS() == llvm::Triple::FreeBSD || Triple.getOS() == llvm::Triple::OpenBSD || - Triple.getOS() == llvm::Triple::NetBSD) { + Triple.getOS() == llvm::Triple::NetBSD || + Triple.getOS() == llvm::Triple::Darwin) { if (Triple.getArch() != llvm::Triple::x86_64) { D.Diag(diag::err_drv_clang_unsupported) << (std::string(XRayInstrumentOption) + " on " + Triple.str()); Index: lib/Driver/ToolChains/Darwin.h === --- lib/Driver/ToolChains/Darwin.h +++ lib/Driver/ToolChains/Darwin.h @@ -11,6 +11,7 @@ #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_DARWIN_H #include "Cuda.h" +#include "clang/Driver/XRayArgs.h" #include "clang/Driver/Tool.h" #include "clang/Driver/ToolChain.h" Index: lib/Driver/ToolChains/Darwin.cpp === --- lib/Driver/ToolChains/Darwin.cpp +++ lib/Driver/ToolChains/Darwin.cpp @@ -1105,6 +1105,13 @@ if (Sanitize.needsEsanRt()) AddLinkSanitizerLibArgs(Args, CmdArgs, "esan"); + const XRayArgs &XRay = getXRayArgs(); + if (XRay.needsXRayRt()) { +AddLinkRuntimeLib(Args, CmdArgs, "xray"); +AddLinkRuntimeLib(Args, CmdArgs, "xray-basic"); +AddLinkRuntimeLib(Args, CmdArgs, "xray-fdr"); + } + // Otherwise link libSystem, then the dynamic runtime library, and finally any // target specific static runtime library. CmdArgs.push_back("-lSystem"); Index: lib/Driver/XRayArgs.cpp === --- lib/Driver/XRayArgs.cpp +++ lib/Driver/XRayArgs.cpp @@ -52,7 +52,8 @@ } } else if (Triple.getOS() == llvm::Triple::FreeBSD || Triple.getOS() == llvm::Triple::OpenBSD || - Triple.getOS() == llvm::Triple::NetBSD) { + Triple.getOS() == llvm::Triple::NetBSD || + Triple.getOS() == llvm::Triple::Darwin) { if (Triple.getArch() != llvm::Triple::x86_64) { D.Diag(diag::err_drv_clang_unsupported) << (std::string(XRayInstrumentOption) + " on " + Triple.str()); Index: lib/Driver/ToolChains/Darwin.h === --- lib/Driver/ToolChains/Darwin.h +++ lib/Driver/ToolChains/Darwin.h @@ -11,6 +11,7 @@ #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_DARWIN_H #include "Cuda.h" +#include "clang/Driver/XRayArgs.h" #include "clang/Driver/Tool.h" #include "clang/Driver/ToolChain.h" Index: lib/Driver/ToolChains/Darwin.cpp === --- lib/Driver/ToolChains/Darwin.cpp +++ lib/Driver/ToolChains/Darwin.cpp @@ -1105,6 +1105,13 @@ if (Sanitize.needsEsanRt()) AddLinkSanitizerLibArgs(Args, CmdArgs, "esan"); + const XRayArgs &XRay = getXRayArgs(); + if (XRay.needsXRayRt()) { +AddLinkRuntimeLib(Args, CmdArgs, "xray"); +AddLinkRuntimeLib(Args, CmdArgs, "xray-basic"); +AddLinkRuntimeLib(Args, CmdArgs, "xray-fdr"); + } + // Otherwise link libSystem, then the dynamic runtime library, and finally any // target specific static runtime library. CmdArgs.push_back("-lSystem"); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D50766: Fix false positive unsequenced access and modification warning in array subscript expression.
stryku updated this revision to Diff 162585. stryku added a comment. Added test cases for the code. Here I think I need your assistance. AFAIK in C++ 17 a couple more sequence related rules appeared. If we would like to cover them in current //warn-unsequenced.cpp// file, I think we would end up with a little mess with ifdefs for C++ < 17 and C++ >= 17. That's why I have introduced a new file //warn-unsequenced-cxx17.cpp// which covers my code and more tests will be added to it while their implementation as well. What do you think? https://reviews.llvm.org/D50766 Files: lib/Sema/SemaChecking.cpp test/SemaCXX/warn-unsequenced-cxx17.cpp test/SemaCXX/warn-unsequenced.cpp Index: test/SemaCXX/warn-unsequenced.cpp === --- test/SemaCXX/warn-unsequenced.cpp +++ test/SemaCXX/warn-unsequenced.cpp @@ -81,6 +81,7 @@ int *p = xs; a = *(a++, p); // ok a = a++ && a; // ok + p[(long long unsigned)(p = 0)]; // expected-warning {{unsequenced modification and access to 'p'}} A *q = &agg1; (q = &agg2)->y = q->x; // expected-warning {{unsequenced modification and access to 'q'}} Index: test/SemaCXX/warn-unsequenced-cxx17.cpp === --- /dev/null +++ test/SemaCXX/warn-unsequenced-cxx17.cpp @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 -Wno-unused %s + +void test() { + int xs[10]; + int *p = xs; + // expected-no-diagnostics + p[(long long unsigned)(p = 0)] // ok +} Index: lib/Sema/SemaChecking.cpp === --- lib/Sema/SemaChecking.cpp +++ lib/Sema/SemaChecking.cpp @@ -11658,30 +11658,42 @@ notePostUse(O, E); } - void VisitBinComma(BinaryOperator *BO) { -// C++11 [expr.comma]p1: -// Every value computation and side effect associated with the left -// expression is sequenced before every value computation and side -// effect associated with the right expression. -SequenceTree::Seq LHS = Tree.allocate(Region); -SequenceTree::Seq RHS = Tree.allocate(Region); + void VisitSequencedExpressions(Expr *SequencedBefore, Expr *SequencedAfter) { +SequenceTree::Seq BeforeRegion = Tree.allocate(Region); +SequenceTree::Seq AfterRegion = Tree.allocate(Region); SequenceTree::Seq OldRegion = Region; { - SequencedSubexpression SeqLHS(*this); - Region = LHS; - Visit(BO->getLHS()); + SequencedSubexpression SeqBefore(*this); + Region = BeforeRegion; + Visit(SequencedBefore); } -Region = RHS; -Visit(BO->getRHS()); +Region = AfterRegion; +Visit(SequencedAfter); Region = OldRegion; -// Forget that LHS and RHS are sequenced. They are both unsequenced -// with respect to other stuff. -Tree.merge(LHS); -Tree.merge(RHS); +Tree.merge(BeforeRegion); +Tree.merge(AfterRegion); + } + + void VisitArraySubscriptExpr(ArraySubscriptExpr *ASE) { +// C++17 [expr.sub]p1: +// The expression E1[E2] is identical (by definition) to *((E1)+(E2)). The +// expression E1 is sequenced before the expression E2. +if (SemaRef.getLangOpts().CPlusPlus17) + VisitSequencedExpressions(ASE->getLHS(), ASE->getRHS()); +else + Base::VisitStmt(ASE); + } + + void VisitBinComma(BinaryOperator *BO) { +// C++11 [expr.comma]p1: +// Every value computation and side effect associated with the left +// expression is sequenced before every value computation and side +// effect associated with the right expression. +VisitSequencedExpressions(BO->getLHS(), BO->getRHS()); } void VisitBinAssign(BinaryOperator *BO) { Index: test/SemaCXX/warn-unsequenced.cpp === --- test/SemaCXX/warn-unsequenced.cpp +++ test/SemaCXX/warn-unsequenced.cpp @@ -81,6 +81,7 @@ int *p = xs; a = *(a++, p); // ok a = a++ && a; // ok + p[(long long unsigned)(p = 0)]; // expected-warning {{unsequenced modification and access to 'p'}} A *q = &agg1; (q = &agg2)->y = q->x; // expected-warning {{unsequenced modification and access to 'q'}} Index: test/SemaCXX/warn-unsequenced-cxx17.cpp === --- /dev/null +++ test/SemaCXX/warn-unsequenced-cxx17.cpp @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 -Wno-unused %s + +void test() { + int xs[10]; + int *p = xs; + // expected-no-diagnostics + p[(long long unsigned)(p = 0)] // ok +} Index: lib/Sema/SemaChecking.cpp === --- lib/Sema/SemaChecking.cpp +++ lib/Sema/SemaChecking.cpp @@ -11658,30 +11658,42 @@ notePostUse(O, E); } - void VisitBinComma(BinaryOperator *BO) { -// C++11 [expr.comma]p1: -// Every value computation and side effect associated with the left -// expressio
[PATCH] D50766: Fix false positive unsequenced access and modification warning in array subscript expression.
Rakete added a comment. > What do you think? Good idea! Comment at: test/SemaCXX/warn-unsequenced-cxx17.cpp:7 + // expected-no-diagnostics + p[(long long unsigned)(p = 0)] // ok +} Oh no, you forgot a semicolon there! :) https://reviews.llvm.org/D50766 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r340709 - [Driver] Change MipsLinux default linker from "lld" to "ld.lld"
Author: maskray Date: Sun Aug 26 12:47:23 2018 New Revision: 340709 URL: http://llvm.org/viewvc/llvm-project?rev=340709&view=rev Log: [Driver] Change MipsLinux default linker from "lld" to "ld.lld" Reviewers: kzhuravl, atanasyan Reviewed By: atanasyan Subscribers: sdardis, arichardson, jrtc27, atanasyan, cfe-commits Differential Revision: https://reviews.llvm.org/D51234 Modified: cfe/trunk/lib/Driver/ToolChains/MipsLinux.h Modified: cfe/trunk/lib/Driver/ToolChains/MipsLinux.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/MipsLinux.h?rev=340709&r1=340708&r2=340709&view=diff == --- cfe/trunk/lib/Driver/ToolChains/MipsLinux.h (original) +++ cfe/trunk/lib/Driver/ToolChains/MipsLinux.h Sun Aug 26 12:47:23 2018 @@ -49,7 +49,7 @@ public: } const char *getDefaultLinker() const override { -return "lld"; +return "ld.lld"; } private: ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D51234: [Driver] Change MipsLinux default linker from "lld" to "ld.lld"
This revision was automatically updated to reflect the committed changes. Closed by commit rL340709: [Driver] Change MipsLinux default linker from "lld" to "ld.lld" (authored by MaskRay, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D51234 Files: cfe/trunk/lib/Driver/ToolChains/MipsLinux.h Index: cfe/trunk/lib/Driver/ToolChains/MipsLinux.h === --- cfe/trunk/lib/Driver/ToolChains/MipsLinux.h +++ cfe/trunk/lib/Driver/ToolChains/MipsLinux.h @@ -49,7 +49,7 @@ } const char *getDefaultLinker() const override { -return "lld"; +return "ld.lld"; } private: Index: cfe/trunk/lib/Driver/ToolChains/MipsLinux.h === --- cfe/trunk/lib/Driver/ToolChains/MipsLinux.h +++ cfe/trunk/lib/Driver/ToolChains/MipsLinux.h @@ -49,7 +49,7 @@ } const char *getDefaultLinker() const override { -return "lld"; +return "ld.lld"; } private: ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D50455: Continue emitting diagnostics after a fatal error
Dmitry.Kozhevnikov marked an inline comment as done. Dmitry.Kozhevnikov added a comment. In https://reviews.llvm.org/D50455#1193468, @ilya-biryukov wrote: > Nevertheless, I think this is moving clangd in the right direction and if we > see too many irrelevant errors, we should look into improving clang to show > less of those. A more conservative fix (demoting "include file not found" from fatal errors) was proposed in https://reviews.llvm.org/D50462, I'll try exploring that instead. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50455 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: r340709 - [Driver] Change MipsLinux default linker from "lld" to "ld.lld"
FYI, test cases also seem to need updating: http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/19575/steps/ninja%20check%201/logs/FAIL%3A%20Clang%3A%3Amips-mti-linux.c On Sun, Aug 26, 2018 at 12:48 PM Fangrui Song via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: maskray > Date: Sun Aug 26 12:47:23 2018 > New Revision: 340709 > > URL: http://llvm.org/viewvc/llvm-project?rev=340709&view=rev > Log: > [Driver] Change MipsLinux default linker from "lld" to "ld.lld" > > Reviewers: kzhuravl, atanasyan > > Reviewed By: atanasyan > > Subscribers: sdardis, arichardson, jrtc27, atanasyan, cfe-commits > > Differential Revision: https://reviews.llvm.org/D51234 > > Modified: > cfe/trunk/lib/Driver/ToolChains/MipsLinux.h > > Modified: cfe/trunk/lib/Driver/ToolChains/MipsLinux.h > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/MipsLinux.h?rev=340709&r1=340708&r2=340709&view=diff > > == > --- cfe/trunk/lib/Driver/ToolChains/MipsLinux.h (original) > +++ cfe/trunk/lib/Driver/ToolChains/MipsLinux.h Sun Aug 26 12:47:23 2018 > @@ -49,7 +49,7 @@ public: >} > >const char *getDefaultLinker() const override { > -return "lld"; > +return "ld.lld"; >} > > private: > > > ___ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits > ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D51239: [ubsan] Enable -fsanitize=vptr on Apple devices and simulators
delcypher requested changes to this revision. delcypher added inline comments. This revision now requires changes to proceed. Comment at: clang/lib/Driver/ToolChains/Darwin.cpp:2254 Res |= SanitizerKind::Function; + if (!isTargetMacOS() || !isMacosxVersionLT(10, 9)) +Res |= SanitizerKind::Vptr; Could we apply De'Morgan's rule here and write that as ``` if (!(isTargetMacOS() && isMacosxVersionLT(10, 9)) { Res |= SanitizerKind::Vptr } ``` I find that a bit easier to read. Is there any particular reason why vptr isn't supported for old macOS versions? There's no mention of ios here which suggests that it's supported on all ios versions which seems like an odd disparity. Perhaps a comment briefly explaining why this is the case would be helpful? https://reviews.llvm.org/D51239 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D51269: [Xray] Darwin - Enable in the driver side
dberris accepted this revision. dberris added a comment. This revision is now accepted and ready to land. Thanks for this @devnexen -- but do any of the tests actually run on Darwin yet? Repository: rC Clang https://reviews.llvm.org/D51269 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D51234: [Driver] Change MipsLinux default linker from "lld" to "ld.lld"
ruiu added a comment. If this piece of code used to be working correctly, there is another piece of code that adds `-flavor ld` to the command line. But if that's the case, this change wouldn't work because it constructs something like "ld.lld -flavor ld ...". ld.lld doesn't accept `-flavor` option. So my guess is this code is dead. Or, am I missing something? Repository: rL LLVM https://reviews.llvm.org/D51234 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r340712 - [Xray] Darwin - Enable in the driver side
Author: devnexen Date: Sun Aug 26 22:16:09 2018 New Revision: 340712 URL: http://llvm.org/viewvc/llvm-project?rev=340712&view=rev Log: [Xray] Darwin - Enable in the driver side Reviewers: dberris Reviered By: dberris Differential Revision: https://reviews.llvm.org/D51269 Modified: cfe/trunk/lib/Driver/ToolChains/Darwin.cpp cfe/trunk/lib/Driver/ToolChains/Darwin.h cfe/trunk/lib/Driver/XRayArgs.cpp cfe/trunk/test/Driver/XRay/lit.local.cfg cfe/trunk/test/Driver/XRay/xray-instrument-os.c Modified: cfe/trunk/lib/Driver/ToolChains/Darwin.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Darwin.cpp?rev=340712&r1=340711&r2=340712&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Darwin.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Darwin.cpp Sun Aug 26 22:16:09 2018 @@ -1105,6 +1105,13 @@ void DarwinClang::AddLinkRuntimeLibArgs( if (Sanitize.needsEsanRt()) AddLinkSanitizerLibArgs(Args, CmdArgs, "esan"); + const XRayArgs &XRay = getXRayArgs(); + if (XRay.needsXRayRt()) { +AddLinkRuntimeLib(Args, CmdArgs, "xray"); +AddLinkRuntimeLib(Args, CmdArgs, "xray-basic"); +AddLinkRuntimeLib(Args, CmdArgs, "xray-fdr"); + } + // Otherwise link libSystem, then the dynamic runtime library, and finally any // target specific static runtime library. CmdArgs.push_back("-lSystem"); Modified: cfe/trunk/lib/Driver/ToolChains/Darwin.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Darwin.h?rev=340712&r1=340711&r2=340712&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Darwin.h (original) +++ cfe/trunk/lib/Driver/ToolChains/Darwin.h Sun Aug 26 22:16:09 2018 @@ -11,6 +11,7 @@ #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_DARWIN_H #include "Cuda.h" +#include "clang/Driver/XRayArgs.h" #include "clang/Driver/Tool.h" #include "clang/Driver/ToolChain.h" Modified: cfe/trunk/lib/Driver/XRayArgs.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/XRayArgs.cpp?rev=340712&r1=340711&r2=340712&view=diff == --- cfe/trunk/lib/Driver/XRayArgs.cpp (original) +++ cfe/trunk/lib/Driver/XRayArgs.cpp Sun Aug 26 22:16:09 2018 @@ -52,7 +52,8 @@ XRayArgs::XRayArgs(const ToolChain &TC, } } else if (Triple.getOS() == llvm::Triple::FreeBSD || Triple.getOS() == llvm::Triple::OpenBSD || - Triple.getOS() == llvm::Triple::NetBSD) { + Triple.getOS() == llvm::Triple::NetBSD || + Triple.getOS() == llvm::Triple::Darwin) { if (Triple.getArch() != llvm::Triple::x86_64) { D.Diag(diag::err_drv_clang_unsupported) << (std::string(XRayInstrumentOption) + " on " + Triple.str()); Modified: cfe/trunk/test/Driver/XRay/lit.local.cfg URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/XRay/lit.local.cfg?rev=340712&r1=340711&r2=340712&view=diff == --- cfe/trunk/test/Driver/XRay/lit.local.cfg (original) +++ cfe/trunk/test/Driver/XRay/lit.local.cfg Sun Aug 26 22:16:09 2018 @@ -10,7 +10,7 @@ supported_targets = [ # Only on platforms we support. supported_oses = [ -'Linux', 'FreeBSD' +'Linux', 'FreeBSD', 'Darwin' ] triple_set = set(target_triple_components) Modified: cfe/trunk/test/Driver/XRay/xray-instrument-os.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/XRay/xray-instrument-os.c?rev=340712&r1=340711&r2=340712&view=diff == --- cfe/trunk/test/Driver/XRay/xray-instrument-os.c (original) +++ cfe/trunk/test/Driver/XRay/xray-instrument-os.c Sun Aug 26 22:16:09 2018 @@ -1,4 +1,4 @@ // RUN: not %clang -o /dev/null -v -fxray-instrument -c %s -// XFAIL: -linux-, -freebsd +// XFAIL: -linux-, -freebsd, -darwin // REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64 typedef int a; ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D51269: [Xray] Darwin - Enable in the driver side
This revision was automatically updated to reflect the committed changes. Closed by commit rL340712: [Xray] Darwin - Enable in the driver side (authored by devnexen, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D51269?vs=162583&id=162610#toc Repository: rL LLVM https://reviews.llvm.org/D51269 Files: cfe/trunk/lib/Driver/ToolChains/Darwin.cpp cfe/trunk/lib/Driver/ToolChains/Darwin.h cfe/trunk/lib/Driver/XRayArgs.cpp cfe/trunk/test/Driver/XRay/lit.local.cfg cfe/trunk/test/Driver/XRay/xray-instrument-os.c Index: cfe/trunk/lib/Driver/XRayArgs.cpp === --- cfe/trunk/lib/Driver/XRayArgs.cpp +++ cfe/trunk/lib/Driver/XRayArgs.cpp @@ -52,7 +52,8 @@ } } else if (Triple.getOS() == llvm::Triple::FreeBSD || Triple.getOS() == llvm::Triple::OpenBSD || - Triple.getOS() == llvm::Triple::NetBSD) { + Triple.getOS() == llvm::Triple::NetBSD || + Triple.getOS() == llvm::Triple::Darwin) { if (Triple.getArch() != llvm::Triple::x86_64) { D.Diag(diag::err_drv_clang_unsupported) << (std::string(XRayInstrumentOption) + " on " + Triple.str()); Index: cfe/trunk/lib/Driver/ToolChains/Darwin.cpp === --- cfe/trunk/lib/Driver/ToolChains/Darwin.cpp +++ cfe/trunk/lib/Driver/ToolChains/Darwin.cpp @@ -1105,6 +1105,13 @@ if (Sanitize.needsEsanRt()) AddLinkSanitizerLibArgs(Args, CmdArgs, "esan"); + const XRayArgs &XRay = getXRayArgs(); + if (XRay.needsXRayRt()) { +AddLinkRuntimeLib(Args, CmdArgs, "xray"); +AddLinkRuntimeLib(Args, CmdArgs, "xray-basic"); +AddLinkRuntimeLib(Args, CmdArgs, "xray-fdr"); + } + // Otherwise link libSystem, then the dynamic runtime library, and finally any // target specific static runtime library. CmdArgs.push_back("-lSystem"); Index: cfe/trunk/lib/Driver/ToolChains/Darwin.h === --- cfe/trunk/lib/Driver/ToolChains/Darwin.h +++ cfe/trunk/lib/Driver/ToolChains/Darwin.h @@ -11,6 +11,7 @@ #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_DARWIN_H #include "Cuda.h" +#include "clang/Driver/XRayArgs.h" #include "clang/Driver/Tool.h" #include "clang/Driver/ToolChain.h" Index: cfe/trunk/test/Driver/XRay/xray-instrument-os.c === --- cfe/trunk/test/Driver/XRay/xray-instrument-os.c +++ cfe/trunk/test/Driver/XRay/xray-instrument-os.c @@ -1,4 +1,4 @@ // RUN: not %clang -o /dev/null -v -fxray-instrument -c %s -// XFAIL: -linux-, -freebsd +// XFAIL: -linux-, -freebsd, -darwin // REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64 typedef int a; Index: cfe/trunk/test/Driver/XRay/lit.local.cfg === --- cfe/trunk/test/Driver/XRay/lit.local.cfg +++ cfe/trunk/test/Driver/XRay/lit.local.cfg @@ -10,7 +10,7 @@ # Only on platforms we support. supported_oses = [ -'Linux', 'FreeBSD' +'Linux', 'FreeBSD', 'Darwin' ] triple_set = set(target_triple_components) Index: cfe/trunk/lib/Driver/XRayArgs.cpp === --- cfe/trunk/lib/Driver/XRayArgs.cpp +++ cfe/trunk/lib/Driver/XRayArgs.cpp @@ -52,7 +52,8 @@ } } else if (Triple.getOS() == llvm::Triple::FreeBSD || Triple.getOS() == llvm::Triple::OpenBSD || - Triple.getOS() == llvm::Triple::NetBSD) { + Triple.getOS() == llvm::Triple::NetBSD || + Triple.getOS() == llvm::Triple::Darwin) { if (Triple.getArch() != llvm::Triple::x86_64) { D.Diag(diag::err_drv_clang_unsupported) << (std::string(XRayInstrumentOption) + " on " + Triple.str()); Index: cfe/trunk/lib/Driver/ToolChains/Darwin.cpp === --- cfe/trunk/lib/Driver/ToolChains/Darwin.cpp +++ cfe/trunk/lib/Driver/ToolChains/Darwin.cpp @@ -1105,6 +1105,13 @@ if (Sanitize.needsEsanRt()) AddLinkSanitizerLibArgs(Args, CmdArgs, "esan"); + const XRayArgs &XRay = getXRayArgs(); + if (XRay.needsXRayRt()) { +AddLinkRuntimeLib(Args, CmdArgs, "xray"); +AddLinkRuntimeLib(Args, CmdArgs, "xray-basic"); +AddLinkRuntimeLib(Args, CmdArgs, "xray-fdr"); + } + // Otherwise link libSystem, then the dynamic runtime library, and finally any // target specific static runtime library. CmdArgs.push_back("-lSystem"); Index: cfe/trunk/lib/Driver/ToolChains/Darwin.h === --- cfe/trunk/lib/Driver/ToolChains/Darwin.h +++ cfe/trunk/lib/Driver/ToolChains/Darwin.h @@ -11,6 +11,7 @@ #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_DARWIN_H #include "Cuda.h" +#include "clang/Driver/XRayArgs.h" #include "clang/Driver/Tool.h" #include "c
[PATCH] D51269: [Xray] Darwin - Enable in the driver side
devnexen added a comment. Good point :-) Repository: rL LLVM https://reviews.llvm.org/D51269 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D50385: [clangd] Collect symbol occurrences from AST.
hokein updated this revision to Diff 162611. hokein marked 7 inline comments as done. hokein added a comment. Update the patch based on our new discussion - SymbolOccurrenceSlab for storing underlying occurrence data - reuse SymbolCollector to collect symbol occurrences Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50385 Files: clangd/index/Index.cpp clangd/index/Index.h clangd/index/SymbolCollector.cpp clangd/index/SymbolCollector.h unittests/clangd/SymbolCollectorTests.cpp Index: unittests/clangd/SymbolCollectorTests.cpp === --- unittests/clangd/SymbolCollectorTests.cpp +++ unittests/clangd/SymbolCollectorTests.cpp @@ -74,6 +74,16 @@ MATCHER_P(ForCodeCompletion, IsIndexedForCodeCompletion, "") { return arg.IsIndexedForCodeCompletion == IsIndexedForCodeCompletion; } +MATCHER(OccurrenceRange, "") { + const clang::clangd::SymbolOccurrence& Pos = testing::get<0>(arg); + const clang::clangd::Range& Range = testing::get<1>(arg); + return std::tie(Pos.Location.Start.Line, + Pos.Location.Start.Column, + Pos.Location.End.Line, + Pos.Location.End.Column) == + std::tie(Range.start.line, Range.start.character, Range.end.line, + Range.end.character); +} namespace clang { namespace clangd { @@ -237,6 +247,7 @@ llvm::MemoryBuffer::getMemBuffer(MainCode)); Invocation.run(); Symbols = Factory->Collector->takeSymbols(); +SymbolOccurrences = Factory->Collector->takeOccurrences(); return true; } @@ -247,6 +258,7 @@ std::string TestFileName; std::string TestFileURI; SymbolSlab Symbols; + SymbolOccurrenceSlab SymbolOccurrences; SymbolCollector::Options CollectorOpts; std::unique_ptr PragmaHandler; }; @@ -413,6 +425,67 @@ )); } +TEST_F(SymbolCollectorTest, Occurrences) { + Annotations Header(R"( + class $foo[[Foo]] { + public: +$foo[[Foo]]() {} +$foo[[Foo]](int); + }; + class $bar[[Bar]]; + void $func[[func]](); + )"); + Annotations Main(R"( + class $bar[[Bar]] {}; + + void $func[[func]](); + + void fff() { +$foo[[Foo]] foo; +$bar[[Bar]] bar; +$func[[func]](); +int abc = 0; +$foo[[Foo]] foo2 = abc; + } + )"); + Annotations SymbolsOnlyInMainCode(R"( + int a; + void b() {} + static const int c = 0; + class d {}; + )"); + CollectorOpts.OccurrenceFilter = SymbolOccurrenceKind::Declaration | + SymbolOccurrenceKind::Definition | + SymbolOccurrenceKind::Reference; + runSymbolCollector(Header.code(), + (Main.code() + SymbolsOnlyInMainCode.code()).str()); + auto HeaderSymbols = TestTU::withHeaderCode(Header.code()).headerSymbols(); + + EXPECT_THAT( + SymbolOccurrences.find(findSymbol(Symbols, "Foo").ID), + testing::UnorderedPointwise(OccurrenceRange(), Main.ranges("foo"))); + EXPECT_THAT( + SymbolOccurrences.find(findSymbol(Symbols, "Bar").ID), + testing::UnorderedPointwise(OccurrenceRange(), Main.ranges("bar"))); + EXPECT_THAT( + SymbolOccurrences.find(findSymbol(Symbols, "func").ID), + testing::UnorderedPointwise(OccurrenceRange(), Main.ranges("func"))); + + // Retrieve IDs for symbols *only* in the main file, and verify these symbols + // are not collected. + auto MainSymbols = + TestTU::withHeaderCode(SymbolsOnlyInMainCode.code()).headerSymbols(); + EXPECT_THAT( + SymbolOccurrences.find(findSymbol(MainSymbols, "a").ID), + testing::IsEmpty()); + EXPECT_THAT( + SymbolOccurrences.find(findSymbol(MainSymbols, "b").ID), + testing::IsEmpty()); + EXPECT_THAT( + SymbolOccurrences.find(findSymbol(MainSymbols, "c").ID), + testing::IsEmpty()); +} + TEST_F(SymbolCollectorTest, References) { const std::string Header = R"( class W; Index: clangd/index/SymbolCollector.h === --- clangd/index/SymbolCollector.h +++ clangd/index/SymbolCollector.h @@ -59,6 +59,10 @@ /// collect macros. For example, `indexTopLevelDecls` will not index any /// macro even if this is true. bool CollectMacro = false; +/// The symbol occurrence kind that will be collected. +/// If not set (Unknown), SymbolCollector will not collect any symbol +/// occurrences. +SymbolOccurrenceKind OccurrenceFilter = SymbolOccurrenceKind::Unknown; }; SymbolCollector(Options Opts); @@ -86,6 +90,10 @@ SymbolSlab takeSymbols() { return std::move(Symbols).build(); } + SymbolOccurrenceSlab takeOccurrences() { +return std::move(SymbolOccurrences); + } + void finish() override; private: @@ -108,6 +116,13 @@ // canonical by clang but should not be considered canonical in the index // unless it's a definition. llvm::DenseMap CanonicalDecls; + + using DeclOccurrence = std::pair; + llv
r340713 - [X86] Don't set min_vector_width to 512 on intrinsics that only operate on k registers.
Author: ctopper Date: Sun Aug 26 22:27:15 2018 New Revision: 340713 URL: http://llvm.org/viewvc/llvm-project?rev=340713&view=rev Log: [X86] Don't set min_vector_width to 512 on intrinsics that only operate on k registers. Modified: cfe/trunk/lib/Headers/avx512fintrin.h Modified: cfe/trunk/lib/Headers/avx512fintrin.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512fintrin.h?rev=340713&r1=340712&r2=340713&view=diff == --- cfe/trunk/lib/Headers/avx512fintrin.h (original) +++ cfe/trunk/lib/Headers/avx512fintrin.h Sun Aug 26 22:27:15 2018 @@ -175,6 +175,7 @@ typedef enum /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS512 __attribute__((__always_inline__, __nodebug__, __target__("avx512f"), __min_vector_width__(512))) #define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx512f"), __min_vector_width__(128))) +#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512f"))) /* Create vectors with repeated elements */ @@ -508,13 +509,13 @@ _mm512_castsi512_si256 (__m512i __A) return (__m256i)__builtin_shufflevector(__A, __A , 0, 1, 2, 3); } -static __inline__ __mmask16 __DEFAULT_FN_ATTRS512 +static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_int2mask(int __a) { return (__mmask16)__a; } -static __inline__ int __DEFAULT_FN_ATTRS512 +static __inline__ int __DEFAULT_FN_ATTRS _mm512_mask2int(__mmask16 __a) { return (int)__a; @@ -4580,7 +4581,7 @@ _mm512_store_epi64 (void *__P, __m512i _ /* Mask ops */ -static __inline __mmask16 __DEFAULT_FN_ATTRS512 +static __inline __mmask16 __DEFAULT_FN_ATTRS _mm512_knot(__mmask16 __M) { return __builtin_ia32_knothi(__M); @@ -5622,7 +5623,7 @@ _mm_maskz_getexp_ss (__mmask8 __U, __m12 (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(R)) -static __inline__ __mmask16 __DEFAULT_FN_ATTRS512 +static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_kmov (__mmask16 __A) { return __A; @@ -8320,49 +8321,49 @@ _mm512_mask_permutexvar_epi32 (__m512i _ #define _mm512_mask_permutevar_epi32 _mm512_mask_permutexvar_epi32 -static __inline__ __mmask16 __DEFAULT_FN_ATTRS512 +static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_kand (__mmask16 __A, __mmask16 __B) { return (__mmask16) __builtin_ia32_kandhi ((__mmask16) __A, (__mmask16) __B); } -static __inline__ __mmask16 __DEFAULT_FN_ATTRS512 +static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_kandn (__mmask16 __A, __mmask16 __B) { return (__mmask16) __builtin_ia32_kandnhi ((__mmask16) __A, (__mmask16) __B); } -static __inline__ __mmask16 __DEFAULT_FN_ATTRS512 +static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_kor (__mmask16 __A, __mmask16 __B) { return (__mmask16) __builtin_ia32_korhi ((__mmask16) __A, (__mmask16) __B); } -static __inline__ int __DEFAULT_FN_ATTRS512 +static __inline__ int __DEFAULT_FN_ATTRS _mm512_kortestc (__mmask16 __A, __mmask16 __B) { return __builtin_ia32_kortestchi ((__mmask16) __A, (__mmask16) __B); } -static __inline__ int __DEFAULT_FN_ATTRS512 +static __inline__ int __DEFAULT_FN_ATTRS _mm512_kortestz (__mmask16 __A, __mmask16 __B) { return __builtin_ia32_kortestzhi ((__mmask16) __A, (__mmask16) __B); } -static __inline__ __mmask16 __DEFAULT_FN_ATTRS512 +static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_kunpackb (__mmask16 __A, __mmask16 __B) { return (__mmask16) __builtin_ia32_kunpckhi ((__mmask16) __A, (__mmask16) __B); } -static __inline__ __mmask16 __DEFAULT_FN_ATTRS512 +static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_kxnor (__mmask16 __A, __mmask16 __B) { return (__mmask16) __builtin_ia32_kxnorhi ((__mmask16) __A, (__mmask16) __B); } -static __inline__ __mmask16 __DEFAULT_FN_ATTRS512 +static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_kxor (__mmask16 __A, __mmask16 __B) { return (__mmask16) __builtin_ia32_kxorhi ((__mmask16) __A, (__mmask16) __B); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. Implement the interface in - FileIndex - MemIndex - MergeIndex Depends on https://reviews.llvm.org/D50385. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51279 Files: clangd/index/FileIndex.cpp clangd/index/FileIndex.h clangd/index/Index.h clangd/index/MemIndex.cpp clangd/index/MemIndex.h clangd/index/Merge.cpp unittests/clangd/FileIndexTests.cpp unittests/clangd/IndexTests.cpp unittests/clangd/TestTU.cpp unittests/clangd/TestTU.h Index: unittests/clangd/TestTU.h === --- unittests/clangd/TestTU.h +++ unittests/clangd/TestTU.h @@ -38,6 +38,16 @@ return TU; } + static TestTU withAllCode(llvm::StringRef HeaderCode, llvm::StringRef Code, +llvm::StringRef Filename = "") { +TestTU TU; +TU.HeaderCode = HeaderCode; +TU.Code = Code; +if (!Filename.empty()) + TU.Filename = Filename; +return TU; + } + // The code to be compiled. std::string Code; std::string Filename = "TestTU.cpp"; Index: unittests/clangd/TestTU.cpp === --- unittests/clangd/TestTU.cpp +++ unittests/clangd/TestTU.cpp @@ -45,7 +45,7 @@ SymbolSlab TestTU::headerSymbols() const { auto AST = build(); - return indexAST(AST.getASTContext(), AST.getPreprocessorPtr()); + return indexAST(AST.getASTContext(), AST.getPreprocessorPtr()).first; } std::unique_ptr TestTU::index() const { Index: unittests/clangd/IndexTests.cpp === --- unittests/clangd/IndexTests.cpp +++ unittests/clangd/IndexTests.cpp @@ -8,20 +8,33 @@ //===--===// #include "TestIndex.h" +#include "TestTU.h" +#include "Annotations.h" #include "index/Index.h" #include "index/MemIndex.h" #include "index/Merge.h" +#include "index/FileIndex.h" #include "gmock/gmock.h" #include "gtest/gtest.h" using testing::Pointee; using testing::UnorderedElementsAre; +using testing::AllOf; namespace clang { namespace clangd { namespace { MATCHER_P(Named, N, "") { return arg.Name == N; } +MATCHER_P(OccurrenceRange, Range, "") { + return std::tie(arg.Location.Start.Line, + arg.Location.Start.Column, + arg.Location.End.Line, + arg.Location.End.Column) == + std::tie(Range.start.line, Range.start.character, Range.end.line, + Range.end.character); +} +MATCHER_P(FileURI, F, "") { return arg.Location.FileURI == F; } TEST(SymbolSlab, FindAndIterate) { SymbolSlab::Builder B; @@ -243,6 +256,55 @@ EXPECT_EQ(M.Name, "right"); } +TEST(MergeIndexTest, FindOccurrences) { + FileIndex Dyn({"unittest"}); + FileIndex StaticIndex({"unittest"}); + auto MergedIndex = mergeIndex(&Dyn, &StaticIndex); + + const char* HeaderCode = "class Foo;"; + auto HeaderSymbols = TestTU::withHeaderCode("class Foo;").headerSymbols(); + auto Foo = findSymbol(HeaderSymbols, "Foo"); + + // Build dynamic index. + Annotations Test1Code(R"(class $Foo[[Foo]];)"); + auto AST = + TestTU::withAllCode(HeaderCode, Test1Code.code(), "test.cc").build(); + Dyn.update("test.cc", &AST.getASTContext(), AST.getPreprocessorPtr(), + AST.getLocalTopLevelDecls()); + + // Build static index. + auto StaticAST = + TestTU::withAllCode(HeaderCode, "// static\nclass Foo {};", "test.cc") + .build(); + // Add stale occurrences for test.cc. + StaticIndex.update("test.cc", &StaticAST.getASTContext(), + StaticAST.getPreprocessorPtr(), + StaticAST.getLocalTopLevelDecls()); + + // Add occcurrences for test2.cc + Annotations Test2Code(R"(class $Foo[[Foo]] {};)"); + StaticAST = + TestTU::withAllCode(HeaderCode, Test2Code.code(), "test2.cc").build(); + StaticIndex.update("test2.cc", &StaticAST.getASTContext(), + StaticAST.getPreprocessorPtr(), + StaticAST.getLocalTopLevelDecls()); + + OccurrencesRequest Request; + Request.IDs = {Foo.ID}; + Request.Filter = SymbolOccurrenceKind::Declaration | + SymbolOccurrenceKind::Definition | + SymbolOccurrenceKind::Reference; + std::vector Results; + MergedIndex->findOccurrences( + Request, [&](const SymbolOccurrence &O) { Results.push_back(O); }); + + EXPECT_THAT(Results, + UnorderedElementsAre(AllOf(OccurrenceRange(Test1Code.range("Foo")), + FileURI("unittest:///test.cc")), + AllOf(OccurrenceRange(Test2Code.range("Foo")), + FileURI("unittest:///test2.cc"; +} + } // namespace } // namespace clangd } // namesp
[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.
hokein added a comment. Some numbers of memory usage from running this on my machine: | File | Preamble AST | Main AST | | SemaDecl.cpp | 14.5MB | 108.1KB (symbols) + 16.5KB (occurrences) | | CodeComplete.cpp | 15.4MB | 53.9KB (symbols) + 7.3KB (occurrences) | | The memory usage of `occurrences` is relatively small, I think it is fine to enable it by default. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D50958: [clangd] WIP: xrefs for dynamic index.
hokein added a comment. Thanks for the comments. In https://reviews.llvm.org/D50958#1212221, @sammccall wrote: > I do have some questions there that would be good to discuss. Meanwhile, > @hokein can you rebase this patch against head? Yes, I'd love to, but since this patch is quite large, I need split it into smaller patches. I will update this patch (focus on the `references` implementation), it depends on the following patches - https://reviews.llvm.org/D50385 - https://reviews.llvm.org/D51279 Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50958 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r340714 - [X86] Undef __DEFAULT_FN_ATTRS in avx512fintrin.h.
Author: ctopper Date: Sun Aug 26 22:44:45 2018 New Revision: 340714 URL: http://llvm.org/viewvc/llvm-project?rev=340714&view=rev Log: [X86] Undef __DEFAULT_FN_ATTRS in avx512fintrin.h. Fixes test failure after r340713 Modified: cfe/trunk/lib/Headers/avx512fintrin.h Modified: cfe/trunk/lib/Headers/avx512fintrin.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512fintrin.h?rev=340714&r1=340713&r2=340714&view=diff == --- cfe/trunk/lib/Headers/avx512fintrin.h (original) +++ cfe/trunk/lib/Headers/avx512fintrin.h Sun Aug 26 22:44:45 2018 @@ -9595,5 +9595,6 @@ _mm512_mask_reduce_min_ps(__mmask16 __M, #undef __DEFAULT_FN_ATTRS512 #undef __DEFAULT_FN_ATTRS128 +#undef __DEFAULT_FN_ATTRS #endif /* __AVX512FINTRIN_H */ ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r340717 - [X86] Rename __DEFAULT_FN_ATTRS to a__DEFAULT_FN_ATTRS512 in avx512dqintrin.h and avx512bwintrin.h.
Author: ctopper Date: Sun Aug 26 23:20:19 2018 New Revision: 340717 URL: http://llvm.org/viewvc/llvm-project?rev=340717&view=rev Log: [X86] Rename __DEFAULT_FN_ATTRS to a__DEFAULT_FN_ATTRS512 in avx512dqintrin.h and avx512bwintrin.h. This is preparation for adding removing min_vector_width 512 from some intrinsics. Modified: cfe/trunk/lib/Headers/avx512bwintrin.h cfe/trunk/lib/Headers/avx512dqintrin.h Modified: cfe/trunk/lib/Headers/avx512bwintrin.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512bwintrin.h?rev=340717&r1=340716&r2=340717&view=diff == --- cfe/trunk/lib/Headers/avx512bwintrin.h (original) +++ cfe/trunk/lib/Headers/avx512bwintrin.h Sun Aug 26 23:20:19 2018 @@ -32,7 +32,7 @@ typedef unsigned int __mmask32; typedef unsigned long long __mmask64; /* Define the default attributes for the functions in this file. */ -#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512bw"), __min_vector_width__(512))) +#define __DEFAULT_FN_ATTRS512 __attribute__((__always_inline__, __nodebug__, __target__("avx512bw"), __min_vector_width__(512))) /* Integer compare */ @@ -176,102 +176,102 @@ typedef unsigned long long __mmask64; #define _mm512_mask_cmpneq_epu16_mask(k, A, B) \ _mm512_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_NE) -static __inline__ __m512i __DEFAULT_FN_ATTRS +static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_add_epi8 (__m512i __A, __m512i __B) { return (__m512i) ((__v64qu) __A + (__v64qu) __B); } -static __inline__ __m512i __DEFAULT_FN_ATTRS +static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_mask_add_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_add_epi8(__A, __B), (__v64qi)__W); } -static __inline__ __m512i __DEFAULT_FN_ATTRS +static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_maskz_add_epi8(__mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_add_epi8(__A, __B), (__v64qi)_mm512_setzero_si512()); } -static __inline__ __m512i __DEFAULT_FN_ATTRS +static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_sub_epi8 (__m512i __A, __m512i __B) { return (__m512i) ((__v64qu) __A - (__v64qu) __B); } -static __inline__ __m512i __DEFAULT_FN_ATTRS +static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_mask_sub_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_sub_epi8(__A, __B), (__v64qi)__W); } -static __inline__ __m512i __DEFAULT_FN_ATTRS +static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_maskz_sub_epi8(__mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_sub_epi8(__A, __B), (__v64qi)_mm512_setzero_si512()); } -static __inline__ __m512i __DEFAULT_FN_ATTRS +static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_add_epi16 (__m512i __A, __m512i __B) { return (__m512i) ((__v32hu) __A + (__v32hu) __B); } -static __inline__ __m512i __DEFAULT_FN_ATTRS +static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_mask_add_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_add_epi16(__A, __B), (__v32hi)__W); } -static __inline__ __m512i __DEFAULT_FN_ATTRS +static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_maskz_add_epi16(__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_add_epi16(__A, __B), (__v32hi)_mm512_setzero_si512()); } -static __inline__ __m512i __DEFAULT_FN_ATTRS +static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_sub_epi16 (__m512i __A, __m512i __B) { return (__m512i) ((__v32hu) __A - (__v32hu) __B); } -static __inline__ __m512i __DEFAULT_FN_ATTRS +static __inline__ __m512i __DEFAULT_FN_ATTRS512 _mm512_mask_sub_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_sub_epi16(__A, __B), (__v32hi)__W); } -static __inline__ __m512i __DEFAULT_FN_ATTRS +static __inline__ __m512i
r340719 - [X86] Add intrinsics for kand/kandn/knot/kor/kxnor/kxor with 8, 32, and 64-bit mask registers.
Author: ctopper Date: Sun Aug 26 23:20:22 2018 New Revision: 340719 URL: http://llvm.org/viewvc/llvm-project?rev=340719&view=rev Log: [X86] Add intrinsics for kand/kandn/knot/kor/kxnor/kxor with 8, 32, and 64-bit mask registers. This also adds a second intrinsic name for the 16-bit mask versions. These intrinsics match gcc and icc. They just aren't published in the Intel Intrinsics Guide so I only recently found they existed. Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def cfe/trunk/lib/CodeGen/CGBuiltin.cpp cfe/trunk/lib/Headers/avx512bwintrin.h cfe/trunk/lib/Headers/avx512dqintrin.h cfe/trunk/lib/Headers/avx512fintrin.h cfe/trunk/test/CodeGen/avx512bw-builtins.c cfe/trunk/test/CodeGen/avx512dq-builtins.c cfe/trunk/test/CodeGen/avx512f-builtins.c Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=340719&r1=340718&r2=340719&view=diff == --- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original) +++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Sun Aug 26 23:20:22 2018 @@ -1005,7 +1005,10 @@ TARGET_BUILTIN(__builtin_ia32_scatterpfd TARGET_BUILTIN(__builtin_ia32_scatterpfqpd, "vUcV8LLiLLi*IiIi", "nV:512:", "avx512pf") TARGET_BUILTIN(__builtin_ia32_scatterpfqps, "vUcV8LLii*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_knotqi, "UcUc", "nc", "avx512dq") TARGET_BUILTIN(__builtin_ia32_knothi, "UsUs", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_knotsi, "UiUi", "nc", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_knotdi, "ULLiULLi", "nc", "avx512bw") TARGET_BUILTIN(__builtin_ia32_cmpb128_mask, "UsV16cV16cIiUs", "ncV:128:", "avx512vl,avx512bw") TARGET_BUILTIN(__builtin_ia32_cmpd128_mask, "UcV4iV4iIiUc", "ncV:128:", "avx512vl") @@ -1734,14 +1737,29 @@ TARGET_BUILTIN(__builtin_ia32_fpclassps5 TARGET_BUILTIN(__builtin_ia32_fpclasspd512_mask, "UcV8dIiUc", "ncV:512:", "avx512dq") TARGET_BUILTIN(__builtin_ia32_fpclasssd_mask, "UcV2dIiUc", "ncV:128:", "avx512dq") TARGET_BUILTIN(__builtin_ia32_fpcla_mask, "UcV4fIiUc", "ncV:128:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_kandqi, "UcUcUc", "nc", "avx512dq") TARGET_BUILTIN(__builtin_ia32_kandhi, "UsUsUs", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_kandsi, "UiUiUi", "nc", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_kanddi, "ULLiULLiULLi", "nc", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_kandnqi, "UcUcUc", "nc", "avx512dq") TARGET_BUILTIN(__builtin_ia32_kandnhi, "UsUsUs", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_kandnsi, "UiUiUi", "nc", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_kandndi, "ULLiULLiULLi", "nc", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_korqi, "UcUcUc", "nc", "avx512dq") TARGET_BUILTIN(__builtin_ia32_korhi, "UsUsUs", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_korsi, "UiUiUi", "nc", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_kordi, "ULLiULLiULLi", "nc", "avx512bw") TARGET_BUILTIN(__builtin_ia32_kortestchi, "iUsUs", "nc", "avx512f") TARGET_BUILTIN(__builtin_ia32_kortestzhi, "iUsUs", "nc", "avx512f") TARGET_BUILTIN(__builtin_ia32_kunpckhi, "UsUsUs", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_kxnorqi, "UcUcUc", "nc", "avx512dq") TARGET_BUILTIN(__builtin_ia32_kxnorhi, "UsUsUs", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_kxnorsi, "UiUiUi", "nc", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_kxnordi, "ULLiULLiULLi", "nc", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_kxorqi, "UcUcUc", "nc", "avx512dq") TARGET_BUILTIN(__builtin_ia32_kxorhi, "UsUsUs", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_kxorsi, "UiUiUi", "nc", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_kxordi, "ULLiULLiULLi", "nc", "avx512bw") TARGET_BUILTIN(__builtin_ia32_palignr512, "V64cV64cV64cIi", "ncV:512:", "avx512bw") TARGET_BUILTIN(__builtin_ia32_dbpsadbw128, "V8sV16cV16cIi", "ncV:128:", "avx512bw,avx512vl") TARGET_BUILTIN(__builtin_ia32_dbpsadbw256, "V16sV32cV32cIi", "ncV:256:", "avx512bw,avx512vl") Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=340719&r1=340718&r2=340719&view=diff == --- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original) +++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Sun Aug 26 23:20:22 2018 @@ -8603,8 +8603,9 @@ static Value *EmitX86CompressStore(CodeG } static Value *EmitX86MaskLogic(CodeGenFunction &CGF, Instruction::BinaryOps Opc, - unsigned NumElts, ArrayRef Ops, + ArrayRef Ops, bool InvertLHS = false) { + unsigned NumElts = Ops[0]->getType()->getIntegerBitWidth(); Value *LHS = getMaskVecValue(CGF, Ops[0], NumElts); Value *RHS = getMaskVecValue(CGF, Ops[1], NumElts); @@ -10013,7 +10014,7 @@ Value *CodeGenFunction::EmitX86BuiltinEx case X8
r340718 - [X86] Remove min_vector_width 512 from some intrinsics that operate only on k-registers.
Author: ctopper Date: Sun Aug 26 23:20:20 2018 New Revision: 340718 URL: http://llvm.org/viewvc/llvm-project?rev=340718&view=rev Log: [X86] Remove min_vector_width 512 from some intrinsics that operate only on k-registers. Modified: cfe/trunk/lib/Headers/avx512bwintrin.h Modified: cfe/trunk/lib/Headers/avx512bwintrin.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512bwintrin.h?rev=340718&r1=340717&r2=340718&view=diff == --- cfe/trunk/lib/Headers/avx512bwintrin.h (original) +++ cfe/trunk/lib/Headers/avx512bwintrin.h Sun Aug 26 23:20:20 2018 @@ -33,6 +33,7 @@ typedef unsigned long long __mmask64; /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS512 __attribute__((__always_inline__, __nodebug__, __target__("avx512bw"), __min_vector_width__(512))) +#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512bw"))) /* Integer compare */ @@ -1792,5 +1793,6 @@ _mm512_sad_epu8 (__m512i __A, __m512i __ } #undef __DEFAULT_FN_ATTRS512 +#undef __DEFAULT_FN_ATTRS #endif ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D51281: [libclang] Return the proper pointee type for 'auto' deduced to pointer
yvvan created this revision. yvvan added reviewers: erikjv, arphaman, michaelwu. Currently the resulting type is always invalid in such case. https://reviews.llvm.org/D51281 Files: tools/libclang/CXType.cpp Index: tools/libclang/CXType.cpp === --- tools/libclang/CXType.cpp +++ tools/libclang/CXType.cpp @@ -427,6 +427,7 @@ if (!TP) return MakeCXType(QualType(), GetTU(CT)); +try_again: switch (TP->getTypeClass()) { case Type::Pointer: T = cast(TP)->getPointeeType(); @@ -444,6 +445,11 @@ case Type::MemberPointer: T = cast(TP)->getPointeeType(); break; +case Type::Auto: + TP = cast(TP)->getDeducedType().getTypePtrOrNull(); + if (TP) +goto try_again; + break; default: T = QualType(); break; Index: tools/libclang/CXType.cpp === --- tools/libclang/CXType.cpp +++ tools/libclang/CXType.cpp @@ -427,6 +427,7 @@ if (!TP) return MakeCXType(QualType(), GetTU(CT)); +try_again: switch (TP->getTypeClass()) { case Type::Pointer: T = cast(TP)->getPointeeType(); @@ -444,6 +445,11 @@ case Type::MemberPointer: T = cast(TP)->getPointeeType(); break; +case Type::Auto: + TP = cast(TP)->getDeducedType().getTypePtrOrNull(); + if (TP) +goto try_again; + break; default: T = QualType(); break; ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits