1. Jul 30, 2021
    • Ivan Murashko's avatar
      [clang] SIGSEGV at DeduceTemplateArgumentsByTypeMatch · 8eaa05d0
      Ivan Murashko authored
      There is a SIGSEGV at `DeduceTemplateArgumentsByTypeMatch`. The bug [#51171](https://bugs.llvm.org/show_bug.cgi?id=51171) was filled. The reproducer can be found at the bug description.
      
      LIT test for the issue was added:
      ```
      ./bin/llvm-lit -v ../clang/test/SemaCXX/pr51171-crash.cpp
      ```
      
      The debug stack trace is below:
      ```
       #0 0x00000000055afcb9 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/ivanmurashko/local/llvm-project/llvm/lib/Support/Unix/Signals.inc:565:22
       #1 0x00000000055afd70 PrintStackTraceSignalHandler(void*) /home/ivanmurashko/local/llvm-project/llvm/lib/Support/Unix/Signals.inc:632:1
       #2 0x00000000055add2d llvm::sys::RunSignalHandlers() /home/ivanmurashko/local/llvm-project/llvm/lib/Support/Signals.cpp:97:20
       #3 0x00000000055af701 SignalHandler(int) /home/ivanmurashko/local/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1
       #4 0x00007ffff7bc2b20 __restore_rt sigaction.c:0:0
       #5 0x00007ffff66a337f raise (/lib64/libc.so.6+0x3737f)
       #6 0x00007ffff668ddb5 abort (/lib64/libc.so.6+0x21db5)
       #7 0x00007ffff668dc89 _nl_load_domain.cold.0 loadmsgcat.c:0:0
       #8 0x00007ffff669ba76 .annobin___GI___assert_fail.end assert.c:0:0
       #9 0x000000000594b210 clang::QualType::getCommonPtr() const /home/ivanmurashko/local/llvm-project/clang/include/clang/AST/Type.h:684:5
      #10 0x0000000005a12ca6 clang::QualType::getCanonicalType() const /home/ivanmurashko/local/llvm-project/clang/include/clang/AST/Type.h:6467:36
      #11 0x0000000005a137a6 clang::ASTContext::getCanonicalType(clang::QualType) const /home/ivanmurashko/local/llvm-project/clang/include/clang/AST/ASTContext.h:2433:58
      #12 0x0000000009204584 DeduceTemplateArgumentsByTypeMatch(clang::Sema&, clang::TemplateParameterList*, clang::QualType, clang::QualType, clang::sema::TemplateDeductionInfo&, llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int, bool, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp:1355:54
      #13 0x000000000920df0d clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*, clang::TemplateArgumentListInfo*, clang::QualType, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp:4354:47
      #14 0x0000000009012b09 (anonymous namespace)::AddressOfFunctionResolver::AddMatchingTemplateFunction(clang::FunctionTemplateDecl*, clang::DeclAccessPair const&) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:12026:38
      #15 0x0000000009013030 (anonymous namespace)::AddressOfFunctionResolver::FindAllFunctionsThatMatchTargetTypeExactly() /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:12119:9
      #16 0x0000000009012679 (anonymous namespace)::AddressOfFunctionResolver::AddressOfFunctionResolver(clang::Sema&, clang::Expr*, clang::QualType const&, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:11931:5
      #17 0x0000000009013c91 clang::Sema::ResolveAddressOfOverloadedFunction(clang::Expr*, clang::QualType, bool, clang::DeclAccessPair&, bool*) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:12286:42
      #18 0x0000000008fed85d IsStandardConversion(clang::Sema&, clang::Expr*, clang::QualType, bool, clang::StandardConversionSequence&, bool, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:1712:49
      #19 0x0000000008fec8ea TryImplicitConversion(clang::Sema&, clang::Expr*, clang::QualType, bool, clang::Sema::AllowedExplicit, bool, bool, bool, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:1433:27
      #20 0x0000000008ff90ba TryCopyInitialization(clang::Sema&, clang::Expr*, clang::QualType, bool, bool, bool, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:5273:71
      #21 0x00000000090024fb clang::Sema::AddBuiltinCandidate(clang::QualType*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, unsigned int) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:7755:32
      #22 0x000000000900513f (anonymous namespace)::BuiltinOperatorOverloadBuilder::addGenericBinaryArithmeticOverloads() /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:8633:30
      #23 0x0000000009007624 clang::Sema::AddBuiltinOperatorCandidates(clang::OverloadedOperatorKind, clang::SourceLocation, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:9205:51
      #24 0x0000000009018734 clang::Sema::LookupOverloadedBinOp(clang::OverloadCandidateSet&, clang::OverloadedOperatorKind, clang::UnresolvedSetImpl const&, llvm::ArrayRef<clang::Expr*>, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:13469:1
      #25 0x0000000009018d56 clang::Sema::CreateOverloadedBinOp(clang::SourceLocation, clang::BinaryOperatorKind, clang::UnresolvedSetImpl const&, clang::Expr*, clang::Expr*, bool, bool, clang::FunctionDecl*) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:13568:24
      #26 0x0000000008b24797 BuildOverloadedBinOp(clang::Sema&, clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaExpr.cpp:14606:65
      #27 0x0000000008b24ed5 clang::Sema::BuildBinOp(clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaExpr.cpp:14691:73
      #28 0x0000000008b245d4 clang::Sema::ActOnBinOp(clang::Scope*, clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaExpr.cpp:14566:1
      #29 0x00000000085bfafb clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*, true>, clang::prec::Level) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/ParseExpr.cpp:630:71
      #30 0x00000000085bd922 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/ParseExpr.cpp:177:1
      #31 0x00000000085cbbcd clang::Parser::ParseExpressionList(llvm::SmallVectorImpl<clang::Expr*>&, llvm::SmallVectorImpl<clang::SourceLocation>&, llvm::function_ref<void ()>) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/ParseExpr.cpp:3368:40
      #32 0x000000000857f49c clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/ParseDecl.cpp:2416:5
      #33 0x000000000857df16 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/ParseDecl.cpp:2092:65
      #34 0x000000000855f07b clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/Parser.cpp:1138:1
      #35 0x000000000855f136 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/Parser.cpp:1153:57
      #36 0x000000000855e644 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/Parser.cpp:975:58
      #37 0x000000000855d717 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/Parser.cpp:720:42
      #38 0x0000000008558e01 clang::ParseAST(clang::Sema&, bool, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/ParseAST.cpp:158:37
      #39 0x000000000627a221 clang::ASTFrontendAction::ExecuteAction() /home/ivanmurashko/local/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1058:11
      #40 0x0000000006bdcc31 clang::CodeGenAction::ExecuteAction() /home/ivanmurashko/local/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1045:5
      #41 0x0000000006279b4d clang::FrontendAction::Execute() /home/ivanmurashko/local/llvm-project/clang/lib/Frontend/FrontendAction.cpp:955:38
      #42 0x00000000061c3fe9 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/ivanmurashko/local/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:974:42
      #43 0x00000000063f9c5e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/ivanmurashko/local/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:278:38
      #44 0x0000000002603a03 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/ivanmurashko/local/llvm-project/clang/tools/driver/cc1_main.cpp:246:40
      #45 0x00000000025f8a39 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) /home/ivanmurashko/local/llvm-project/clang/tools/driver/driver.cpp:338:20
      #46 0x00000000025f9107 main /home/ivanmurashko/local/llvm-project/clang/tools/driver/driver.cpp:415:26
      #47 0x00007ffff668f493 __libc_start_main (/lib64/libc.so.6+0x23493)
      #48 0x00000000025f729e _start (/data/users/ivanmurashko/llvm-project/build/bin/clang-13+0x25f729e)
      ```
      
      Reviewed By: erichkeane
      
      Differential Revision: https://reviews.llvm.org/D106583
      8eaa05d0
    • Dmitry Vyukov's avatar
      tsan: optimize test-only barrier · 97795be2
      Dmitry Vyukov authored
      The updated lots_of_threads.c test with 300 threads
      started running for too long on machines with low
      hardware parallelism (e.g. taskset -c 0-1).
      On lots of CPUs it finishes in ~2 secs. But with
      taskset -c 0-1 it runs for hundreds of seconds
      effectively spinning in the barrier in the sleep loop.
      
      We now have the handy futex API in sanitizer_common.
      Use it instead of the passive spin loop.
      It makes the test run only faster with taskset -c 0-1,
      it runs for ~1.5 secs, while with full parallelism
      it still runs for ~2 secs (but consumes less CPU time).
      
      Depends on D107131.
      
      Reviewed By: vitalybuka
      
      Differential Revision: https://reviews.llvm.org/D107132
      97795be2
    • Dmitry Vyukov's avatar
      tsan: fix latent race size bug in test · dbe36e40
      Dmitry Vyukov authored
      The test contains a race in read/write syscalls.
      The size of reported race depends on how the accessed
      memory range split into granules inside of tsan runtime.
      The test used to report access of size 8, because presumably
      the buffer ended up being aligned to 8 bytes. But after
      some unrelated changes this test started to report accesses
      of size 1 (presumably .data layout changed), which makes
      the test fail.
      Guarantee alignment of the buf object explicitly.
      
      Reviewed By: vitalybuka, melver
      
      Differential Revision: https://reviews.llvm.org/D107131
      dbe36e40
    • David Green's avatar
      [ARM] Turn vecreduce_add(add(x, y)) into vecreduce(x) + vecreduce(y) · 4b563067
      David Green authored
      Under MVE we can use VADDV/VADDVA's to perform integer add reductions,
      so it can be beneficial to use more reductions than summing subvectors
      and reducing once. Especially for VMLAV/VMLAVA the mul can be
      incorporated into the reduction, producing less instructions.
      
      Some of the test cases currently get larger due to extra integer adds,
      but will be improved in a followup patch.
      
      Differential Revision: https://reviews.llvm.org/D106531
      4b563067
    • David Green's avatar
      [ARM] MVE SLP'd reduction tests. NFC · ee32cc38
      David Green authored
      These are generated from SLP vectorization, for example
      https://godbolt.org/z/ebxdPh1Kz. These backend tests
      show cases that we can produce better code for.
      ee32cc38
    • Muhammad Omair Javaid's avatar
      Revert "[LLDB][GUI] Expand selected thread tree item by default" · fd18f0e8
      Muhammad Omair Javaid authored
      This reverts commit fed25ddc.
      
      There has been sporadic failures in LLDB AArch64/Arm 32 buildbots since
      this commit. I am temporarily reverting it see if it fixes the issue.
      
      Differential Revision: https://reviews.llvm.org/D100243
      fd18f0e8
    • Anastasia Stulova's avatar
      [OpenCL] Add std flag aliases clc++1.0 and CLC++1.0 · 577220e8
      Anastasia Stulova authored
      Renamed language standard from openclcpp to openclcpp10.
      Added new std values i.e. '-cl-std=clc++1.0' and
      '-cl-std=CLC++1.0'.
      
      Patch by Topotuna (Justas Janickas)!
      
      Differential Revision: https://reviews.llvm.org/D106266
      577220e8
    • Andrzej Warzynski's avatar
      [flang] Fix `flang` (the bash wrapper script for the Flang driver) · 1a7ed956
      Andrzej Warzynski authored
      Remove erroneous `||` at the end of an `if` condition. This was
      introduced in https://reviews.llvm.org/D106871.
      1a7ed956
    • Cullen Rhodes's avatar
      [AArch64][SME] Introduce feature for streaming mode · 3a349d22
      Cullen Rhodes authored
      The Scalable Matrix Extension (SME) introduces a new execution mode
      called Streaming SVE mode. In streaming mode a substantial subset of the
      SVE and SVE2 instruction set is available, along with new outer product,
      load, store, extract and insert instructions that operate on the new
      architectural register state for the matrix.
      
      To support streaming mode this patch introduces a new subtarget feature
      +streaming-sve. If enabled, the subset of SVE(2) instructions are
      available. The existing behaviour for SVE(2) remains unchanged, the
      subset of instructions that are legal in streaming mode are enabled if
      either +sve[2] or +streaming-sve is specified. Instructions that are
      illegal in streaming mode remain predicated on +sve[2].
      
      The SME target feature has been updated to imply +streaming-sve rather
      than +sve.
      
      The following changes are made to the SVE(2) tests:
        * For instructions that are legal in streaming mode:
          - added RUN line to verify +streaming-sve enables the instruction.
          - updated diagnostic to 'instruction requires: streaming-sve or sve'.
        * For instructions that are illegal in streaming-mode:
          - added RUN line to verify +streaming-sve does not enable the
            instruction.
      
      SVE(2) instructions that are legal in streaming mode have:
      
        if !HaveSVE[2]() && !HaveSME() then UNDEFINED;
      
      at the top of the pseudocode in the XML.
      
      The reference can be found here:
      https://developer.arm.com/documentation/ddi0602/2021-06/SVE-Instructions
      
      Reviewed By: sdesmalen, david-arm
      
      Differential Revision: https://reviews.llvm.org/D106272
      3a349d22
    • Lang Hames's avatar
      [JITLink][ELF][x86-64] Include relocation name in missing relocation errors. · 8a241cd9
      Lang Hames authored
      This saves a level of manual table lookup for those of us who don't remember
      ELF relocation numbers off the top of our heads.
      8a241cd9
    • Tarindu Jayatilaka's avatar
      Take OptimizationLevel class out of Pass Builder · 7a797b29
      Tarindu Jayatilaka authored
      Pulled out the OptimizationLevel class from PassBuilder in order to be able to access it from within the PassManager and avoid include conflicts.
      
      Reviewed By: mtrofin
      
      Differential Revision: https://reviews.llvm.org/D107025
      7a797b29
    • Dave Airlie's avatar
      [OpenCL] opencl-c.h: add CL 3.0 non-generic address space atomics · 3c7d2f1b
      Dave Airlie authored
      CL 2.0 introduced atomics and generic address space so there were
      only one set of APIs for doing atomics, however since CL 3.0
      makes generic address space optional, there has to be new sets
      of atomic interfaces to handle that cases.
      
      Reviewed By: Anastasia
      
      Differential Revision: https://reviews.llvm.org/D106778
      3c7d2f1b
    • Mark Leair's avatar
      Fix scalar unit tests for all, any, maxloc, etc. that caused the ARM build · dfe9895a
      Mark Leair authored
      to fail due to warnings as errors. Note that I could not reproduce the
      problem locally, but based on the messages, I think this change will fix
      the errors.
      
      Differential Revision: https://reviews.llvm.org/D107120
      dfe9895a
    • Anton Zabaznov's avatar
      Revert "[OpenCL] Add support of __opencl_c_pipes feature macro." · da6626d1
      Anton Zabaznov authored
      This reverts commit d1e4b257.
      da6626d1
    • Anton Zabaznov's avatar
      [OpenCL] Add support of __opencl_c_pipes feature macro. · d1e4b257
      Anton Zabaznov authored
      'pipe' keyword is introduced in OpenCL C 2.0: so do checks for OpenCL C version while
      parsing and then later on check for language options to construct actual pipe. This feature
      requires support of __opencl_c_generic_address_space, so diagnostics for that is provided as well.
      
      Reviewed By: Anastasia
      
      Differential Revision: https://reviews.llvm.org/D106748
      d1e4b257
    • Stefan Pintilie's avatar
      [PowerPC] Fix issue where hint was providing the incorrect regsiter class. · 754520a2
      Stefan Pintilie authored
      Regsier hints when copying to a UACC register do not always produce VSRp
      registers. This patch makes sure that we do not produce hints in cases
      where the subregsiter of the UACC is not a VSRp.
      
      Reviewed By: nemanjai, #powerpc
      
      Differential Revision: https://reviews.llvm.org/D107101
      754520a2
    • Esme-Yi's avatar
      [yaml2obj] Enable support for parsing 64-bit XCOFF. · 8011fc19
      Esme-Yi authored
      Summary: Add support for yaml2obj to parse 64-bit XCOFF.
      
      Reviewed By: shchenz
      
      Differential Revision: https://reviews.llvm.org/D100375
      8011fc19
    • Walter Erquinigo's avatar
      [nfc][trace] use formatv instead of the old Printf · 58399769
      Walter Erquinigo authored
      It was suggested in https://reviews.llvm.org/D105741 and it makes sense.
      58399769
    • Anton Zabaznov's avatar
      [OpenCL] Add support of __opencl_c_3d_image_writes feature macro · f16a4fcb
      Anton Zabaznov authored
      This feature requires support of __opencl_c_images, so diagnostics for that is provided as well.
      Also, ensure that cl_khr_3d_image_writes feature macro is set to the same value.
      
      Reviewed By: Anastasia
      
      Differential Revision: https://reviews.llvm.org/D106260
      f16a4fcb
    • Victor Huang's avatar
    • Jinsong Ji's avatar
      [AIX] Include symbol alias in extract_symbols.py · a09e93bf
      Jinsong Ji authored
      nm does not show size for aliased symbols,
      we should still extract them if they are external.
      
      Reviewed By: hubert.reinterpretcast
      
      Differential Revision: https://reviews.llvm.org/D107112
      a09e93bf
    • Walter Erquinigo's avatar
      [source map] fix relative path breakpoints · 0a68443b
      Walter Erquinigo authored
      https://reviews.llvm.org/D45592 added a nice feature to be able to specify a breakpoint by a relative path. E.g. passing foo.cpp or bar/foo.cpp or zaz/bar/foo.cpp is fine. However, https://reviews.llvm.org/D68671 by mistake disabled the test that ensured this functionality works. With time, someone made a small mistake and fully broke the functionality.
      
      So, I'm making a very simple fix and the test passes.
      
      Differential Revision: https://reviews.llvm.org/D107126
      0a68443b
    • Geoffrey Martin-Noble's avatar
      [Bazel] Make td_library usable as data · d9834995
      Geoffrey Martin-Noble authored
      This patch makes it possible to list a td_library as a rule's data
      attribute and get its source files and all its transitive dependencies
      at runtime. This is useful for, e.g. shell tests running tblgen.
      
      Note that this is a bit different from how a "normal" (e.g. C++) library
      rule would work because those have actual library outputs and the
      td_library rule just bundles some source files and includes. If someone
      wanted to make use of the includes, they would have to access the TdInfo
      provider, but this keeps simple things simple.
      
      Reviewed By: jpienaar
      
      Differential Revision: https://reviews.llvm.org/D106922
      d9834995
    • Geoffrey Martin-Noble's avatar
      [Bazel] Unconditionally define STDC LIMIT/CONSTANT/FORMAT · f3a8a7b9
      Geoffrey Martin-Noble authored
      These are unconditionally included in the CMake build as well and
      necessary for some odd platforms (even though the C++11 standard says
      they shouldn't be).
      
      Reviewed By: chandlerc
      
      Differential Revision: https://reviews.llvm.org/D107123
      f3a8a7b9
    • Geoffrey Martin-Noble's avatar
      [Bazel] Derive targets from file presence as in CMake build · 6fa2d0fb
      Geoffrey Martin-Noble authored
      This makes the logic used to determine if targets have the given
      features the same as is used in CMake. Incidentally, it enables these
      features for the targets added in https://reviews.llvm.org/D106921
      which were missing because this was previously a hardcoded list.
      
      Reviewed By: chandlerc
      
      Differential Revision: https://reviews.llvm.org/D107019
      6fa2d0fb
    • Mark Schimmel's avatar
      [ARC] Add norm/normh instructions with disassembly tests · e622c99f
      Mark Schimmel authored
      Add disassembler support for the NORM and NORMH instructions. These instructions
      only exist when the ARC processor is configured with the "norm" extension.
      
      fferential Revision: https://reviews.llvm.org/D107118
      e622c99f
    • Stella Laurenzo's avatar
      [MLIR][python] Disable SONAME on extensions. · 1de7a17f
      Stella Laurenzo authored
      * Broken out of https://reviews.llvm.org/D106419
      * Otherwise, same named modules will conflict with each other.
      
      Differential Revision: https://reviews.llvm.org/D107113
      1de7a17f
    • Ben Shi's avatar
      Optimize mul in the zba extension with SH*ADD · bb6fddb6
      Ben Shi authored
      This patch does the following optimization of mul with a constant.
      
      (mul x, 11) -> (SH1ADD (SH2ADD x, x), x)
      (mul x, 19) -> (SH1ADD (SH3ADD x, x), x)
      (mul x, 13) -> (SH2ADD (SH1ADD x, x), x)
      (mul x, 21) -> (SH2ADD (SH2ADD x, x), x)
      (mul x, 37) -> (SH2ADD (SH3ADD x, x), x)
      (mul x, 25) -> (SH3ADD (SH1ADD x, x), x)
      (mul x, 41) -> (SH3ADD (SH2ADD x, x), x)
      (mul x, 73) -> (SH3ADD (SH3ADD x, x), x)
      (mul x, 27) -> (SH1ADD (SH3ADD x, x), (SH3ADD x, x))
      (mul x, 45) -> (SH2ADD (SH3ADD x, x), (SH3ADD x, x))
      (mul x, 81) -> (SH3ADD (SH3ADD x, x), (SH3ADD x, x))
      
      Reviewed By: craig.topper
      
      Differential Revision: https://reviews.llvm.org/D107065
      bb6fddb6
    • Ben Shi's avatar
      [RISCV][test] Add new tests for mul optimization in the zba extension with SH*ADD · 811be794
      Ben Shi authored
      Reviewed By: craig.topper
      
      Differential Revision: https://reviews.llvm.org/D107064
      811be794
    • Matt Jacobson's avatar
      [AVR][clang] Pass '--start-group' and '--end-group' options to avr-ld · 1e6a93f1
      Matt Jacobson authored
      Reviewed By: Ben Shi
      
      Differential Revision: https://reviews.llvm.org/D106854
      1e6a93f1
    • Amara Emerson's avatar
      [GlobalISel] Refactor the unmerge artifact value finder code. · f984b0e1
      Amara Emerson authored
      I moved the code that tries to combine away each unmerge def into a method in
      ArtifactValueFinder class itself. This removes a logically messy lambda and
      makes it easier to use the value-finder in more places in future.
      f984b0e1
    • Shoaib Meenai's avatar
      [compiler-rt] Fix COMPILER_RT_OS_DIR for Android · a68ccba7
      Shoaib Meenai authored
      Android has its own CMAKE_SYSTEM_NAME, but the OS is Linux (Android
      target triples look like aarch64-none-linux-android21). The driver will
      therefore search for compiler-rt libraries in the "linux" directory and
      not the "android" directory, so the default placement of Android
      compiler-rt libraries was incorrect. You could fix it by specifying
      COMPILER_RT_OS_DIR manually, but it also makes sense to fix the default,
      to save others from having to discover and fix the issue for themselves.
      a68ccba7
    • Thomas Johnson's avatar
    • Joseph Huber's avatar
      [OpenMP] Adding flags for disabling the following optimizations:... · cd0dd8ec
      Joseph Huber authored
      [OpenMP] Adding flags for disabling the following optimizations: Deglobalization SPMDization State machine rewrites Folding
      
      This work provides four flags to disable four different sets of OpenMP optimizations. These flags take effect in llvm/lib/Transforms/IPO/OpenMPOpt.cpp and include the following:
       - openmp-opt-disable-deglobalization: Defaults to false, adding this flag sets the variable DisableOpenMPOptDeglobalization to true. This prevents AA registration for HeapToStack and HeapToShared.
       - openmp-opt-disable-spmdization: Defaults to false, adding this flag sets the variable DisableOpenMPOptSPMDization to true. This indicates a pessimistic fixpoint in changeToSPMDMode.
       - openmp-opt-disable-folding: Defaults to false, adding this flag sets the variable DisableOpenMPOptFolding to true. This indicates a pessimistic fixpoint in the attributor init for AAFoldRuntimeCall.
       - openmp-opt-disable-state-machine-rewrite: Defaults to false, adding this flag sets the variable DisableOpenMPOptStateMachineRewrite to true. This first prevents changes to the state machine in rewriteDeviceCodeStateMachine by returning before changes are made, and if a custom state machine is built in buildCustomStateMachine, stops by returning a pessimistic fixpoint.
      
      Reviewed By: jhuber6
      
      Differential Revision: https://reviews.llvm.org/D106802
      cd0dd8ec
    • Adrian Prantl's avatar
      648844fd
    • Adrian Prantl's avatar
      Fix typo · 0fd813cf
      Adrian Prantl authored
      0fd813cf
    • Sanjay Patel's avatar
      f3c39ee8
    • Adrian Prantl's avatar
      GlobalISel/AArch64: don't optimize away redundant branches at -O0 · c5d84d2e
      Adrian Prantl authored
      This patch prevents GlobalISel from optimizing out redundant branch
      instructions when compiling without optimizations.
      
      The motivating example is code like the following common pattern in
      Swift, where users expect to be able to set a breakpoint on the early
      exit:
      
      public func f(b: Bool) {
        guard b else {
          return // I would like to set a breakpoint here.
        }
        ...
      }
      
      The patch modifies two places in GlobalISEL: The first one is in
      IRTranslator.cpp where the removal of redundant branches is made
      conditional on the optimization level. The second one is in
      AArch64InstructionSelector.cpp where an -O0 *only* optimization is
      being removed.
      
      Disabling these optimizations increases code size at -O0 by
      ~8%. However, doing so improves debuggability, and debug builds are
      the primary reason why developers compile without optimizations. We
      thus concluded that this is the right trade-off.
      
      rdar://79515454
      
      This tenatively reapplies the patch without modifications, the LLDB
      test that has blocked this from landing previously has since been
      modified to hopefully no longer be sensitive to this change.
      
      Differential Revision: https://reviews.llvm.org/D105238
      c5d84d2e
    • Amy Zhuang's avatar
      [mlir] Set insertion point of vector constant to the top of the vectorized loop body · a8b7e56f
      Amy Zhuang authored
      When we vectorize a scalar constant, the vector constant is inserted before its
      first user if the scalar constant is defined outside the loops to be vectorized.
      It is possible that the vector constant does not dominate all its users. To fix
      the problem, we find the innermost vectorized loop that encloses that first user
      and insert the vector constant at the top of the loop body.
      
      Reviewed By: nicolasvasilache
      
      Differential Revision: https://reviews.llvm.org/D106609
      a8b7e56f
    • George Burgess IV's avatar
      security: highlight phab accounts; recommend phab for nominations · 4c98e945
      George Burgess IV authored
      This commit contains two mildly separate concepts.
      
      First, sending out reviews for things like this is a bit of a
      complicated endeavor, since the reviewer list is relatively long, and I
      generally rely on prior CLs in this area to find an authoritative list.
      Life's quite a bit easier if phab usernames are readily available on the
      doc. So part 1 is making those available.
      
      Second, it seems to me that, at the moment, Phabricator makes the most
      sense for membership changes (incl. security group nominations). My
      reasoning for this is detailed in the diff, and to some extent in
      comment #1 of this bug
      <https://bugs.chromium.org/p/llvm/issues/detail?id=12#c1>. This change
      adds prose to recommend the use of Phabricator for nominations as a
      result.
      
      Differential Revision: https://reviews.llvm.org/D106917
      4c98e945