1. Jul 07, 2021
    • Krzysztof Parzyszek's avatar
      [Hexagon] Generate trap/undef if misaligned access is detected · 94e01d57
      Krzysztof Parzyszek authored
      This applies to memory accesses to (compile-time) constant addresses
      (such as memory-mapped registers). Currently when a misaligned access
      to such an address is detected, a fatal error is reported. This change
      will emit a remark, and the compilation will continue with a trap,
      and "undef" (for loads) emitted.
      
      This fixes https://llvm.org/PR50838.
      
      Differential Revision: https://reviews.llvm.org/D50524
      94e01d57
    • Nico Weber's avatar
      [lld/mac] Give several LTO tests an "lto-" prefix · 76f73404
      Nico Weber authored
      Differential Revision: https://reviews.llvm.org/D105476
      76f73404
    • Eli Friedman's avatar
      Recommit [ScalarEvolution] Make getMinusSCEV() fail for unrelated pointers. · 7ac1c7be
      Eli Friedman authored
      As part of making ScalarEvolution's handling of pointers consistent, we
      want to forbid multiplying a pointer by -1 (or any other value). This
      means we can't blindly subtract pointers.
      
      There are a few ways we could deal with this:
      1. We could completely forbid subtracting pointers in getMinusSCEV()
      2. We could forbid subracting pointers with different pointer bases
      (this patch).
      3. We could try to ptrtoint pointer operands.
      
      The option in this patch is more friendly to non-integral pointers: code
      that works with normal pointers will also work with non-integral
      pointers. And it seems like there are very few places that actually
      benefit from the third option.
      
      As a minimal patch, the ScalarEvolution implementation of getMinusSCEV
      still ends up subtracting pointers if they have the same base.  This
      should eliminate the shared pointer base, but eventually we'll need to
      rewrite it to avoid negating the pointer base. I plan to do this as a
      separate step to allow measuring the compile-time impact.
      
      This doesn't cause obvious functional changes in most cases; the one
      case that is significantly affected is ICmpZero handling in LSR (which
      is the source of almost all the test changes).  The resulting changes
      seem okay to me, but suggestions welcome.  As an alternative, I tried
      explicitly ptrtoint'ing the operands, but the result doesn't seem
      obviously better.
      
      I deleted the test lsr-undef-in-binop.ll becuase I couldn't figure out
      how to repair it to test what it was actually trying to test.
      
      Recommitting with fix to MemoryDepChecker::isDependent.
      
      Differential Revision: https://reviews.llvm.org/D104806
      7ac1c7be
    • Louis Dionne's avatar
      [libc++] Do not set CMAKE_BUILD_WITH_INSTALL_NAME_DIR · 6e43f3fc
      Louis Dionne authored
      I'm not sure what that gains us, and it creates a problem when
      trying to run the tests against libc++ with a custom install name
      dir (e.g. /usr/lib), since the library that we link against (in
      the build tree) will advertise itself as /usr/lib/libc++.dylib,
      so we end up linking against the system dylib at runtime.
      
      Differential Revision: https://reviews.llvm.org/D105499
      6e43f3fc
    • Louis Dionne's avatar
    • Craig Topper's avatar
      [RISCV] Implement lround*/llround*/lrint*/llrint* with fcvt instruction with -fno-math-errno · 12d51f95
      Craig Topper authored
      These are fp->int conversions using either RMM or dynamic rounding modes.
      
      The lround and lrint opcodes have a return type of either i32 or
      i64 depending on sizeof(long) in the frontend which should follow
      xlen. llround/llrint should always return i64 so we'll need a libcall
      for those on rv32.
      
      The frontend will only emit the intrinsics if -fno-math-errno is in
      effect otherwise a libcall will be emitted which will not use
      these ISD opcodes.
      
      gcc also does this optimization.
      
      Reviewed By: arcbbb
      
      Differential Revision: https://reviews.llvm.org/D105206
      12d51f95
    • Michał Górny's avatar
      [compiler-rt] [test] Fix asan symbolize tests on py3.10 · 2d68bb17
      Michał Górny authored
      Update the asan_symbolize_script for changes in argparse output
      in Python 3.10.  The parser output 'options' instead of 'optional
      arguments'.
      
      Differential Revision: https://reviews.llvm.org/D105489
      2d68bb17
    • Michał Górny's avatar
    • David Green's avatar
      [Tests] Update some tests for D104765. NFC · be0924ad
      David Green authored
      be0924ad
    • LLVM GN Syncbot's avatar
      [gn build] Port 8517a26d · 7a46d8f5
      LLVM GN Syncbot authored
      7a46d8f5
    • Eli Friedman's avatar
      Revert "[ScalarEvolution] Make getMinusSCEV() fail for unrelated pointers." · a6d081b2
      Eli Friedman authored
      This reverts commit 74d6ce5d.
      
      Seeing crashes on buildbots in MemoryDepChecker::isDependent.
      a6d081b2
    • Jake Egan's avatar
      [AIX] Define __TOS_AIX__ predefined macro · 045872f4
      Jake Egan authored
      %%%
      Transfer the predefined macro, __TOS_AIX__, from the AIX XL C/C++ compilers.
      
      __TOS_AIX__ indicates that the target operating system is AIX.
      %%%
      
      Reviewed By: cebowleratibm
      
      Differential Revision: https://reviews.llvm.org/D103587
      045872f4
    • Louis Dionne's avatar
      [libc++][docs] Overhaul the documentation for building and using libc++ · 2ce0df4d
      Louis Dionne authored
      This patch overhauls the documentation around building libc++
      for vendors, and using libc++ for end-users. It also:
      
      - Removes mention of the standalone build, which we've been trying to
        get rid of for a long time.
      - Removes mention of using a local ABI installation, which we don't do
        and is documented as "not recommended".
      - Removes mention of the separate libc++filesystem.a library, which isn't
        relevant anymore since filesystem support is in the main library.
      - Adds mention of the GDB pretty printers and how to use them.
      2ce0df4d
    • Fangrui Song's avatar
      [profile][test] Improve coverage-linkage.cpp with ld.lld --gc-sections · 7b6b15e0
      Fangrui Song authored
      The __llvm_prf_names section uses SHF_GNU_RETAIN.  However, GNU ld before 2015-10
      (https://sourceware.org/bugzilla/show_bug.cgi?id=19161) neither supports it nor
      retains __llvm_prf_names according to __start___llvm_prf_names. So --gc-sections
      does not work on such old GNU ld.
      
      This is not a problem for gold and sufficiently new lld.
      7b6b15e0
    • Sanjay Patel's avatar
      [InstSimplify] fix bug in poison propagation for FP ops · 4ec7c021
      Sanjay Patel authored
      If any operand of a math op is poison, that takes
      precedence over general undef/NaN.
      
      This should not be visible with binary ops because
      it requires 2 constant operands to trigger (and if
      both operands of a binop are constant, that should
      get handled first in ConstantFolding).
      4ec7c021
    • Sanjay Patel's avatar
    • Christopher Di Bella's avatar
    • Philip Reames's avatar
      [LV] Disable epilogue vectorization for non-latch exits · 9ffa90d6
      Philip Reames authored
      When skimming through old review discussion, I noticed a post commit comment on an earlier patch which had gone unaddressed.  Better late (4 months), than never right?
      
      I'm not aware of an active problem with the combination of non-latch exits and epilogue vectorization, but the interaction was not considered and I'm not modivated to make epilogue vectorization work with early exits. If there were a bug in the interaction, it would be pretty hard to hit right now (as we canonicalize towards bottom tested loops), but an upcoming change to allow multiple exit loops will greatly increase the chance for error.  Thus, let's play it safe for now.
      9ffa90d6
    • Philip Reames's avatar
      [LoopVersion] Move an assert [nfc-ish] · 600624a1
      Philip Reames authored
      600624a1
    • Eli Friedman's avatar
      [ScalarEvolution] Make getMinusSCEV() fail for unrelated pointers. · 74d6ce5d
      Eli Friedman authored
      As part of making ScalarEvolution's handling of pointers consistent, we
      want to forbid multiplying a pointer by -1 (or any other value). This
      means we can't blindly subtract pointers.
      
      There are a few ways we could deal with this:
      1. We could completely forbid subtracting pointers in getMinusSCEV()
      2. We could forbid subracting pointers with different pointer bases
      (this patch).
      3. We could try to ptrtoint pointer operands.
      
      The option in this patch is more friendly to non-integral pointers: code
      that works with normal pointers will also work with non-integral
      pointers. And it seems like there are very few places that actually
      benefit from the third option.
      
      As a minimal patch, the ScalarEvolution implementation of getMinusSCEV
      still ends up subtracting pointers if they have the same base.  This
      should eliminate the shared pointer base, but eventually we'll need to
      rewrite it to avoid negating the pointer base. I plan to do this as a
      separate step to allow measuring the compile-time impact.
      
      This doesn't cause obvious functional changes in most cases; the one
      case that is significantly affected is ICmpZero handling in LSR (which
      is the source of almost all the test changes).  The resulting changes
      seem okay to me, but suggestions welcome.  As an alternative, I tried
      explicitly ptrtoint'ing the operands, but the result doesn't seem
      obviously better.
      
      I deleted the test lsr-undef-in-binop.ll becuase I couldn't figure out
      how to repair it to test what it was actually trying to test.
      
      Differential Revision: https://reviews.llvm.org/D104806
      74d6ce5d
    • Jonas Paulsson's avatar
      [SystemZ] Support the 'N' code for the odd register in inline-asm. · 458eac25
      Jonas Paulsson authored
      The odd register of a (128 bit) register pair is accessed with the 'N' code
      with an inline assembly operand.
      
      Review: Ulrich Weigand
      
      Differential Revision: https://reviews.llvm.org/D105502
      458eac25
    • Jeremy Morse's avatar
      [DebugInfo][InstrRef][3/4] Produce DBG_INSTR_REFs for all variable locations · 2b2ffb7b
      Jeremy Morse authored
      This patch emits DBG_INSTR_REFs for two remaining flavours of variable
      locations that weren't supported: copies, and inter-block VRegs. There are
      still some locations that must be represented by DBG_VALUE such as
      constants, but they're mostly independent of optimisations.
      
      For variable locations that refer to values defined in different blocks,
      vregs are allocated before isel begins, but the defining instruction
      might not exist until late in isel. To get around this, emit
      DBG_INSTR_REFs in a "half done" state, where the first operand refers to a
      VReg. Then at the end of isel, patch these back up to refer to
      instructions, using the finalizeDebugInstrRefs method.
      
      Copies are something that I complained about the original RFC, and I
      really don't want to have to put instruction numbers on copies. They don't
      define a value: they move them. To address this isel, salvageCopySSA
      interprets:
       * COPYs,
       * SUBREG_TO_REG,
       * Anything that isCopyInstr thinks is a copy.
      And follows chains of copies back to the defining instruction that they
      read from. This relies on any physical registers that COPYs read being
      defined in the same block, or being entry-block arguments. For the former
      we can put an instruction number on the defining instruction; for the
      latter we can drop a DBG_PHI that reads the incoming value.
      
      Differential Revision: https://reviews.llvm.org/D88896
      2b2ffb7b
    • Craig Topper's avatar
      [RISCV] Add support for matching vwmul(u) and vwmacc(u) from fixed vectors. · 2b5e5311
      Craig Topper authored
      This adds a DAG combine to detect sext/zext inputs and emit a
      new ISD opcode. The extends will either be removed or replaced
      with narrower extends.
      
      Isel patterns are used to match add and widening mul to vwmacc
      similar to the recently added vmacc patterns.
      
      There's still some work to be to match vmulsu.
      We should also rewrite splats that were extended as scalars and
      then splatted.
      
      Reviewed By: arcbbb
      
      Differential Revision: https://reviews.llvm.org/D104802
      2b5e5311
    • Arnold Schwaighofer's avatar
      Fix coro lowering of single predecessor phis · 846a530e
      Arnold Schwaighofer authored
      Code assumes that uses of single predecessor phis are not live accross
      suspend points. Cleanup any single predecessor phis preceeding the code
      making this assumption.
      
      rdar://76020301
      
      Differential Revision: https://reviews.llvm.org/D105488
      846a530e
    • Simon Pilgrim's avatar
      [CostModel][X86] fptosi/fptoui to i8/i16 are truncated from fptosi to i32 · b298308b
      Simon Pilgrim authored
      Provide a generic fallback that performs the fptosi to i32 types, then truncates to sub-i32 scalars.
      
      These numbers can be tweaked for specific sse levels, but we should get the default handling in place first.
      b298308b
    • ShihPo Hung's avatar
      [RISCV] Remove Zvamo implication for v1.0-rc change · f1cbea3e
      ShihPo Hung authored
      As v1.0-rc specs say Zvamo is removed from standard extension,
      Zvamo has to be specified explicitly.
      
      Reviewed By: evandro
      
      Differential Revision: https://reviews.llvm.org/D105396
      f1cbea3e
    • Jonas Paulsson's avatar
      [SystemZ] Generate XC loop for memset 0 of variable length. · 37a92f3b
      Jonas Paulsson authored
      Benchmarking has shown that it is worthwhile to implement a variable length
      memset of 0 with XC (exclusive or) like gcc does, instead of using a libcall.
      
      This requires the use of the EXecute Relative Long (EXRL) instruction which
      can now be done in a framework that can also be used with other target
      instructions (not just XC).
      
      Review: Ulrich Weigand
      
      Differential Revision: https://reviews.llvm.org/D103865
      37a92f3b
    • Jon Chesterfield's avatar
      [libomptarget][nfc] Group environment variables, drop accesses to DeviceInfo global · ddfb074a
      Jon Chesterfield authored
      [libomptarget][nfc] Group environment variables, drop accesses to DeviceInfo global
      
      Folds some duplicates logic into a helper function, passes the new environment
      struct into getLaunchVals which no longer reads the DeviceInfo global.
      
      Implemented on top of D105237
      
      Reviewed By: dhruvachak
      
      Differential Revision: https://reviews.llvm.org/D105239
      ddfb074a
  2. Jul 06, 2021