1. Jul 13, 2020
    • Aleksandr Platonov's avatar
      [clangd] Fix tests build for GCC5 · 07c4c7e7
      Aleksandr Platonov authored
      Summary:
      Build log:
      ```
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp: In member function ‘virtual void clang::clangd::{anonymous}::PreamblePatchTest_Define_Test::TestBody()’:
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:267:3: error: could not convert ‘(const char*)"\012        #define BAR\012        [[BAR]]"’ from ‘const char*’ to ‘llvm::StringLitera ’
         };
         ^
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:267:3: error: could not convert ‘(const char*)"#line 0 \".*main.cpp\"\012#line 2\012#define         BAR\012"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:267:3: error: could not convert ‘(const char*)"\012        #define BAR \\\012\012        [[BAR]]"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:267:3: error: could not convert ‘(const char*)"#line 0 \".*main.cpp\"\012#line 2\012#define         BAR\012"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:267:3: error: could not convert ‘(const char*)"\012        #define \\\012                BAR\012        [[BAR]]"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:267:3: error: could not convert ‘(const char*)"#line 0 \".*main.cpp\"\012#line 3\012#define         BAR\012"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp: In member function ‘virtual void clang::clangd::{anonymous}::PreamblePatchTest_LocateMacroAtWorks_Test::TestBody()’:
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
         };
         ^
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)"\012            #define $def^FOO\012            $use^FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)"\012            #define $def^FOO\012            #undef $use^FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)"\012            #define $def^FOO\012            #undef FOO\012            $use^FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)"\012            #define \\\012              $def^FOO\012            $use^FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)"\012            #\\\012              define /* FOO */\\\012              /* FOO */ $def^FOO\012            $use^FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)"#define FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)"\012            #define BAR\012            #define $def^FOO\012            $use^FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp: In member function ‘virtual void clang::clangd::{anonymous}::PreamblePatchTest_RefsToMacros_Test::TestBody()’:
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:445:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
         };
         ^
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:445:3: error: could not convert ‘(const char*)"\012            #define ^FOO\012            ^[[FOO]]"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:445:3: error: could not convert ‘(const char*)"#define FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:445:3: error: could not convert ‘(const char*)"\012            #define BAR\012            #define ^FOO\012            ^[[FOO]]"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:445:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:445:3: error: could not convert ‘(const char*)"\012            #define ^FOO\012            #undef ^FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp: In member function ‘virtual void clang::clangd::{anonymous}::PreamblePatch_ModifiedBounds_Test::TestBody()’:
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:512:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
         };
         ^
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:512:3: error: could not convert ‘(const char*)"\012            #define FOO\012            FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:512:3: error: could not convert ‘(const char*)"#define FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:512:3: error: could not convert ‘(const char*)"#define BAR"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:512:3: error: could not convert ‘(const char*)"\012            #define FOO\012            #undef FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
      llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:512:3: error: could not convert ‘(const char*)"#define FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
      ```
      
      Patch by @ArcsinX !
      
      Reviewers: kadircet, sammccall
      
      Reviewed By: kadircet
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D83548
      07c4c7e7
    • Max Kazantsev's avatar
      [InstCombine] Improve select -> phi canonicalization: consider more blocks · e808cab8
      Max Kazantsev authored
      We can try to replace select with a Phi not in its parent block alone,
      but also in blocks of its arguments. We benefit from it when select's
      argument is a Phi.
      
      Differential Revision: https://reviews.llvm.org/D83284
      Reviewed By: nikic
      e808cab8
    • Kai Luo's avatar
      [PowerPC] Enhance tests for D83276. NFC. · ac8dc526
      Kai Luo authored
      ac8dc526
    • Qiu Chaofan's avatar
      [PowerPC] Support constrained conversion in SPE target · b6912c87
      Qiu Chaofan authored
      This patch adds support for constrained int/fp conversion between
      signed/unsigned i32 and f32/f64.
      
      Reviewed By: jhibbits
      
      Differential Revision: https://reviews.llvm.org/D82747
      b6912c87
    • Fangrui Song's avatar
      [MC][RISCV] Set UseIntegratedAssembler to true · 4d5fd0ee
      Fangrui Song authored
      to align with most other targets. Also, -fintegrated-as is the default
      for clang -target riscv*.
      4d5fd0ee
    • Atmn Patel's avatar
      [OpenMP] Add firstprivate as a default data-sharing attribute to clang · 78443666
      Atmn Patel authored
      This implements the default(firstprivate) clause as defined in OpenMP
      Technical Report 8 (2.22.4).
      
      Reviewed By: jdoerfert, ABataev
      
      Differential Revision: https://reviews.llvm.org/D75591
      78443666
    • David Blaikie's avatar
      Revert "Rename/refactor isIntegerConstantExpression to getIntegerConstantExpression" · c9433291
      David Blaikie authored
      Broke buildbots since I hadn't updated this patch in a while. Sorry for
      the noise.
      
      This reverts commit 49e5f603.
      c9433291
    • David Blaikie's avatar
      Rename/refactor isIntegerConstantExpression to getIntegerConstantExpression · 49e5f603
      David Blaikie authored
      There is a version that just tests (also called
      isIntegerConstantExpression) & whereas this version is specifically used
      when the value is of interest (a few call sites were actually refactored
      to calling the test-only version) so let's make the API look more like
      it.
      
      Reviewers: aaron.ballman
      
      Differential Revision: https://reviews.llvm.org/D76646
      49e5f603
    • Craig Topper's avatar
      [X86] Rename X86_CPU_TYPE_COMPAT_ALIAS/X86_CPU_TYPE_COMPAT/X86_CPU_SUBTYPE_COMPAT macros. NFC · b4dbb37f
      Craig Topper authored
      Remove _COMPAT. Drop the ARCHNAME. Remove the non-COMPAT versions
      that are no longer needed.
      
      We now only use these macros in places where we need compatibility
      with libgcc/compiler-rt. So we don't need to call out _COMPAT
      specifically.
      b4dbb37f
    • Logan Smith's avatar
      [clang] Add -Wsuggest-override · 11116789
      Logan Smith authored
      This patch adds `-Wsuggest-override`, which allows for more aggressive enforcement of modern C++ best practices, as well as better compatibility with gcc, which has had its own `-Wsuggest-override` since version 5.1.
      
      Clang already has `-Winconsistent-missing-override`, which only warns in the case where there is at least one function already marked `override` in a class. This warning strengthens that warning by suggesting the `override` keyword regardless of whether it is already present anywhere.
      
      The text between suggest-override and inconsistent-missing-override is now shared, using `TextSubstitution` for the entire diagnostic text.
      
      Reviewed By: dblaikie
      
      Differential Revision: https://reviews.llvm.org/D82728
      11116789
    • Shinji Okumura's avatar
      [Attributor] Add AAValueSimplifyCallSiteArgument::manifest · c73f425f
      Shinji Okumura authored
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D82861
      c73f425f
    • Dimitry Andric's avatar
      Bump the default target CPU for i386-freebsd to i686 · 02cfa753
      Dimitry Andric authored
      Summary:
      Similar to what we have done downstream, some time ago:
      https://svnweb.freebsd.org/changeset/base/353936
      
      This followed some discussions on the freebsd-arch mailing lists, and
      most people agreed that it was a better default, and also it worked
      around several issues where clang generated libcalls to 64 bit atomic
      primitives, instead of using cmpxchg8b.
      
      Reviewers: emaste, brooks, rsmith
      
      Reviewed By: emaste
      
      Subscribers: arichardson, krytarowski, jfb, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D83645
      02cfa753
    • Alexey Lapshin's avatar
      Revert "[TRE] allow TRE for non-capturing calls." · 0a01fc96
      Alexey Lapshin authored
      This reverts commit f7907e9d.
      
      That commit caused error on multi-stage build.
      0a01fc96
    • River Riddle's avatar
      [mlir][ODS] Add support for specifying the namespace of an interface. · 572c2905
      River Riddle authored
      The namespace can be specified using the `cppNamespace` field. This matches the functionality already present on dialects, enums, etc. This fixes problems with using interfaces on operations in a different namespace than the interface was defined in.
      
      Differential Revision: https://reviews.llvm.org/D83604
      572c2905
    • Craig Topper's avatar
      [X86] Remove model number based detection for 'pentiumpro', 'pentium2',... · 90c577a1
      Craig Topper authored
      [X86] Remove model number based detection for 'pentiumpro', 'pentium2', 'pentium3', 'pentium-m', and 'yonah' from getHostCPUName.
      
      For model 6 CPUs, we have a fallback detection method based on
      available features. That mechanism should be enough to detect
      these early family 6 CPUs as they only differ in the features
      used by the detection anyway.
      90c577a1
    • Craig Topper's avatar
      [X86] Add CPU string output to... · ea84dc95
      Craig Topper authored
      [X86] Add CPU string output to getIntelProcessorTypeAndSubtype/getAMDProcessorTypeAndSubtype in Host.cpp
      
      Rather than converting type/subtype into strings, just directly
      select the string as part of family/model decoding. This avoids
      the need for creating fake Type/SubTypes for CPUs not supported
      by compiler-rtl. I've left the Type/SubType in place where it matches
      compiler-rt so that the code can be diffed, but the Type/SubType
      is no longer used by Host.cpp.
      
      compiler-rt was already updated to select strings that aren't used
      so the code will look similar.
      ea84dc95
    • Craig Topper's avatar
      [X86] Add CPU name strings to getIntelProcessorTypeAndSubtype and... · b92c2bb6
      Craig Topper authored
      [X86] Add CPU name strings to getIntelProcessorTypeAndSubtype and getAMDProcessorTypeAndSubtype in compiler-rt.
      
      These aren't used in compiler-rt, but I plan to make a similar
      change to the equivalent code in Host.cpp where the mapping from
      type/subtype is an unnecessary complication. Having the CPU strings
      here will help keep the code somewhat synchronized.
      b92c2bb6
    • Sanjay Patel's avatar
      [InstCombine] fold mul of zext/sext bools to 'and' · 44589733
      Sanjay Patel authored
      Similar to rG40fcc424:
      The base case only worked because we were relying on a
      poison-unsafe select transform; if that is fixed, we
      would regress on patterns like this.
      
      The extra use tests show that the select transform can't
      be applied consistently. So it may be a regression to have
      an extra instruction on 1 test, but that result was not
      created safely and does not happen reliably.
      44589733
    • Sjoerd Meijer's avatar
      Revert "[Matrix] Tighten LangRef definitions and Verifier checks." · 4ff7ed33
      Sjoerd Meijer authored
      This reverts commit f4d29d6e.
      
      Hm, some build bot failures, reverting it while I investigate that.
      4ff7ed33
    • Sjoerd Meijer's avatar
      [Matrix] Tighten LangRef definitions and Verifier checks. · f4d29d6e
      Sjoerd Meijer authored
      This tightens the matrix intrinsic definitions in LLVM LangRef and adds
      correspondings checks to the IR Verifier.
      
      Differential Revision: https://reviews.llvm.org/D83477
      f4d29d6e
    • mydeveloperday's avatar
      7a1bcf9f
    • Craig Topper's avatar
      [X86] Consistently use 128 as the PSHUFB/VPPERM index for zero · f8f007e3
      Craig Topper authored
      Bit 7 of the index controls zeroing, the other bits are ignored when bit 7 is set. Shuffle lowering was using 128 and shuffle combining was using 255. Seems like we should be consistent.
      
      This patch changes shuffle combining to use 128 to match lowering.
      
      Reviewed By: RKSimon
      
      Differential Revision: https://reviews.llvm.org/D83587
      f8f007e3
    • Craig Topper's avatar
      [X86] Fix two places that appear to misuse peekThroughOneUseBitcasts · 04013a07
      Craig Topper authored
      peekThroughOneUseBitcasts checks the use count of the operand of the bitcast. Not the bitcast itself. So I think that means we need to do any outside haseOneUse checks before calling the function not after.
      
      I was working on another patch where I misused the function and did a very quick audit to see if I there were other similar mistakes.
      
      Reviewed By: RKSimon
      
      Differential Revision: https://reviews.llvm.org/D83598
      04013a07
    • mydeveloperday's avatar
      [clang-format] PR46609 clang-format does not obey `PointerAlignment: Right`... · 65dc97b7
      mydeveloperday authored
      [clang-format] PR46609 clang-format does not obey `PointerAlignment: Right` for ellipsis in declarator for pack
      
      Summary:
      https://bugs.llvm.org/show_bug.cgi?id=46609
      
      Ensure `*...` obey they left/middle/right rules of Pointer alignment
      
      Reviewed By: curdeius
      
      Differential Revision: https://reviews.llvm.org/D83564
      65dc97b7
    • Ayal Zaks's avatar
      [LV] Fixing versioning-for-unit-stide of loops with small trip count · 82a5157f
      Ayal Zaks authored
      This patch fixes D81345 and PR46652.
      
      If a loop with a small trip count is compiled w/o -Os/-Oz, Loop Access Analysis
      still generates runtime checks for unit strides that will version the loop.
      
      In such cases, the loop vectorizer should either re-run the analysis or bail-out
      from vectorizing the loop, as done prior to D81345. The latter is applied for
      now as the former requires refactoring.
      
      Differential Revision: https://reviews.llvm.org/D83470
      82a5157f
    • Yonghong Song's avatar
      BPF: permit .maps section variables with typedef type · 152a9fef
      Yonghong Song authored
      Currently, llvm when see a global variable in .maps section,
      it ensures its type must be a struct type. Then pointee
      will be further evaluated for the structure members.
      In normal cases, the pointee type will be skipped.
      
      Although this is what current all bpf programs are doing,
      but it is a little bit restrictive. For example, it is legitimate
      for users to have:
      typedef struct { int key_size; int value_size; } __map_t;
      __map_t map __attribute__((section(".maps")));
      
      This patch lifts this restriction and typedef of
      a struct type is also allowed for .maps section variables.
      To avoid create unnecessary fixup entries when traversal
      started with typedef/struct type, the new implementation
      first traverse all map struct members and then traverse
      the typedef/struct type. This way, in internal BTFDebug
      implementation, no fixup entries are generated.
      
      Two new unit tests are added for typedef and const
      struct in .maps section. Also tested with kernel bpf selftests.
      
      Differential Revision: https://reviews.llvm.org/D83638
      152a9fef
    • Ayke van Laethem's avatar
      [LLD][ELF][AVR] Implement the missing relocation types · 69e60c9d
      Ayke van Laethem authored
      Implements the missing relocation types for AVR target.
      The results have been cross-checked with binutils.
      
      Original patch by LemonBoy. Some changes by me.
      
      Differential Revision: https://reviews.llvm.org/D78741
      69e60c9d
  2. Jul 12, 2020