1. Jul 10, 2020
  2. Jul 09, 2020
    • Hans Wennborg's avatar
      Revert 51b0da73 "Recommit "[X86] Merge the FEATURE_64BIT and FEATURE_EM64T... · 9ecda9aa
      Hans Wennborg authored
      Revert 51b0da73 "Recommit "[X86] Merge the FEATURE_64BIT and FEATURE_EM64T bits in X86TargetParser.def.""
      
      It gets miscompiled with GCC 5.3, causing Clang to crash with
      "error: unknown target CPU 'x86-64'"
      
      See the llvm-commits thread for reproduction steps.
      
      This reverts commit 51b0da73.
      9ecda9aa
    • Dmitri Gribenko's avatar
      Refactored NumericLiteralParser to not require a Preprocessor · 3cca818e
      Dmitri Gribenko authored
      Summary:
      We would like to use NumericLiteralParser in the implementation of the
      syntax tree builder, and plumbing a preprocessor there seems
      inconvenient and superfluous.
      
      Reviewers: eduucaldas
      
      Reviewed By: eduucaldas
      
      Subscribers: gribozavr2, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D83480
      3cca818e
    • Anatoly Trosinenko's avatar
      [MSP430] Align the _Complex ABI with current msp430-gcc · 67422e42
      Anatoly Trosinenko authored
      Assembler output is checked against msp430-gcc 9.2.0.50 from TI.
      
      Reviewed By: asl
      
      Differential Revision: https://reviews.llvm.org/D82646
      67422e42
    • George Mitenkov's avatar
      [MLIR][SPIRVToLLVM] Conversion of SPIR-V array, runtime array, and pointer types · 28cd3cbc
      George Mitenkov authored
      This patch adds type conversion for 4 SPIR-V types: array, runtime array, pointer
      and struct. This conversion is integrated using a separate function
      `populateSPIRVToLLVMTypeConversion()` that adds new type conversions. At the moment,
      this is a basic skeleton that allows to perfom conversion from SPIR-V array,
      runtime array and pointer types to LLVM typesystem. There is no support of array
      strides or storage classes. These will be supported on the case by case basis.
      
      Reviewed By: antiagainst
      
      Differential Revision: https://reviews.llvm.org/D83399
      28cd3cbc
    • Zhi Zhuang's avatar
      Fix warning caused by __builtin_expect_with_probability was not handled · 4d4d9037
      Zhi Zhuang authored
      in places such as constant folding
      
      Previously some places that should have handled
      __builtin_expect_with_probability is missing, so in some case it acts
      differently than __builtin_expect.
      For example it was not handled in constant folding, thus in the
      following program, the "if" condition should be constantly true and
      folded, but previously it was not handled and cause warning "control may
      reach end of non-void function" (while __builtin_expect does not):
      
      __attribute__((noreturn)) extern void bar();
      int foo(int x, int y) {
        if (y) {
          if (__builtin_expect_with_probability(1, 1, 1))
            bar();
        }
        else
          return 0;
      }
      
      Now it's fixed.
      
      Differential Revisions: https://reviews.llvm.org/D83362
      4d4d9037
    • Stefan Pintilie's avatar
      [PowerPC] Support PCRelative Callees for R_PPC64_REL24 Relocation · beb52b12
      Stefan Pintilie authored
      The R_PPC64_REL24 is used in function calls when the caller requires a
      valid TOC pointer. If the callee shares the same TOC or does not clobber
      the TOC pointer then a direct call can be made. If the callee does not
      share the TOC a thunk must be added to save the TOC pointer for the caller.
      
      Up until PC Relative was introduced all local calls on medium and large code
      models were assumed to share a TOC. This is no longer the case because
      if the caller requires a TOC and the callee is PC Relative then the callee
      can clobber the TOC even if it is in the same DSO.
      
      This patch is to add support for a TOC caller calling a PC Relative callee that
      clobbers the TOC.
      
      Reviewed By: sfertile, MaskRay
      
      Differential Revision: https://reviews.llvm.org/D82950
      beb52b12
    • George Mitenkov's avatar
      [MLIR][SPIRVToLLVM] SPIR-V types size in bytes function · 5d075bea
      George Mitenkov authored
      Added `getSizeInBytes()` function as a class member to several SPIR-V types:
      `ScalarType`, `ArrayType` and `VectorType`. This function aims at exposing
      the functionality of `getTypeNumBytes()` from `SPIRVLowering.cpp`. Support
      of more types will be added on demand.
      
      Reviewed By: antiagainst
      
      Differential Revision: https://reviews.llvm.org/D83285
      5d075bea
    • Eric Schweitz's avatar
      [flang] partially revert upstreamed code to support complex values in runtime... · 7cd1b0ff
      Eric Schweitz authored
      [flang] partially revert upstreamed code to support complex values in runtime support to avoid warnings.
      7cd1b0ff
    • Diogo Sampaio's avatar
      [NFC] Add SExt multiuses test · a0e981c1
      Diogo Sampaio authored
      a0e981c1
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Work around verifier error in test · fdde69aa
      Matt Arsenault authored
      The unfortunate split between finalizeLowering and the selector pass
      means there's a point where the verifier fails. The DAG selector pass
      skips the verifier, but this seems to not work when using the
      GlobalISel fallback.
      fdde69aa
    • Simon Pilgrim's avatar
    • David Green's avatar
      [BasicAA] Enable -basic-aa-recphi by default · af839a96
      David Green authored
      This option was added a while back, to help improve AA around pointer
      phi loops. It looks for phi(gep(phi, const), x) loops, checking if x can
      then prove more precise aliasing info.
      
      Differential Revision: https://reviews.llvm.org/D82998
      af839a96
    • Matt Arsenault's avatar
      OpaquePtr: Don't check pointee type for byval/preallocated · 6f5d9136
      Matt Arsenault authored
      Since none of these users really care about the actual type, hide the
      type under a new size-getting attribute to go along with
      hasPassPointeeByValueAttr. This will work better for the future byref
      attribute, which may end up only tracking the byte size and not the IR
      type.
      
      We currently have 3 parameter attributes that should carry the type
      (technically inalloca does not yet). The APIs are somewhat awkward
      since preallocated/inalloca piggyback on byval in some places, but in
      others are treated as distinct attributes. Since these are all
      mutually exclusive, we should probably just merge all the attribute
      infrastructure treating these as totally distinct attributes.
      6f5d9136
    • Gabor Marton's avatar
      [analyzer] Add CTUImportCppThreshold for C++ files · d12d0b73
      Gabor Marton authored
      Summary:
      The default CTUImportThreshold (8) seems to be too conservative with C projects.
      We increase this value to 24 and we introduce another threshold for C++ source
      files (defaulted to 8) because their AST is way more compilcated than C source
      files.
      
      Differential Revision: https://reviews.llvm.org/D83475
      d12d0b73
    • Luboš Luňák's avatar
      make -fmodules-codegen and -fmodules-debuginfo work also with PCHs · 31b05692
      Luboš Luňák authored
      Allow to build PCH's (with -building-pch-with-obj and the extra .o file)
      with -fmodules-codegen -fmodules-debuginfo to allow emitting shared code
      into the extra .o file, similarly to how it works with modules. A bit of
      a misnomer, but the underlying functionality is the same. This saves up
      to 20% of build time here. The patch is fairly simple, it basically just
      duplicates -fmodules checks to also alternatively check
      -building-pch-with-obj.
      
      This already got committed as cbc9d22e,
      but then got reverted in 7ea9a6e0
      because of PR44953, as discussed in D74846. This is a corrected version
      which does not include two places for the PCH case that aren't included
      in the modules -fmodules-codegen path either.
      
      Differential Revision: https://reviews.llvm.org/D69778
      31b05692
    • Simon Pilgrim's avatar
      [X86][AVX] Attempt to fold extract_subvector(shuffle(X)) -> extract_subvector(X) · f54402b6
      Simon Pilgrim authored
      If we're extracting a subvector from a shuffle that is shuffling entire subvectors we can peek through and extract the subvector from the shuffle source instead.
      
      This helps remove some cases where concat_vectors(extract_subvector(),extract_subvector()) legalizations has resulted in BLEND/VPERM2F128 shuffles of the subvectors.
      f54402b6
    • Simon Pilgrim's avatar
      BasicAAResult::constantOffsetHeuristic - pass APInt arg as const reference. NFCI. · 4597bfdd
      Simon Pilgrim authored
      Avoids unnecessary APInt copies and silences clang tidy warning.
      4597bfdd
    • Sam Elliott's avatar
      [RISCV] Avoid Splitting MBB in RISCVExpandPseudo · 97106f9d
      Sam Elliott authored
      Since the `RISCVExpandPseudo` pass has been split from
      `RISCVExpandAtomicPseudo` pass, it would be nice to run the former as
      early as possible (The latter has to be run as late as possible to
      ensure correctness). Running earlier means we can reschedule these pairs
      as we see fit.
      
      Running earlier in the machine pass pipeline is good, but would mean
      teaching many more passes about `hasLabelMustBeEmitted`. Splitting the
      basic blocks also pessimises possible optimisations because some
      optimisations are MBB-local, and others are disabled if the block has
      its address taken (which is notionally what `hasLabelMustBeEmitted`
      means).
      
      This patch uses a new approach of setting the pre-instruction symbol on
      the AUIPC instruction to a temporary symbol and referencing that. This
      avoids splitting the basic block, but allows us to reference exactly the
      instruction that we need to. Notionally, this approach seems more
      correct because we do actually want to address a specific instruction.
      
      This then allows the pass to be moved much earlier in the pass pipeline,
      before both scheduling and register allocation. However, to do so we
      must leave the MIR in SSA form (by not redefining registers), and so use
      a virtual register for the intermediate value. By using this virtual
      register, this pass now has to come before register allocation.
      
      Reviewed By: luismarques, asb
      
      Differential Revision: https://reviews.llvm.org/D82988
      97106f9d
    • dfukalov's avatar
      SpeculativeExecution: Fix for logic change introduced in D81730. · 167767a7
      dfukalov authored
      Summary:
      The test case started to hoist bitcasts to upper BB after D81730.
      Reverted unintentional logic change. Some instructions may have zero cost but
      will not be hoisted by different limitation so should be counted for threshold.
      
      Reviewers: aprantl, arsenm, nhaehnle
      
      Reviewed By: aprantl
      
      Subscribers: wdng, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D82761
      167767a7
    • Benjamin Kramer's avatar
      [DebugInfo] Fix pessimizing move. NFC. · d36b8414
      Benjamin Kramer authored
      DWARFDebugPubTable.cpp:80:31: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
      d36b8414
    • Igor Kudrin's avatar
      [DebugInfo] Add more checks to parsing .debug_pub* sections. · ca4d8da0
      Igor Kudrin authored
      The patch adds checking for various potential issues in parsing name
      lookup tables and reporting them as recoverable errors, similarly as we
      do for other tables.
      
      Differential Revision: https://reviews.llvm.org/D83050
      ca4d8da0
    • Igor Kudrin's avatar
      [DebugInfo] Do not hang when parsing a malformed .debug_pub* section. · 68f5a8b2
      Igor Kudrin authored
      The parsing method did not check reading errors and might easily fall
      into an infinite loop on an invalid input because of that.
      
      Differential Revision: https://reviews.llvm.org/D83049
      68f5a8b2