1. Feb 29, 2020
  2. Feb 28, 2020
    • Teresa Johnson's avatar
      [Inliner] Inlining should honor nobuiltin attributes · f9ca75f1
      Teresa Johnson authored
      Summary:
      Final patch in series to fix inlining between functions with different
      nobuiltin attributes/options, which was specifically an issue in LTO.
      See discussion on D61634 for background.
      
      The prior patch in this series (D67923) enabled per-Function TLI
      construction that identified the nobuiltin attributes.
      
      Here I have allowed inlining to proceed if the callee's nobuiltins are a
      subset of the caller's nobuiltins, but not in the reverse case, which
      should be conservatively correct. This is controlled by a new option,
      -inline-caller-superset-nobuiltin, which is enabled by default.
      
      Reviewers: hfinkel, gchatelet, chandlerc, davidxl
      
      Subscribers: arsenm, jvesely, nhaehnle, mehdi_amini, eraman, hiraditya, haicheng, dexonsmith, kerbowa, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D74162
      f9ca75f1
    • Simon Pilgrim's avatar
    • Simon Pilgrim's avatar
      [TargetLowering] SimplifyDemandedBits - fix SCALAR_TO_VECTOR knownbits bug · 4bc6f633
      Simon Pilgrim authored
      We can only report the knownbits for a SCALAR_TO_VECTOR node if we only demand the 0'th element - the upper elements are undefined and shouldn't be trusted.
      
      This is causing a number of regressions that need addressing but we need to get the bugfix in first.
      4bc6f633
    • Pierre-vh's avatar
    • Krzysztof Parzyszek's avatar
      Reland 7691790d with a MSAN fix · c8bfed05
      Krzysztof Parzyszek authored
      In some cases when HexagonTargetLowering::allowsMemoryAccess returned
      true, it did not set the "Fast" argument, leaving it uninitialized.
      
      [Hexagon] Improve casting of boolean HVX vectors to scalars
      
      - Mark memory access for bool vectors as disallowed in target lowering.
        This will prevent combining bitcasts of bool vectors with stores.
      - Replace the actual bitcasting code with a faster version.
      - Handle casting of v16i1 to i16.
      c8bfed05
    • David Green's avatar
      [ARM] MVE VMLAS · e2a2f3f7
      David Green authored
      This addes extra patterns for the VMLAS MVE instruction, which performs
      Qda = Qda * Qn + Rm, a similar pattern to the existing VMLA. The sinking
      of splat(Rm) into the loop is already performed, meaning we just need
      extra Pat's in tablegen.
      
      Differential Revision: https://reviews.llvm.org/D75115
      e2a2f3f7
    • David Green's avatar
      [ARM] Additional MVE VMLA tests. NFC · 78e5d134
      David Green authored
      78e5d134
    • Karasev Nikita's avatar
      Skip TemplateSpecializedType in modernize-pass-by-value. · 365c99fd
      Karasev Nikita authored
      Existing 'modernize-pass-by-value' check works only with non template values in
      initializers. Fixes PR37210.
      365c99fd
    • Simon Pilgrim's avatar
      [cmake][msvc] Don't disable C4345 any more. · d76fddf2
      Simon Pilgrim authored
      This shouldn't be relevant now that we just support VS2017+.
      d76fddf2
    • Jay Foad's avatar
      [Utils] Make some scripts directly executable · 395e2c06
      Jay Foad authored
      395e2c06
    • Jay Foad's avatar
      [AMDGPU] Mark the scheduling model as complete · 970558df
      Jay Foad authored
      970558df
    • Jay Foad's avatar
      [AMDGPU] Update a comment missed in 74e2974a · addcbc40
      Jay Foad authored
      addcbc40
    • Alexey Lapshin's avatar
      Fix buildbots after c074f523. · f5e3c039
      Alexey Lapshin authored
      Removed unused function getSectionByName() from dsymutil/DwarfStreamer.cpp.
      f5e3c039
    • Nathan James's avatar
      [clang-tidy] Added virtual isLanguageVersionSupported to ClangTidyCheck · 39c4246e
      Nathan James authored
      Summary:
      Motivated by [[ https://bugs.llvm.org/show_bug.cgi?id=45045 | Tune inspections to a specific C++ standard. ]]
      Moves the isLanguageVersionSupported virtual function from `MakeSmartPtrCheck` to the base `ClangTidyCheck` class.
      This will disable registering matchers or pp callbacks on unsupported language versions for a check.
      Having it as a standalone function is cleaner than manually disabling the check in the register function and should hopefully
      encourage check developers to actually restrict the check based on language version.
      As an added bonus this could enable automatic detection of what language version a check runs on for the purpose of documentation generation
      
      Reviewers: aaron.ballman, gribozavr2, Eugene.Zelenko, JonasToth, alexfh, hokein
      
      Reviewed By: gribozavr2
      
      Subscribers: xazax.hun, jkorous, arphaman, kadircet, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D75289
      39c4246e
    • Jonathan Coe's avatar
      [clang-format] Improve C# handling of spaces in square brackets · f8296152
      Jonathan Coe authored
      Reviewers: MyDeveloperDay, krasimir
      
      Reviewed By: krasimir
      
      Subscribers: cfe-commits
      
      Tags: #clang-format, #clang
      
      Differential Revision: https://reviews.llvm.org/D75336
      f8296152
    • Simon Cook's avatar
      [RISCV] Compress instructions based on function features · ca950a6b
      Simon Cook authored
      When running under LTO, it is common to not specify the architecture
      spec, which is used for setting up the target machine, and instead rely
      on features specified in each function to generate the correct
      instructions.
      
      This works for the code generator, but the RISC-V backend uses the
      AsmPrinter to do instruction compression, which does not see these
      features but instead uses a MCSubtargetInfo object to see whether
      compression is enabled. Since this is configured based on the
      TargetMachine at startup, it will result in compressed instructions not
      being emitted when it has not been given the 'c' TargetFeature, but the
      function has it.
      
      This changes the RISCVAsmPrinter to re-initialize the STI feature set
      based on the current MachineFunction, such that compressed instructions
      are now correctly emitted regardless of the method used to enable them.
      
      Differential revision: https://reviews.llvm.org/D73339
      ca950a6b
    • LLVM GN Syncbot's avatar
      [gn build] Port 6af859dc · 29fb0b13
      LLVM GN Syncbot authored
      29fb0b13
    • Peter Smith's avatar
      [ELF][LLD][ARM] Add missing REQUIRES: arm to tests · 1b025665
      Peter Smith authored
      Fix buildbots that don't build ARM backend.
      1b025665
    • Jeremy Morse's avatar
      [DebugInfo] Re-implement LexicalScopes dominance method, add unit tests · 6af859dc
      Jeremy Morse authored
      Way back in D24994, the combination of LexicalScopes::dominates and
      LiveDebugValues was identified as having worst-case quadratic complexity,
      but it wasn't triggered by any code path at the time. I've since run into a
      scenario where this occurs, in a very large basic block where large numbers
      of inlined DBG_VALUEs are present.
      
      The quadratic-ness comes from LiveDebugValues::join calling "dominates" on
      every variable location, and LexicalScopes::dominates potentially touching
      every instruction in a block to test for the presence of a scope. We have,
      however, already computed the presence of scopes in blocks, in the
      "InstrRanges" of each scope. This patch switches the dominates method to
      examine whether a block is present in a scope's InsnRanges, avoiding
      walking through the whole block.
      
      At the same time, fix getMachineBasicBlocks to account for the fact that
      InsnRanges can cover multiple blocks, and add some unit tests, as Lexical
      Scopes didn't have any.
      
      Differential revision: https://reviews.llvm.org/D73725
      6af859dc
    • Juneyoung Lee's avatar
      Let EarlyCSE fold equivalent freeze instructions · cc28a754
      Juneyoung Lee authored
      Summary:
      This patch makes EarlyCSE fold equivalent freeze instructions.
      
      Another optimization that I think will be useful is to remove freeze if its operand is used as a branch condition or at llvm.assume:
      
      ```
        %c = ...
        br i1 %c, label %A, ..
      A:
        %d = freeze %c ; %d can be optimized to %c because %c cannot be poison or undef (or 'br %c' would be UB otherwise)
      ```
      
      If it make sense for EarlyCSE to support this as well, I will make a patch for this.
      
      Reviewers: spatel, reames, lebedev.ri
      
      Reviewed By: lebedev.ri
      
      Subscribers: lebedev.ri, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D75334
      cc28a754
    • Peter Smith's avatar
      [LLD][ELF][ARM] Implement Thumb pc-relative relocations for adr and ldr · 6b035b60
      Peter Smith authored
      MC will now output the R_ARM_THM_PC8, R_ARM_THM_PC12 and
      R_ARM_THM_PREL_11_0 relocations. These are short-ranged relocations that
      are used to implement the adr rd, literal and ldr rd, literal pseudo
      instructions.
      
      The instructions use a new RelExpr called R_ARM_PCA in order to calculate
      the required S + A - Pa expression, where Pa is AlignDown(P, 4) as the
      instructions add their immediate to AlignDown(PC, 4). We also do not want
      these relocations to generate or resolve against a PLT entry as the range
      of these relocations is so short they would never reach.
      
      The R_ARM_THM_PC8 has a special encoding convention for the relocation
      addend, the immediate field is unsigned, yet the addend must be -4 to
      account for the Thumb PC bias. The ABI (not the architecture) uses the
      convention that the 8-byte immediate of 0xff represents -4.
      
      Differential Revision: https://reviews.llvm.org/D75042
      6b035b60
    • Peter Smith's avatar
      [MC][ELF][ARM] Add relocations for some pc-relative fixups · 2a92fc9b
      Peter Smith authored
      Add ELF relocations for the following fixups:
      fixup_thumb_adr_pcrel_10 -> R_ARM_THM_PC8
      fixup_thumb_cp -> R_ARM_THM_PC8
      fixup_t2_adr_pcrel_12 -> R_ARM_THM_PREL_11_0
      fixup_t2_ldst_pcrel_12 -> R_ARM_THM_PC12
      
      While these relocations are short-ranged there is support in the open
      source ELF linker's in binutils and soon to be in LLD. MC will no longer
      resolve pc-relative fixups to global symbols due to interpositioning
      concerns. We can handle these at link time by implementing the relocations.
      
      The R_ARM_THM_PC8 has some extra encoding rules for addends that llvm-mc
      sidesteps by not supporting addends for these instructions, using the wide
      Thumb 2 instruction if it is available. I think that this is a reasonable
      compromise given that these are rare.
      
      This partiall reverts D72892, the Thumb fixups no longer need to be
      evaluated at assembly time.
      
      Differential Revision: https://reviews.llvm.org/D75039
      2a92fc9b
    • Sam Parker's avatar
      [NFC][ARM] Add tests · 46bfc2bc
      Sam Parker authored
      46bfc2bc
    • Jay Foad's avatar
      [AMDGPU] Precommit some scheduler related test updates · 4917a9a9
      Jay Foad authored
      Summary:
      The point of this is to make some tests with manual checks robust
      against scheduler tweaks, so that only autogenerated test updates will
      be required when pushing D68338 "[AMDGPU] Remove dubious logic in
      bidirectional list scheduler".
      
      Reviewers: arsenm, rampitec, vpykhtin
      
      Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, kerbowa, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D75302
      4917a9a9
    • Sam Parker's avatar
      [RDA] Track implicit-defs · bf61421a
      Sam Parker authored
      Ensure that we're recording implicit defs, as well as visiting implicit
      uses and implicit defs when we're walking through operands.
      
      Differential Revision: https://reviews.llvm.org/D75185
      bf61421a
    • Jonathan Coe's avatar
      [clang-format] Recognize C# nullable types · 5f52a93b
      Jonathan Coe authored
      Summary:
      Do not confuse C# nullable types with conditional expressions.
      
      Do not put a space before the `?` in `[access-modifier] Type? variableName;`
      
      Reviewers: krasimir, MyDeveloperDay
      
      Reviewed By: krasimir, MyDeveloperDay
      
      Subscribers: cfe-commits, MyDeveloperDay
      
      Tags: #clang-format, #clang
      
      Differential Revision: https://reviews.llvm.org/D75261
      5f52a93b