1. Feb 23, 2021
  2. Feb 22, 2021
    • Nathan James's avatar
      [clang][NFC] Reorder CXXCtorInitializer members · daeb70be
      Nathan James authored
      Swapping the order of Init and MemberOrEllipsisLocation removes 8 bytes (20%) of padding on 64bit builds.
      
      Reviewed By: aaron.ballman
      
      Differential Revision: https://reviews.llvm.org/D97191
      daeb70be
    • Sanjay Patel's avatar
      b02bc022
    • Anastasia Stulova's avatar
      [pp-trace] Fix test for OpenCL pragmas. · b71add97
      Anastasia Stulova authored
      After updating clang driver to include standard
      OpenCL headers implicitly, the output being checked
      in the test does not match because the implicit
      header contains other pragmas. The test does not
      aim to use the header and therefore it has to be
      updated passing '-cl-no-stdinc' command-line flag.
      
      This fixes failing bots.
      b71add97
    • Mikhail Goncharov's avatar
    • Mikhail Goncharov's avatar
      Revert "Revert "Implement nullPointerConstant() using a better API."" · ba1d9546
      Mikhail Goncharov authored
      This reverts commit 6984e0d4.
      
      While change by itself seems to be consistent with nullPointerConstant
      docs of not matching "int i = 0;" but it's not clear why it's wrong and
      9148302a author just forgot to update
      the doc.
      ba1d9546
    • Anastasia Stulova's avatar
      [OpenCL] Add builtin declarations by default. · cf3ef15a
      Anastasia Stulova authored
      This change enables the builtin function declarations
      in clang driver by default using the Tablegen solution
      along with the implicit include of 'opencl-c-base.h'
      header.
      
      A new flag '-cl-no-stdinc' disabling all default
      declarations and header includes is added. If any other
      mechanisms were used to include the declarations (e.g.
      with -Xclang -finclude-default-header) and the new default
      approach is not sufficient the, `-cl-no-stdinc` flag has
      to be used with clang to activate the old behavior.
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D96515
      cf3ef15a
    • Simon Pilgrim's avatar
      [InstCombine] Add PR45977 test coverage · 19084887
      Simon Pilgrim authored
      19084887
    • Ryan Santhiraraja's avatar
      [AArch64] Adding SHA3 Intrinsics support · 2c25efcb
      Ryan Santhiraraja authored
          This patch adds the following SHA3 Intrinsics:
              vsha512hq_u64,
              vsha512h2q_u64,
              vsha512su0q_u64,
              vsha512su1q_u64
              veor3q_u8
              veor3q_u16
              veor3q_u32
              veor3q_u64
              veor3q_s8
              veor3q_s16
              veor3q_s32
              veor3q_s64
              vrax1q_u64
              vxarq_u64
              vbcaxq_u8
              vbcaxq_u16
              vbcaxq_u32
              vbcaxq_u64
              vbcaxq_s8
              vbcaxq_s16
              vbcaxq_s32
              vbcaxq_s64
      
          Note need to include +sha3 and +crypto when building from the front-end
      
      Reviewed By: DavidSpickett
      
      Differential Revision: https://reviews.llvm.org/D96381
      2c25efcb
    • Dmitry Preobrazhensky's avatar
      [AMDGPU][MC] Corrected bound_ctrl for compatibility with sp3 · 48135180
      Dmitry Preobrazhensky authored
      Enabled "bound_ctrl:1" and disabled "bound_ctrl:-1" syntax.
      Corrected printer to output "bound_ctrl:1" instead of "bound_ctrl:0".
      See bug 35397 for detailed issue description.
      
      Differential Revision: https://reviews.llvm.org/D97048
      48135180
    • LLVM GN Syncbot's avatar
      [gn build] Port 7dc7f0c2 · 7af9ea54
      LLVM GN Syncbot authored
      7af9ea54
    • Balázs Kéri's avatar
      7dc7f0c2
    • Nashe Mncube's avatar
      [llvm-link] fix IRMover returning wrong modified vector type · 0327cfe2
      Nashe Mncube authored
      Modified scalable vector types weren't correctly returned at link-time.
      The previous behaviour was a FixedVectorType was constructed
      when expecting a ScalableVectorType. This commit has added a regression
      test which re-creates the failure as well as a fix.
      
      Reviewed By: sdesmalen
      
      Differential Revision: https://reviews.llvm.org/D96953
      0327cfe2
    • Stephen Kelly's avatar
      Regenerate documentation · b5b3243b
      Stephen Kelly authored
      b5b3243b
    • LLVM GN Syncbot's avatar
      [gn build] Port 6e307100 · ad375ac5
      LLVM GN Syncbot authored
      ad375ac5
    • Florian Hahn's avatar
      [VPlan] Skip VPWidenPHIRecipe in VPInterleavedACcessInfo. · c11fd0df
      Florian Hahn authored
      Update unit tests that did not expect VPWidenPHIRecipes after
      15a74b64.
      c11fd0df
    • Simon Pilgrim's avatar
      106b63de
    • Andrzej Warzynski's avatar
      [flang][driver] Add -Xflang and make -test-io a frontend-only flang · d81f633f
      Andrzej Warzynski authored
      This patch adds support for `-Xflang` in `flang-new`. The semantics are
      identical to `-Xclang`.
      
      With the addition of `-Xflang`, we can modify `-test-io` to be a
      compiler-frontend only flag. This makes more sense, this flag is:
        * very frontend specific
        * to be used for development and testing only
        * not to be exposed to the end user
      Originally we added it to the compiler driver, `flang-new`, in order to
      facilitate testing. With `-Xflang` this is no longer needed. Tests are
      updated accordingly.
      
      Differential Revision: https://reviews.llvm.org/D96864
      d81f633f
    • David Green's avatar
      [ARM] Remove dead lowering code. NFC · 188f15d9
      David Green authored
      Remove the unnecessary code from 21a4faab, left over from
      a different way of lowering.
      188f15d9
    • Balazs Benics's avatar
      [analyzer][CTU] API for CTU macro expansions · 38b18583
      Balazs Benics authored
      Removes `CrossTranslationUnitContext::getImportedFromSourceLocation`
      Removes the corresponding unit-test segment.
      
      Introduces the `CrossTranslationUnitContext::getMacroExpansionContextForSourceLocation`
      which will return the macro expansion context for an imported TU. Also adds a
      few implementation FIXME notes where applicable, since this feature is
      not implemented yet. This fact is also noted as Doxygen comments.
      
      Uplifts a few CTU LIT test to match the current **incomplete** behavior.
      
      It is a regression to some extent since now we don't expand any
      macros in imported TUs. At least we don't crash anymore.
      
      Note that the introduced function is already covered by LIT tests.
      Eg.: Analysis/plist-macros-with-expansion-ctu.c
      
      Reviewed By: balazske, Szelethus
      
      Differential Revision: https://reviews.llvm.org/D94673
      38b18583
    • Balazs Benics's avatar
      [analyzer] Use the MacroExpansionContext for macro expansions in plists · 170c67d5
      Balazs Benics authored
      Removes the obsolete ad-hoc macro expansions during bugreport constructions.
      It will skip the macro expansion if the expansion happened in an imported TU.
      
      Also removes the expected plist file, while expanding matching context for
      the tests.
      Adds a previously crashing `plist-macros-with-expansion.c` testfile.
      Temporarily marks `plist-macros-with-expansion-ctu.c ` to `XFAIL`.
      
      Reviewed By: xazax.hun, Szelethus
      
      Differential Revision: https://reviews.llvm.org/D93224
      170c67d5
    • Balazs Benics's avatar
      [analyzer] Create MacroExpansionContext member in AnalysisConsumer · 7c58fb6b
      Balazs Benics authored
      Adds a `MacroExpansionContext` member to the `AnalysisConsumer` class.
      Tracks macro expansions only if the `ShouldDisplayMacroExpansions` is set.
      Passes a reference down the pipeline letting AnalysisConsumers query macro
      expansions during bugreport construction.
      
      Reviewed By: martong, Szelethus
      
      Differential Revision: https://reviews.llvm.org/D93223
      7c58fb6b
    • Balazs Benics's avatar
      [analyzer] Introduce MacroExpansionContext to libAnalysis · 6e307100
      Balazs Benics authored
      Introduce `MacroExpansionContext` to track what and how macros in a translation
      unit expand. This is the first element of the patch-stack in this direction.
      
      The main goal is to substitute the current macro expansion generator in the
      `PlistsDiagnostics`, but all the other `DiagnosticsConsumer` could benefit from
      this.
      
      `getExpandedText` and `getOriginalText` are the primary functions of this class.
      The former can provide you the text that was the result of the macro expansion
      chain starting from a `SourceLocation`.
      While the latter will tell you **what text** was in the original source code
      replaced by the macro expansion chain from that location.
      
      Here is an example:
      
        void bar();
        #define retArg(x) x
        #define retArgUnclosed retArg(bar()
        #define BB CC
        #define applyInt BB(int)
        #define CC(x) retArgUnclosed
      
        void unbalancedMacros() {
          applyInt  );
        //^~~~~~~~~~^ is the substituted range
        // Original text is "applyInt  )"
        // Expanded text is "bar()"
        }
      
        #define expandArgUnclosedCommaExpr(x) (x, bar(), 1
        #define f expandArgUnclosedCommaExpr
      
        void unbalancedMacros2() {
          int x =  f(f(1))  ));  // Look at the parenthesis!
        //         ^~~~~~^ is the substituted range
        // Original text is "f(f(1))"
        // Expanded text is "((1,bar(),1,bar(),1"
        }
      
      Might worth investigating how to provide a reusable component, which could be
      used for example by a standalone tool eg. expanding all macros to their
      definitions.
      
      I borrowed the main idea from the `PrintPreprocessedOutput.cpp` Frontend
      component, providing a `PPCallbacks` instance hooking the preprocessor events.
      I'm using that for calculating the source range where tokens will be expanded
      to. I'm also using the `Preprocessor`'s `OnToken` callback, via the
      `Preprocessor::setTokenWatcher` to reconstruct the expanded text.
      
      Unfortunately, I concatenate the token's string representation without any
      whitespaces except if the token is an identifier when I emit an extra space
      to produce valid code for `int var` token sequences.
      This could be improved later if needed.
      
      Patch-stack:
        1) D93222 (this one) Introduces the MacroExpansionContext class and unittests
      
        2) D93223 Create MacroExpansionContext member in AnalysisConsumer and pass
           down to the diagnostics consumers
      
        3) D93224 Use the MacroExpansionContext for macro expansions in plists
           It replaces the 'old' macro expansion mechanism.
      
        4) D94673 API for CTU macro expansions
           You should be able to get a `MacroExpansionContext` for each imported TU.
           Right now it will just return `llvm::None` as this is not implemented yet.
      
        5) FIXME: Implement macro expansion tracking for imported TUs as well.
      
      It would also relieve us from bugs like:
        - [fixed] D86135
        - [confirmed] The `__VA_ARGS__` and other macro nitty-gritty, such as how to
          stringify macro parameters, where to put or swallow commas, etc. are not
          handled correctly.
        - [confirmed] Unbalanced parenthesis are not well handled - resulting in
          incorrect expansions or even crashes.
        - [confirmed][crashing] https://bugs.llvm.org/show_bug.cgi?id=48358
      
      Reviewed By: martong, Szelethus
      
      Differential Revision: https://reviews.llvm.org/D93222
      6e307100
    • Florian Hahn's avatar
      [VPlan] Manage pairs of incoming (VPValue, VPBB) in VPWidenPHIRecipe. · 15a74b64
      Florian Hahn authored
      This patch extends VPWidenPHIRecipe to manage pairs of incoming
      (VPValue, VPBasicBlock) in the VPlan native path. This is made possible
      because we now directly manage defined VPValues for recipes.
      
      By keeping both the incoming value and block in the recipe directly,
      code-generation in the VPlan native path becomes independent of the
      predecessor ordering when fixing up non-induction phis, which currently
      can cause crashes in the VPlan native path.
      
      This fixes PR45958.
      
      Reviewed By: sguggill
      
      Differential Revision: https://reviews.llvm.org/D96773
      15a74b64
    • David Green's avatar
      [ARM] Move double vector insert patterns using vins to DAG combine · 21a4faab
      David Green authored
      This removes the existing patterns for inserting two lanes into an
      f16/i16 vector register using VINS, instead using a DAG combine to
      pattern match the same code sequences. The tablegen patterns were
      already on the large side (foreach LANE = [0, 2, 4, 6]) and were not
      handling all the cases they could. Moving that to a DAG combine, whilst
      not less code, allows us to better control and expand the selection of
      VINSs. Additionally this allows us to remove the AddedComplexity on
      VCVTT.
      
      The extra trick that this has learned in the process is to move two
      adjacent lanes using a single f32 vmov, allowing some extra
      inefficiencies to be removed.
      
      Differenial Revision: https://reviews.llvm.org/D96876
      21a4faab
    • Andy Wingo's avatar
      [WebAssembly] call_indirect issues table number relocs · 861dbe1a
      Andy Wingo authored
      If the reference-types feature is enabled, call_indirect will explicitly
      reference its corresponding function table via `TABLE_NUMBER`
      relocations against a table symbol.
      
      Also, as before, address-taken functions can also cause the function
      table to be created, only with reference-types they additionally cause a
      symbol table entry to be emitted.
      
      We abuse the used-in-reloc flag on symbols to indicate which tables
      should end up in the symbol table.  We do this because unfortunately
      older wasm-ld will carp if it see a table symbol.
      
      Differential Revision: https://reviews.llvm.org/D90948
      861dbe1a
    • Kadir Cetinkaya's avatar
    • Jan Svoboda's avatar
      [clang][cli] Pass '-Wspir-compat' to cc1 from driver · 820e0c49
      Jan Svoboda authored
      This patch moves the creation of the '-Wspir-compat' argument from cc1 to the driver.
      
      Without this change, generating command line arguments from `CompilerInvocation` cannot be done reliably: there's no way to distinguish whether '-Wspir-compat' was passed to cc1 on the command line (should be generated), or if it was created within `CompilerInvocation::CreateFromArgs` (should not be generated).
      
      This is also in line with how other '-W' flags are handled.
      
      (This was introduced in D21567.)
      
      Reviewed By: Anastasia
      
      Differential Revision: https://reviews.llvm.org/D97041
      820e0c49
    • Jan Svoboda's avatar
      [clang][cli] Stop creating '-Wno-stdlibcxx-not-found' in cc1 · bf15697e
      Jan Svoboda authored
      This patch stops creating the '-Wno-stdlibcxx-not-found' argument in `CompilerInvocation::CreateFromArgs`.
      
      The code was added in 2e7ab55e (a follow-up to D48297). However, D61963 removes relevant tests and starts explicitly passing '-Wno-stdlibcxx-not-found' to the driver. I think it's fair to assume this is a dead code.
      
      Reviewed By: dexonsmith
      
      Differential Revision: https://reviews.llvm.org/D97042
      bf15697e
    • Tres Popp's avatar
      [mlir] Mark std.subview as NoSideEffect · 5b20d80a
      Tres Popp authored
      Differential Revision: https://reviews.llvm.org/D96951
      5b20d80a
    • Djordje Todorovic's avatar
      [NFC][llvm-dwarfdump] Don't calculate unnecessary stats · 52113451
      Djordje Todorovic authored
      Small optimization of the code -- No need to calculate any stats
      for NULL nodes, and also no need to call the collectStatsForDie()
      if it is the CU itself.
      
      Differential Revision: https://reviews.llvm.org/D96871
      52113451
    • Petr Hosek's avatar
      [InstrProfiling] Fix instrprof-gc-sections.c test · 97184ab9
      Petr Hosek authored
      After D97110 __llvm_prof_cnts has the nobits type so it's empty.
      97184ab9
    • Kern Handa's avatar
      [mlir] Export CUDA and Vulkan runtime wrappers on Windows · 2d62212b
      Kern Handa authored
      Reviewed By: mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D97140
      2d62212b