1. Jul 22, 2020
  2. Jul 21, 2020
  3. Jul 20, 2020
    • Hans Wennborg's avatar
      Require shell for lld/test/ELF/arm-exidx-range.s · e05c7e40
      Hans Wennborg authored
      The test fails in 32-bit Windows builds for unclear reasons:
      
      ld.lld: error: failed to open
      C:\src\llvm_package_1100-rc1\build32_stage0\tools\lld\test\ELF\Output\arm-exidx-range.s.tmp:
      The parameter is incorrect.
      
      (cherry picked from commit 8a197e0b)
      e05c7e40
    • Eric Astor's avatar
      [ms] [llvm-ml] Remove unused function · c467be74
      Eric Astor authored
      Summary: Remove unused function
      
      Reviewed By: lbenes
      
      Differential Revision: https://reviews.llvm.org/D83898
      
      (cherry picked from commit 47a3b85a)
      c467be74
    • Craig Topper's avatar
      [X86] Allow lsl/lar to be parsed with a GR16, GR32, or GR64 as source register. · 40e2065d
      Craig Topper authored
      This matches GNU assembler behavior. Operand size is determined
      only from the destination register.
      
      (cherry picked from commit 71b49aa4)
      40e2065d
    • Craig Topper's avatar
      [X86] Teach assembler parser to accept lsl and lar with a 64 or 32 source... · 2d499d79
      Craig Topper authored
      [X86] Teach assembler parser to accept lsl and lar with a 64 or 32 source register when the destination is a 64 register.
      
      Previously we only accepted a 32-bit source with a 64-bit dest.
      
      Accepting 64-bit as well is more consistent with gas behavior. I
      think maybe we should accept 16 bit register as well, but I'm not
      sure.
      
      (cherry picked from commit 3c2a56a8)
      2d499d79
    • Zakk Chen's avatar
      [RISCV] Add support for -mcpu option. · 76c22b39
      Zakk Chen authored
      Summary:
      1. gcc uses `-march` and `-mtune` flag to chose arch and
      pipeline model, but clang does not have `-mtune` flag,
      we uses `-mcpu` to chose both infos.
      2. Add SiFive e31 and u54 cpu which have default march
      and pipeline model.
      3. Specific `-mcpu` with rocket-rv[32|64] would select
      pipeline model only, and use the driver's arch choosing
      logic to get default arch.
      
      Reviewers: lenary, asb, evandro, HsiangKai
      
      Reviewed By: lenary, asb, evandro
      
      Tags: #llvm, #clang
      
      Differential Revision: https://reviews.llvm.org/D71124
      
      (cherry picked from commit 294d1eae)
      76c22b39
    • Max Kazantsev's avatar
      [InstCombine][Test] Test for fix of replacing select with Phis when branch has the same labels · 7421cbd7
      Max Kazantsev authored
      An additional test that allows to check the correctness of handling the case of the same
      branch labels in the dominator when trying to replace select with phi-node.
      
      Patch By: Kirill Polushin
      Differential Revision: https://reviews.llvm.org/D84006
      Reviewed By: mkazantsev
      
      (cherry picked from commit df6e185e)
      7421cbd7
    • Max Kazantsev's avatar
      [InstCombine] Fix replace select with Phis when branch has the same labels · 2a7f1931
      Max Kazantsev authored
      ```
      define i32 @test(i1 %cond) {
      entry:
        br i1 %cond, label %exit, label %exit
      exit:
        %result = select i1 %cond, i32 123, i32 456
        ret i32 %result
      }
      ```
      In this test, after applying transformation of replacing select with Phis,
      the result will be:
      
      ```
      define i32 @test(i1 %cond) {
      entry:
        br i1 %cond, label %exit, label %exit
      exit:
        %result = i32 phi [123, %exit], [123, %exit]
        ret i32 %result
      }
      ```
      That is, select is transformed into an invalid Phi, which will then be
      reduced to 123 and the second value will be lost. But it is worth
      noting that this problem will arise only if select is in the InstCombine
      worklist will be before the branch. Otherwise, InstCombine will replace
      the branch condition with false and transformation will not be applied.
      
      The fix is to check the target labels in the branch condition for equality.
      
      Patch By: Kirill Polushin
      Differential Revision: https://reviews.llvm.org/D84003
      Reviewed By: mkazantsev
      
      (cherry picked from commit c9898810)
      2a7f1931
    • Joachim Protze's avatar
      [TSan] Optimize handling of racy address · 96313d2d
      Joachim Protze authored
      This patch splits the handling of racy address and racy stack into separate
      functions. If a race was already reported for the address, we can avoid the
      cost for collecting the involved stacks.
      
      This patch also removes the race condition in storing the racy address / racy
      stack. This race condition allowed all threads to report the race.
      
      This patch changes the transitive suppression of reports. Previously
      suppression could transitively chain memory location and racy stacks.
      Now racy memory and racy stack are separate suppressions.
      
      Commit again, now with fixed tests.
      
      Reviewed by: dvyukov
      
      Differential Revision: https://reviews.llvm.org/D83625
      
      (cherry picked from commit 7358a110)
      96313d2d
  4. Jul 19, 2020
    • Fangrui Song's avatar
      [RelocationResolver] Support R_AARCH64_PREL32 · a1f2fd11
      Fangrui Song authored
      Code from D83800 by Yichao Yu
      
      (cherry picked from commit 3073a3aa)
      a1f2fd11
    • Fangrui Song's avatar
      [RelocationResolver] Support R_PPC_REL32 & R_PPC64_REL{32,64} · 094d6386
      Fangrui Song authored
      This suppresses `failed to compute relocation: R_PPC_REL32, Invalid data was encountered while parsing the file`
      and its 64-bit variants when running llvm-dwarfdump on a PowerPC object file with .eh_frame
      
      Unfortunately it is difficult to test the computation:
      DWARFDataExtractor::getEncodedPointer does not use the relocated value
      and even if it does, we need to teach llvm-dwarfdump --eh-frame to do
      some linker job to report a reasonable address.
      
      (cherry picked from commit b922004e)
      094d6386
  5. Jul 18, 2020
    • James Y Knight's avatar
      Remove TwoAddressInstructionPass::sink3AddrInstruction. · 8a438096
      James Y Knight authored
      This function has a bug which will incorrectly reschedule instructions
      after an INLINEASM_BR (which can branch). (The bug may also allow
      scheduling past a throwing-CALL, I'm not certain.)
      
      I could fix that bug, but, as the removed FIXME notes, it's better to
      attempt rescheduling before converting to 3-addr form, as that may
      remove the need to convert in the first place. In fact, the code to do
      such reordering was added to this pass only a few months later, in
      2011, via the addition of the function rescheduleMIBelowKill. That
      code does not contain the same bug.
      
      The removal of the sink3AddrInstruction function is not a no-op: in
      some cases it would move an instruction post-conversion, when
      rescheduleMIBelowKill would not move the instruction pre-converison.
      However, this does not appear to be important: the machine instruction
      scheduler can reorder the after-conversion instructions, in any case.
      
      This patch fixes a kernel panic 4.4 LTS x86_64 Linux kernels, when
      built with clang after 4b0aa572.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/1085
      
      Differential Revision: https://reviews.llvm.org/D83708
      
      (cherry picked from commit 60433c63)
      8a438096
  6. Jul 17, 2020
    • Jinsong Ji's avatar
      [docs] Add Deprecated section to ReleaseNotes · 297be788
      Jinsong Ji authored
      This is brought up in https://reviews.llvm.org/D83915.
      We would like to remove some feature in PowerPC.
      
      We did send RFC before, but we think it might be a better idea that
      we indicate planned removal in the Release Notes for version 11
      and actual removal in those for version 12..
      
      Reviewed By: hubert.reinterpretcast
      
      Differential Revision: https://reviews.llvm.org/D83968
      297be788
    • Hans Wennborg's avatar
      Add -flang flag to the test-release.sh script · 1dc182b1
      Hans Wennborg authored
      The flag is off by default.
      
      (cherry picked from commit 033ef842)
      1dc182b1
    • Vitaly Buka's avatar
      [msan] Fix strxfrm test · b35b720f
      Vitaly Buka authored
      Revert D83719 and explicitly set locate to "C".
      
      (cherry picked from commit 650baf22)
      b35b720f
    • Pavel Labath's avatar
      [lldb/DWARF] Don't get confused by line sequences with tombstone values · 884357e3
      Pavel Labath authored
      Summary:
      With D81784, lld has started debug info resolving relocations to
      garbage-collected symbols as -1 (instead of relocation addend). For an
      unaware consumer this generated sequences which seemingly wrap the
      address space -- their first entry was 0xfffff, but all other entries
      were low numbers.
      
      Lldb stores line sequences concatenated into one large vector, sorted by
      the first entry, and searched with std::lower_bound. This resulted in
      the low-value entries being placed at the end of the vector, which
      utterly confused the lower_bound algorithm, and caused it to not find a
      match. (Previously, these sequences would be at the start of the vector,
      and normally would contain addresses that are far smaller than any real
      address we want to look up, so std::lower_bound was fine.)
      
      This patch makes lldb ignore these kinds of sequences completely. It
      does that by changing the construction algorithm from iterating over the
      rows (as parsed by llvm), to iterating over the sequences. This is
      important because the llvm parsed performs validity checks when
      constructing the sequence array, whereas the row array contains raw
      data.
      
      Reviewers: JDevlieghere, MaskRay
      
      Differential Revision: https://reviews.llvm.org/D83957
      
      (cherry picked from commit f3fab392)
      884357e3
    • Craig Topper's avatar
      [X86] Move integer hadd/hsub formation into a helper function shared by combineAdd and combineSub. · fc2d3ffe
      Craig Topper authored
      There was a lot of duplicate code here for checking the VT and
      subtarget. Moving it into a helper avoids that.
      
      It also fixes a bug that combineAdd reused Op0/Op1 after a call
      to isHorizontalBinOp may have changed it. The new helper function
      has its own local version of Op0/Op1 that aren't shared by other
      code.
      
      Fixes PR46455.
      
      Reviewed By: spatel, bkramer
      
      Differential Revision: https://reviews.llvm.org/D83971
      
      (cherry picked from commit 5408024f)
      fc2d3ffe
    • Craig Topper's avatar
      [X86] Add test case for PR46455. · f2eef8cc
      Craig Topper authored
      (cherry picked from commit 9adf7461)
      f2eef8cc
    • Kadir Cetinkaya's avatar
      [clangd] Always retrieve ProjectInfo from Base in OverlayCDB · f7587ec8
      Kadir Cetinkaya authored
      Summary:
      Clangd is returning current working directory for overriden commands.
      This can cause inconsistencies between:
      - header and the main files, as OverlayCDB only contains entries for the main
        files it direct any queries for the headers to the base, creating a
        discrepancy between the two.
      - different clangd instances, as the results will be different depending on the
        timing of execution of the query and override of the command. hence clangd
        might see two different project infos for the same file between different
        invocations.
      - editors and the way user has invoked it, as current working directory of
        clangd will depend on those, hence even when there's no underlying base CWD
        might change depending on the editor, or the directory user has started the
        editor in.
      
      This patch gets rid of that discrepency by always directing queries to base or
      returning llvm::None in absence of it.
      
      For a sample bug see https://reviews.llvm.org/D83099#2154185.
      
      Reviewers: sammccall
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D83934
      
      (cherry picked from commit 46c92100)
      f7587ec8
    • Eric Christopher's avatar
      Temporarily Revert "[AssumeBundles] Use operand bundles to encode alignment assumptions" · 6e3fe081
      Eric Christopher authored
      due to the performance bugs filed in https://bugs.llvm.org/show_bug.cgi?id=46753.
      
      An SROA change soon may obviate some of these problems.
      
      This reverts commit 8d09f207.
      
      (cherry picked from commit 7bfaa400)
      6e3fe081
  7. Jul 16, 2020
  8. Jul 15, 2020