1. Mar 11, 2021
    • Dan Liew's avatar
      [compiler-rt] Fix stale incremental builds when using `LLVM_BUILD_EXTERNAL_COMPILER_RT=ON`. · a159f91c
      Dan Liew authored
      When building with `LLVM_BUILD_EXTERNAL_COMPILER_RT=ON` (e.g. Swift does
      this) we do an "external" build of compiler-rt where we build
      compiler-rt with the just built clang.
      
      Unfortunately building in this mode had a bug where compiler-rt would
      not get rebuilt if compiler-rt sources changed. This is problematic
      for incremental builds because it meant that the compiler-rt binaries
      were stale.
      
      The fix is to use the `BUILD_ALWAYS` ExternalProject_Add option which
      means the build command for compiler-rt is always run.
      
      In principle if all of the following are true:
      
      * compiler-rt has already been built.
      * there are no compiler-rt source changes.
      * the compiler hasn't changed.
      * ninja is being used as the generator for the compiler-rt build.
      
      then the overhead for always running the build command for incremental
      builds is negligible.
      
      However, in practice clang gets rebuilt everytime the HEAD commit
      changes (due to commit hash being embedded in the output of `--version`)
      which means all of compiler-rt will be rebuilt everytime this happens.
      While this is annoying it's better to do the slow but correct thing
      rather than the fast but incorrect thing.
      
      rdar://75150660
      
      Differential Revision: https://reviews.llvm.org/D98291
      a159f91c
    • Peter Steinfeld's avatar
      [flang] Fix call to CHECK() on overriding an erroneous type-bound procedure · 40e26180
      Peter Steinfeld authored
      You can define a base type with a type-bound procedure which is erroneously
      missing a NOPASS attribute and then define another type that extends the base
      type and overrides the erroneous procedure.  In this case, when we perform
      semantic checking on the overriding procedure, we verify the "pass index" of
      the overriding procedure.  The attempt to get the procedure's pass index fails
      a call to CHECK().
      
      I fixed this by calling SetError() on the symbol of the overridden procedure in
      the base type.  Then, I check HasError() before executing the code that invokes
      the failing call to CHECK().  I also added a test that will cause the compiler
      to fail the call to CHECK() without this change.
      
      Differential Revision: https://reviews.llvm.org/D98355
      40e26180
    • Michał Górny's avatar
      f47a84bc
    • Michał Górny's avatar
      [lldb] [Process/FreeBSD] Introduce aarch64 hw break/watchpoint support · 771c4c9c
      Michał Górny authored
      Split out the common base of Linux hardware breakpoint/watchpoint
      support for AArch64 into a Utility class, and use it to implement
      the matching support on FreeBSD.
      
      Differential Revision: https://reviews.llvm.org/D96548
      771c4c9c
    • Daniil Seredkin's avatar
      [InstCombine][SimplifyLibCalls] An extra sqrtf was produced because of... · 7c49f3c7
      Daniil Seredkin authored
      [InstCombine][SimplifyLibCalls] An extra sqrtf was produced because of transformations in optimizePow function
      
      See: https://bugs.llvm.org/show_bug.cgi?id=47613
      
      There was an extra sqrt call because shrinking emitted a new powf and at the same time optimizePow replaces the previous pow with sqrt and as the result we have two instructions that will be in worklist of InstCombie despite the fact that %powf is not used by anyone (it is alive because of errno).
      
      As the result we have two instructions:
      
        %powf = call fast float @powf(float %x, float 5.000000e-01)
        %sqrt = call fast double @sqrt(double %dx)
      
      %powf will be converted to %sqrtf on a later iteration.
      
      As a quick fix for that I moved shrinking to the end of optimizePow so that pow is replaced with sqrt at first that allows not to emit a new shrunk powf.
      
      Differential Revision: https://reviews.llvm.org/D98235
      7c49f3c7
    • Craig Topper's avatar
      [RISCV] Manually split vector operands to VECREDUCE when handling vXi64 vectors on RV32. · 1e391186
      Craig Topper authored
      The type legalizer will visit the result before the operands. To
      avoid creating an illegal target specific node or falling back to
      scalarization, we need to manually split vector operands.
      
      This still doesn't handle the case of non-power of 2 operands
      which need to be widened. I'm not sure the type legalizer is
      ready for it. I think we would need to insert an
      INSERT_SUBVECTOR with the power of 2 type we want, with an undef
      first operand, and the non-power of 2 orignal operand as the vector
      to insert. Then fill in the neutral elements into the elements the
      padded elements. Alternatively we INSERT_SUBVECTOR into a neutral vector.
      From there we carry on splitting if needed to get to a legal type
      then do the target specific code.
      
      The problem with this is the type legalizer doesn't know how to
      widen an insert_subvector yet. We would need to add that including
      the handling for a non-undef first vector.
      
      Reviewed By: frasercrmck
      
      Differential Revision: https://reviews.llvm.org/D98292
      1e391186
    • Ta-Wei Tu's avatar
    • Stephen Tozer's avatar
      [DebugInfo] Handle DBG_VALUES with multiple variable location operands in MIR · 1db137b1
      Stephen Tozer authored
      This patch adds handling for DBG_VALUE_LIST in the MIR-passes (after
      finalize-isel), excluding the debug liveness passes and DWARF emission. This
      most significantly affects MachineSink, which now needs to consider all used
      registers of a debug value when sinking, but for most passes this change is
      simply replacing getDebugOperand(0) with an iteration over all debug operands.
      
      Differential Revision: https://reviews.llvm.org/D92578
      1db137b1
    • Jianzhou Zhao's avatar
      [dfsan] Tracking origins at phi nodes · 6a9a686c
      Jianzhou Zhao authored
      This is a part of https://reviews.llvm.org/D95835.
      
      Reviewed-by: morehouse
      
      Differential Revision: https://reviews.llvm.org/D98268
      6a9a686c
    • Andrzej Warzynski's avatar
      [flang][driver] Revert RUN-line change · 547624af
      Andrzej Warzynski authored
      In https://reviews.llvm.org/D98283, the RUN line in pre-fir-tree04.f90
      was updated to use `%flang_fc1` instead of `%f18` (so that the test is
      shared between the old and the new driver). Unfortunately, the new
      driver does not know yet how to find standard intrinsics modules. As a
      result, the test fails when `FLANG_BUILD_NEW_DRIVER` is set to On.
      
      I'm restoring the original RUN line. This is rather straightforward, so
      sending without a review. This should make Flang builders happy.
      547624af
    • Dávid Bolvanský's avatar
      [DSE] Handle memmove with equal non-const sizes · c68b560b
      Dávid Bolvanský authored
      Follow up for fhahn's D98284. Also fixes a case from PR47644.
      
      Reviewed By: fhahn
      
      Differential Revision: https://reviews.llvm.org/D98346
      c68b560b
    • Florian Hahn's avatar
    • Jay Foad's avatar
      [AMDGPU] Fix isReallyTriviallyReMaterializable for V_MOV_* · 70f013fd
      Jay Foad authored
      D57708 changed SIInstrInfo::isReallyTriviallyReMaterializable to reject
      V_MOVs with extra implicit operands, but it accidentally rejected all
      V_MOVs because of their implicit use of exec. Fix it but avoid adding a
      moderately expensive call to MI.getDesc().getNumImplicitUses().
      
      In real graphics shaders this changes quite a few vgpr copies into move-
      immediates, which is good for avoiding stalls on GFX10.
      
      Differential Revision: https://reviews.llvm.org/D98347
      70f013fd
  2. Mar 10, 2021