1. May 10, 2020
    • Jez Ng's avatar
      8a5e45aa
    • Arthur Eubanks's avatar
      Add missing pass initialization · 73a9b7de
      Arthur Eubanks authored
      Summary: This was preventing MemorySanitizerLegacyPass from appearing in --print-after-all.
      
      Reviewers: vitalybuka
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D79661
      73a9b7de
    • Jez Ng's avatar
      [lld-macho] Support pc-relative section relocations · 198b0c57
      Jez Ng authored
      Summary: So far we've only supported symbol relocations.
      
      Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D79211
      198b0c57
    • Jez Ng's avatar
      [lld-macho] Use export trie instead of symtab when linking against dylibs · 7bbdbacd
      Jez Ng authored
      Summary:
      This allows us to link against stripped dylibs. Moreover, it's simply
      more correct: The symbol table includes symbols that the dylib uses but
      doesn't export.
      
      This temporarily regresses our ability to do lazy symbol binding because
      dyld_stub_binder isn't in libSystem's export trie. Rather, it is in one
      of the sub-libraries libSystem re-exports. (This doesn't affect our
      tests since we are mocking out dyld_stub_binder there.) A follow-up diff
      will address this by adding support for sub-libraries.
      
      Depends on D79114.
      
      Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee
      
      Subscribers: mgorny, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D79226
      7bbdbacd
    • Jez Ng's avatar
      [lld-macho] Dylib symbols should always replace undefined symbols · 5d3feefa
      Jez Ng authored
      Summary:
      Otherwise we get undefined symbol errors depending on the order of
      arguments on the command line.
      
      Depends on D78270.
      
      Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D79114
      5d3feefa
    • Jez Ng's avatar
      [lld-macho] Support calls to functions in dylibs · b3e2fc93
      Jez Ng authored
      Summary:
      This diff implements lazy symbol binding -- very similar to the PLT
      mechanism in ELF.
      
      ELF's .plt section is broken up into two sections in Mach-O:
      StubsSection and StubHelperSection. Calls to functions in dylibs will
      end up calling into StubsSection, which contains indirect jumps to
      addresses stored in the LazyPointerSection (the counterpart to ELF's
      .plt.got).
      
      Initially, the LazyPointerSection contains addresses that point into one
      of the entry points in the middle of the StubHelperSection. The code in
      StubHelperSection will push on the stack an offset into the
      LazyBindingSection. The push is followed by a jump to the beginning of
      the StubHelperSection (similar to PLT0), which then calls into
      dyld_stub_binder. dyld_stub_binder is a non-lazily bound symbol, so this
      call looks it up in the GOT.
      
      The stub binder will look up the bind opcodes in the LazyBindingSection
      at the given offset. The bind opcodes will tell the binder to update the
      address in the LazyPointerSection to point to the symbol, so that
      subsequent calls don't have to redo the symbol resolution. The binder
      will then jump to the resolved symbol.
      
      Depends on D78269.
      
      Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D78270
      b3e2fc93
    • Jez Ng's avatar
      [lld-macho] Follow-up to D77893 · db157d27
      Jez Ng authored
      Summary:
      1. Don't have isHidden() depend on isNeeded(). Whether a section is
        hidden is orthogonal from whether it is needed: hidden sections will
        never have a header regardless of whether they have a body. (I know we
        override this method with return false for synthetic sections, but
        regardless I think it's confusing to write it this way for non-synthetic
        sections.)
      
      2. Don't call writeTo() on unneeded sections. D78270 assumes that this
        is true when implementing the stub helper section.
      
      3. Filter out the unneeded sections early on to avoid having to deal
         with them in multiple places.
      
      4. Remove assumption in test that the referenced file has no other symbols.
        (We should create separate input files for future tests to avoid such
        issues.)
      
      Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D79460
      db157d27
    • Jinsong Ji's avatar
      [sanitizer] Enable whitelist/blacklist in new PM · a72b9dfd
      Jinsong Ji authored
      https://reviews.llvm.org/D63616 added `-fsanitize-coverage-whitelist`
      and `-fsanitize-coverage-blacklist` for clang.
      
      However, it was done only for legacy pass manager.
      This patch enable it for new pass manager as well.
      
      Reviewed By: vitalybuka
      
      Differential Revision: https://reviews.llvm.org/D79653
      a72b9dfd
    • Craig Topper's avatar
      [X86] Add test cases for vXi16 PMULH opportunities that don't end in truncate. · 66db6f21
      Craig Topper authored
      We already have matching for extend+mul+shift+trunc. But we could
      also match up to the shift without the truncate and just extend the
      result. That would still be a savings.
      66db6f21
    • Matt Arsenault's avatar
      GlobalISel: Handle more cases in lowerUnmergeValues · 3af85fa8
      Matt Arsenault authored
      Handle scalar sources, as well as vectors.
      3af85fa8
    • Craig Topper's avatar
      [BreakFalseDeps] Harden pickBestRegisterForUndef against changing tied... · 24b3c2d0
      Craig Topper authored
      [BreakFalseDeps] Harden pickBestRegisterForUndef against changing tied operands or physical registers that aren't renamable.
      
      I don't have any test cases since X86 doesn't return any tied
      operands from getUndefRegClearance today. But conceivably we could
      want BreakFalseDeps to insert a dependency breaking XOR for
      a tied operand in the future.
      24b3c2d0
    • Florian Hahn's avatar
      [LAA] Remove unneeded PtrRtChecking argument (NFC). · 57fb56b3
      Florian Hahn authored
      The argument is not required and simplifies D78460 a bit.
      57fb56b3
    • Simon Pilgrim's avatar
      [X86] isVectorShiftByScalarCheap - don't limit fast XOP vector shifts to 128-bit vectors · 9237d880
      Simon Pilgrim authored
      XOP targets have fast per-element vector shifts and we're better off splitting to 128-bit shifts where necessary (which is what we already do in LowerShift).
      9237d880
    • Petr Hosek's avatar
      [Clang] Pass -z max-page-size to linker for Fuchsia · 5b02be0b
      Petr Hosek authored
      Currently all Fuchsia ABIs use a 4k page size, departing from
      the recommended page sizes in the respective psABI documents.
      
      Differential Revision: https://reviews.llvm.org/D79667
      5b02be0b
    • Petr Hosek's avatar
      [Clang] Pass --pack-dyn-relocs=relr to lld for Fuchsia · c8fbcb1e
      Petr Hosek authored
      The compact format is fully supported on Fuchsia and is the
      preferred default.
      
      Patch By: mcgrathr
      
      Differential Revision: https://reviews.llvm.org/D79665
      c8fbcb1e
    • Matt Arsenault's avatar
      GlobalISel: Move code into lowering for G_MERGE_VALUES · 69999605
      Matt Arsenault authored
      Currently this code exists in widenScalar for G_MERGE_VALUE
      sources. I'm not sure if the existing expansion in widenScalar should
      be removed or not. The widenScalar variant tries to extend to the
      requested size, but this just uses the original bitwidth.
      69999605
    • Matt Arsenault's avatar
      GlobalISel: Combine G_UNMERGE_VALUES with G_TRUNC · ee1a6982
      Matt Arsenault authored
      G_BITCAST can be lowered with a pair of G_UNMERGE_VALUES and
      G_MERGE_VALUES with different types, but G_UNMERGE_VALUES of a vector
      can also be implemented with a bitcast to a scalar, which introduces
      the possibility for infinite loops. Try to eliminate an illegal source
      register type in the artifact combiner to avoid this from happening.
      
      Avoids infinite looping in the legalizer in a future patch which
      allows lowering G_UNMERGE_VALUES of a vector source with a G_BITCAST.
      ee1a6982
    • Matt Arsenault's avatar
      InstCombine: Broaden copy-constant-to-alloca optimization · 16295d52
      Matt Arsenault authored
      Consider any constant memory type, not just global constants. AMDGPU
      kernel parameters are effectively global constants, but appear as
      either reads from an intrinsic derived pointer or function argument.
      16295d52
    • Matt Arsenault's avatar
      Fix typo · a881dc11
      Matt Arsenault authored
      a881dc11
    • Matt Arsenault's avatar
      AMDGPU: Skip GetUnderlyingObject check in pointsToConstantMemory · beda9d04
      Matt Arsenault authored
      Check the address space first before searching for the object
      definition to save compile time. As an added bonus, this will now
      treat casts to constant addrspace as constant.
      
      We also seemed to be missing targeted tests for this, so add a few
      missing other cases too.
      beda9d04
    • Simon Pilgrim's avatar
      [CodeGenPrepare][X86] Add x16i16, v32i8 and XOP vector shift by scalar amount tests · f8b09f7b
      Simon Pilgrim authored
      Helps improve test coverage of the XOP modes in X86TargetLowering::isVectorShiftByScalarCheap (and where we always return false for vXi8 vector shifts).
      f8b09f7b
    • Simon Pilgrim's avatar
      [X86] Add XOP vector shift by scalar amount tests · d7258c6a
      Simon Pilgrim authored
      Helps improve test coverage of the XOP modes in X86TargetLowering::isVectorShiftByScalarCheap
      d7258c6a
    • Craig Topper's avatar
      [X86] Teach getUndefRegClearance that we use undef for inputs to PUNPCK in some cases. · c7be6a86
      Craig Topper authored
      This enables the register to be changed from XMM/YMM/ZMM0 to
      instead match the other source. This prevents a false
      dependency.
      
      I added all the integer unpck instructions, but the tests
      only show changes for BW and WD.
      
      Unfortunately, we can have undef on operand 1 or 2 of the AVX
      instructions. This breaks the interface with hasUndefRegUpdate
      which used to tell which operand to check.
      
      Now we scan the input operands looking for an undef register and
      then ask hasUndefRegUpdate if its an instruction we care about
      and which operands of that instruction we care about.
      
      I also had to make some changes to the load folding code to
      always pass operand 1 to hasUndefRegUpdate. I've updated
      hasUndefRegUpdate to return false when ForLoadFold is set for
      instructions that are not explicitly blocked for load folding in
      isel patterns.
      
      Differential Revision: https://reviews.llvm.org/D79615
      c7be6a86
    • Craig Topper's avatar
      [X86] Add an assert that v32i16/v64i8 splitting in LowerVSETCC should only... · 56bf0b58
      Craig Topper authored
      [X86] Add an assert that v32i16/v64i8 splitting in LowerVSETCC should only occur when AVX512BW is disabled. NFC
      
      With BWI we should only get a v32i1/v64i1 result type.
      56bf0b58
    • David Green's avatar
      [ARM] Convert VDUPLANE to VDUP under MVE · 6eee2d9b
      David Green authored
      Unlike Neon, MVE does not have a way of duplicating from a vector lane,
      so a VDUPLANE currently selects to a VDUP(move_from_lane(..)). This
      forces that to be done earlier as a dag combine to allow other folds to
      happen.
      
      It converts to a VDUP(EXTRACT). On FP16 this is then folded to a
      VGETLANEu to prevent it from creating a vmovx;vmovhr pair, using a
      single move_from_reg instead.
      
      Differential Revision: https://reviews.llvm.org/D79606
      6eee2d9b
    • Nathan James's avatar
      0e49ac73
    • Fred Riss's avatar
      [lldb/debugserver] Include TargetConditionals.h where needed · c9537b9c
      Fred Riss authored
      MachProcess.mm uses a TARGET_OS_ macro without directly including
      TargetConditionals.h. This currently works as we get the header
      as an indirect dependency, but might not in the future.
      
      I just spent some time investigating an internal regression
      caused by a similar issue, so I audited the codebase for such
      cases.
      c9537b9c
    • Kadir Cetinkaya's avatar
      [clangd] Fix data race in BackgroundIndex test · c746781f
      Kadir Cetinkaya authored
      MockFSProvider is not thread-safe. Make sure we don't modify it while
      background index is working.
      c746781f
    • Tim Keith's avatar
      [flang] Make implicit conversion explicit in assignment · b05c8c57
      Tim Keith authored
      When intrinsic types are assigned there are some implicit conversions
      that take place. This change make them explicit in the types
      representation of assignments.
      
      Differential Revision: https://reviews.llvm.org/D79637
      b05c8c57
  2. May 09, 2020