1. Jun 10, 2020
    • Mitch Phillips's avatar
      Rebase. · 9bca45bd
      Mitch Phillips authored
      9bca45bd
    • Mitch Phillips's avatar
      remove redundant comment about Android. · 2ecf32fb
      Mitch Phillips authored
      2ecf32fb
    • Mitch Phillips's avatar
      Address Peter's comments. · 1bfb5b8e
      Mitch Phillips authored
      1bfb5b8e
    • Mitch Phillips's avatar
      Move DSO dependencies inside the group. · 184b4376
      Mitch Phillips authored
      184b4376
    • Mitch Phillips's avatar
      Patch up issues with GN builds (pthread / libz) · 9e9142cb
      Mitch Phillips authored
      Summary:
      Fixes up two small issues with the gn build.
      
       1 - Ensures that the correct ldflag `-pthread` is provided, not just linking the library.
       2 - Ensures that libraries are linked in the same group as the dependencies. This fixes a problem where system libraries (libc) are involved in a link-order dependency that's not being fulfilled.
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D80591
      9e9142cb
    • LLVM GN Syncbot's avatar
      [gn build] Port d5c28c40 · a7e0d55d
      LLVM GN Syncbot authored
      a7e0d55d
    • Craig Topper's avatar
      [X86] Move CPUKind enum from clang to llvm/lib/Support. NFCI · d5c28c40
      Craig Topper authored
      Similar to what some other targets have done. This information
      could be reused by other frontends so doesn't make sense to live
      in clang.
      
      -Rename CK_Generic to CK_None to better reflect its illegalness.
      -Move function for translating from string to enum into llvm.
      -Call checkCPUKind directly from the string to enum translation
      and update CPU kind to CK_None accordinly. Caller will use CK_None
      as sentinel for bad CPU.
      
      I'm planning to move all the CPU to feature mapping out next. As
      part of that I want to devise a better way to express CPUs inheriting
      features from an earlier CPU. Allowing this to be expressed in a
      less rigid way than just falling through a switch. Or using gotos
      as we've had to do lately.
      
      Differential Revision: https://reviews.llvm.org/D81439
      d5c28c40
    • Matt Arsenault's avatar
    • Sanjay Patel's avatar
      [x86] refine conditions for immediate hoisting to save code-size · 6f6d2d23
      Sanjay Patel authored
      As shown in PR46237:
      https://bugs.llvm.org/show_bug.cgi?id=46237
      
      The size-savings win for hoisting an 8-bit ALU immediate (intentionally
      excluding store constants) requires extreme conditions; it may not even
      be possible when including REX prefix bytes on x86-64.
      
      I did draft a version of this patch that included use counts after the
      loop, but I suspect that accounting is not working as expected. I think
      that is because the number of constant uses are changing as we select
      instructions (for example as we transform shl/add into LEA).
      
      Differential Revision: https://reviews.llvm.org/D81468
      6f6d2d23
    • Erich Keane's avatar
      Undo change inadvertently added in 113b0d7d · 90ee8cf6
      Erich Keane authored
      90ee8cf6
    • Matt Arsenault's avatar
      GlobalISel: Set instr/debugloc before any legalizer action · 32823091
      Matt Arsenault authored
      It was annoying enough that every custom lowering needed to set the
      insert point, but this was made worse since now these all needed to be
      updated to setInstrAndDebugLoc. Consolidate these so every
      legalization action has the right insert position by default.
      
      This should fix dropping debug info in every custom AMDGPU
      legalization.
      32823091
    • Louis Dionne's avatar
      [NFCI] Clean up exceptions related CMake and Lit options in libc++abi and libunwind · 0e04342a
      Louis Dionne authored
      First, libc++abi doesn't need to add the no-exceptions Lit feature itself,
      since that is already done in the config.py for libc++, which it reuses.
      Specifically, config.enable_exceptions is set based on @LIBCXXABI_ENABLE_EXCEPTIONS@
      in libc++abi's lit.cfg.in, and libc++'s config.py handles that correctly.
      
      Secondly, libunwind's LIBUNWIND_ENABLE_EXCEPTIONS is never set (it's
      probably a remnant of copy-pasting code between the runtime libraries),
      so the library is always built with exceptions disabled (which makes
      sense since it implements the runtime support for exceptions).
      Conversely, the test suite is always run with exceptions enabled
      (not sure why), but that is preserved by the default behavior of
      libc++'s config.py.
      0e04342a
    • Sanjay Patel's avatar
      f71a3b54
    • Erich Keane's avatar
      PR46255: Fix field diagnostics for C records with anonymous members. · 113b0d7d
      Erich Keane authored
      The ParseStructUnionBody function was separately keeping track of the
      field decls for historical reasons, however the "ActOn" functions add
      the field to the RecordDecl anyway.
      
      The "ParseStructDeclaration" function, which handles parsing fields
      didn't have a way of handling what happens on an anonymous field, and
      changing it would alter a large amount of objc code, so I chose instead
      to implement this by just filling the FieldDecls vector with the actual
      FieldDecls that were successfully added to the recorddecl .
      113b0d7d
    • Matt Arsenault's avatar
      GlobalISel: Improve MachineIRBuilder construction · b94c9e3b
      Matt Arsenault authored
      The current relationship between LegalizerHelper and MachineIRBuilder
      confuses me, because the LegalizerHelper modifies the MachineIRBuilder
      which it does not own. Constructing a LegalizerHelper destroys the
      insert point, since the constructor calls setMF, which clears all the
      fields. Try to separate these functions, so it's possible to construct
      a LegalizerHelper from an existing MachineIRBuilder without losing the
      insert point/debug loc.
      b94c9e3b
    • Matt Arsenault's avatar
      GlobalISel: Move some trivial MIRBuilder methods into the header · babbf444
      Matt Arsenault authored
      The construction APIs for MachineIRBuilder don't make much sense, and
      it's been annoying to sort through it with these trivial functions
      separate from the declaration.
      babbf444
    • Matt Arsenault's avatar
      GlobalISel: Remove redundant check in verifier · bb6cb6bf
      Matt Arsenault authored
      This was already checked earlier for all instructions.
      bb6cb6bf
    • Matt Arsenault's avatar
      GlobalISel: Fix double printing new instructions in legalizer · 6eeac6ae
      Matt Arsenault authored
      New instructions were getting printed both in createdInstr, and in the
      final printNewInstrs, so it made it look like the same instructions
      were created twice. This overall made reading the debug output
      harder. Stop printing the initial construction and only print new
      instructions in the summary at the end. This avoids printing the less
      useful case where instructions are sometimes initially created with no
      operands.
      
      I'm not sure this is the correct instance to remove; now the visible
      ordering is different. Now you will typically see the one erased
      instruction message before all the new instructions in order. I think
      this is the more logical view of typical legalization changes,
      although it's mechanically backwards from the normal
      insert-new-erase-old pattern.
      6eeac6ae
    • Jonas Devlieghere's avatar
      [lldb/Reproducers] Also collect ::open and ::fopen · 6c5c4a2a
      Jonas Devlieghere authored
      Report files opened trough ::open and ::fopen to the FileCollector.
      6c5c4a2a
    • Mehdi Amini's avatar
      Change filecheck default to dump input on failure · d31c9e5a
      Mehdi Amini authored
      Having the input dumped on failure seems like a better
      default: I debugged FileCheck tests for a while without knowing
      about this option, which really helps to understand failures.
      
      Remove `-dump-input-on-failure` and the environment variable
      FILECHECK_DUMP_INPUT_ON_FAILURE which are now obsolete.
      
      Differential Revision: https://reviews.llvm.org/D81422
      d31c9e5a
    • Louis Dionne's avatar
      [libc++][CMake] Add CMake caches for commonly supported configurations · d9dec697
      Louis Dionne authored
      This commit adds CMake caches for the various configurations of libc++
      that are tested by our build bots.
      
      Differential Revision: https://reviews.llvm.org/D81293
      d9dec697
    • Tridacnid's avatar
      Assignment and Inc/Dec operators wouldn't register as a mutation when Implicit... · ce5fecb7
      Tridacnid authored
      Assignment and Inc/Dec operators wouldn't register as a mutation when Implicit Paren Casts were present
      
      Add ignoringParenImpCasts to assignment and inc/dec mutation checks in ExprMutationAnalyzer to fix clang-tidy bug PR45490.
      https://bugs.llvm.org/show_bug.cgi?id=45490
      
      Reviewed By: njames93, aaron.ballman, gribozavr2
      
      Differential Revision: https://reviews.llvm.org/D79912
      ce5fecb7
    • Louis Dionne's avatar
      [libc++] Fix too stringent availability markup for bad_optional_access · 7fb40e15
      Louis Dionne authored
      The availability markup for bad_optional_access marked it as being added
      in MacOS 10.14 and aligned releases, however it appears to have been added
      in Mac OS 10.13 and aligned releases.
      7fb40e15
    • Anh Tuyen Tran's avatar
      [NFC][LV][TEST]: extend pr45679-fold-tail-by-masking.ll with... · e7c5412b
      Anh Tuyen Tran authored
      [NFC][LV][TEST]: extend pr45679-fold-tail-by-masking.ll with -force-vector-width=1 -force-vector-interleave=4
      
      Summary:
      Add -force-vector-width=1 -force-vector-interleave=4 to pr45679-fold-tail-by-masking.ll
      
      Author: anhtuyen (Anh Tuyen Tran)
      
      Reviewers: Ayal (Ayal Zaks)
      
      Reviewed By: Ayal (Ayal Zaks)
      
      Subscribers: rkruppe (Hanna Kruppe), llvm-commits, LLVM
      
      Tag: LLVM
      
      Differential Revision: https://reviews.llvm.org/D80446
      e7c5412b
    • Fangrui Song's avatar
      [ELF] Demote lazy symbols relative to a discarded section to Undefined · ba890da2
      Fangrui Song authored
      Fixes PR45594.
      
      In `ObjFile<ELFT>::initializeSymbols()`, for a defined symbol relative to
      a discarded section (due to section group rules), it may have been
      inserted as a lazy symbol. We need to demote it to an Undefined to
      enable the `discarded section` error happened in a later pass.
      
      Add `LazyObjFile::fetched` (if true) and `ArchiveFile::parsed` (if
      false) to represent that there is an ongoing lazy symbol fetch and we
      should replace the current lazy symbol with an Undefined, instead of
      calling `Symbol::resolve` (`Symbol::resolve` should be called if the lazy
      symbol was added by an unrelated archive/lazy object).
      
      As a side result, one small issue in start-lib-comdat.s is now fixed.
      The hack motivating D51892 will be unsupported: if
      `.gnu.linkonce.t.__i686.get_pc_thunk.bx` in an archive is referenced
      by another section, this will likely be errored unless the function is
      also defined in a regular object file.
      (Bringing back rL330869 would error `undefined symbol` instead of the
      more relevant `discarded section`.)
      
      Note, glibc i386's crti.o still works (PR31215), because
      `.gnu.linkonce.t.__x86.get_pc_thunk.bx` is in crti.o (one of the first
      regular object files in a linker command line).
      
      Reviewed By: psmith
      
      Differential Revision: https://reviews.llvm.org/D79300
      ba890da2
    • David Green's avatar
      [MachineScheduler] Update available queue on the first mop of a new cycle · 2fea3fe4
      David Green authored
      If a resource can be held for multiple cycles in the schedule model
      then an instruction can be placed into the available queue, another
      instruction can be scheduled, but the first will not be taken back out if
      the two instructions hazard. To fix this make sure that we update the
      available queue even on the first MOp of a cycle, pushing available
      instructions back into the pending queue if they now conflict.
      
      This happens with some downstream schedules we have around MVE
      instruction scheduling where we use ResourceCycles=[2] to show the
      instruction executing over two beats. Apparently the test changes here
      are OK too.
      
      Differential Revision: https://reviews.llvm.org/D76909
      2fea3fe4
    • Fangrui Song's avatar
      [gcov][test] Add mkdir -p %t && cd %t · 6bb93e3d
      Fangrui Song authored
      This allows an alternative lit runner (which does not chdir to %T)
      to run within a read-only source tree.
      6bb93e3d
    • Simon Pilgrim's avatar
      [VectorCombine] scalarizeBinop - support an all-constant src vector operand · 5dc4e7c2
      Simon Pilgrim authored
      scalarizeBinop currently folds
      
        vec_bo((inselt VecC0, V0, Index), (inselt VecC1, V1, Index))
        ->
        inselt(vec_bo(VecC0, VecC1), scl_bo(V0,V1), Index)
      
      This patch extends this to account for cases where one of the vec_bo operands is already all-constant and performs similar cost checks to determine if the scalar binop with a constant still makes sense:
      
        vec_bo((inselt VecC0, V0, Index), VecC1)
        ->
        inselt(vec_bo(VecC0, VecC1), scl_bo(V0,extractelt(V1,Index)), Index)
      
      Fixes PR42174
      
      Differential Revision: https://reviews.llvm.org/D80885
      5dc4e7c2
    • Arthur Eubanks's avatar
      Change debuginfo check for addHeapAllocSiteMetadata · bc387938
      Arthur Eubanks authored
      Summary:
      Move check inside of addHeapAllocSiteMetadata().
      Change check to DebugInfo <= DebugLineTablesOnly.
      
      Reviewers: akhuang
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D81481
      bc387938
    • Daniel Kiss's avatar
      [AArch64] Allow BTI mnemonics in the HINT space with BTI disabled · 7a38618a
      Daniel Kiss authored
      Summary:
      It is important to emit HINT instructions instead of BTI  ones when
      BTI is disabled. This allows compatibility with other assemblers
      (e.g. GAS).
      
      Still, developers of assembly code will want to write code that is
      compatible with both pre- and post-BTI CPUs. They could use HINT
      mnemonics, but the new mnemonics are a lot more readable (e.g.
      bti c instead of hint #34), and they will result in the same
      encodings. So, while LLVM should not *emit* the new mnemonics when
      BTI is disabled, this patch will at least make LLVM *accept*
      assembly code that uses them.
      
      Reviewers: pbarrio, tamas.petz, ostannard
      
      Reviewed By: pbarrio, ostannard
      
      Subscribers: ostannard, kristof.beyls, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D81257
      7a38618a
    • Jessica Paquette's avatar
      [AArch64][GlobalISel] Select trn1 and trn2 · cb2d8b30
      Jessica Paquette authored
      Same idea as for zip, uzp, etc. Teach the post-legalizer combiner to recognize
      G_SHUFFLE_VECTORs that are trn1/trn2 instructions.
      
      - Add G_TRN1 and G_TRN2
      - Port mask matching code from AArch64ISelLowering
      - Produce G_TRN1 and G_TRN2 in the post-legalizer combiner
      - Select via importer
      
      Add select-trn.mir to test selection.
      
      Add postlegalizer-combiner-trn.mir to test the combine. This is similar to the
      existing arm64-trn test.
      
      Note that both of these tests contain things we currently don't legalize.
      
      I figured it would be easier to test these now rather than later, since once
      we legalize the G_SHUFFLE_VECTORs, it's not guaranteed that someone will update
      the tests.
      
      Differential Revision: https://reviews.llvm.org/D81182
      cb2d8b30
    • Jonas Devlieghere's avatar
      [lldb/Interpreter] Support color in CommandReturnObject · de019b88
      Jonas Devlieghere authored
      Color the error: and warning: part of the CommandReturnObject output,
      similar to how an error is printed from the driver when colors are
      enabled.
      
      Differential revision: https://reviews.llvm.org/D81058
      de019b88
    • Louis Dionne's avatar
      [libc++] Avoid UB in year_month_day_last::day() for incorrect months · 1f48f8f6
      Louis Dionne authored
      This effectively implements the resolution of LWG3231, which mandates
      that calling year_month_day_last::day() on an invalid year_month_day_last
      is unspecified behavior. Before this change, it was undefined behavior.
      
      Differential Revision: https://reviews.llvm.org/D81477
      1f48f8f6
    • Stephan Herhut's avatar
      [mlir][gpu] Add support for f16 when lowering to nvvm intrinsics · 2c8afe12
      Stephan Herhut authored
      Summary:
      The NVVM target only provides implementations for tanh etc. on f32 and
      f64 operands. To also support f16, we now insert operations to extend to f32
      and truncate back to f16 around the intrinsic call.
      
      Differential Revision: https://reviews.llvm.org/D81473
      2c8afe12
    • Thomas Lively's avatar
      [WebAssembly] Implement prototype SIMD rounding instructions · b7d36928
      Thomas Lively authored
      Summary:
      As specified in https://github.com/WebAssembly/simd/pull/232. These
      instructions are implemented as LLVM intrinsics for now rather than
      normal ISel patterns to make these instructions opt-in. Once the
      instructions are merged to the spec proposal, the intrinsics will be
      replaced with proper ISel patterns.
      
      Reviewers: aheejin
      
      Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D81222
      b7d36928
    • Yuanfang Chen's avatar
      Add begin source location for the attributed statement created from PragmaLoopHint decorated loop · 9c2e7700
      Yuanfang Chen authored
      Summary:
      Right now it is a '<invalid sloc>' for cases like this.
      CounterCoverageMappingBuilder relies on the information to decide the
      region for a attributed loop.
      
      Fixes PR40971
      
      Reviewers: ABataev, jdenny, lebedev.ri, aaron.ballman
      
      Reviewed by: jdenny, aaron.ballman
      
      Differential Revision: https://reviews.llvm.org/D80944
      9c2e7700
    • Saiyedul Islam's avatar
      [AMDGPU] Introduce Clang builtins to be mapped to AMDGCN atomic inc/dec intrinsics · 675cefbf
      Saiyedul Islam authored
      Summary:
      __builtin_amdgcn_atomic_inc32(int *Ptr, int Val, unsigned MemoryOrdering, const char *SyncScope)
      __builtin_amdgcn_atomic_inc64(int64_t *Ptr, int64_t Val, unsigned MemoryOrdering, const char *SyncScope)
      __builtin_amdgcn_atomic_dec32(int *Ptr, int Val, unsigned MemoryOrdering, const char *SyncScope)
      __builtin_amdgcn_atomic_dec64(int64_t *Ptr, int64_t Val, unsigned MemoryOrdering, const char *SyncScope)
      
      First and second arguments gets transparently passed to the amdgcn atomic
      inc/dec intrinsic. Fifth argument of the intrinsic is set as true if the
      first argument of the builtin is a volatile pointer. The third argument of
      this builtin is one of the memory-ordering specifiers ATOMIC_ACQUIRE,
      ATOMIC_RELEASE, ATOMIC_ACQ_REL, or ATOMIC_SEQ_CST following C++11 memory
      model semantics. This is mapped to corresponding LLVM atomic memory ordering
      for the atomic inc/dec instruction using CLANG atomic C ABI. The fourth
      argument is an AMDGPU-specific synchronization scope defined as string.
      
      Reviewers: arsenm, sameerds, JonChesterfield, jdoerfert
      
      Reviewed By: arsenm, sameerds
      
      Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, jfb, kerbowa, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D80804
      675cefbf
    • msifontes's avatar
      [mlir] Add number of operands verification for shape.assuming_all operation · 1c189d71
      msifontes authored
      Implemented a verification to ensure that the shape.assuming_all
      operation always has at least one operand.
      1c189d71
    • Louis Dionne's avatar
      [libc++] Remove workarounds for the lack of clock_gettime on older macOS platforms · babd3aef
      Louis Dionne authored
      This increases the Mac OS requirement for building libc++ to 10.12.
      Note that it doesn't change whether the *headers* still support older
      platforms -- it's only that macOS >= 10.12 is required to build the
      dylib from sources.
      
      Differential Revision: https://reviews.llvm.org/D74489
      babd3aef
    • Fangrui Song's avatar
      [DebugInfo] Drop unneeded format() calls (fix -Wformat-security) after... · 81cca987
      Fangrui Song authored
      [DebugInfo] Drop unneeded format() calls (fix -Wformat-security) after 3b7ec64d
      81cca987