1. Jun 17, 2019
  2. Jun 16, 2019
  3. Jun 15, 2019
    • Aaron Puchert's avatar
      [Clang] Harmonize Split DWARF options with llc · e1dc495e
      Aaron Puchert authored
      Summary:
      With Split DWARF the resulting object file (then called skeleton CU)
      contains the file name of another ("DWO") file with the debug info.
      This can be a problem for remote compilation, as it will contain the
      name of the file on the compilation server, not on the client.
      
      To use Split DWARF with remote compilation, one needs to either
      
      * make sure only relative paths are used, and mirror the build directory
        structure of the client on the server,
      * inject the desired file name on the client directly.
      
      Since llc already supports the latter solution, we're just copying that
      over. We allow setting the actual output filename separately from the
      value of the DW_AT_[GNU_]dwo_name attribute in the skeleton CU.
      
      Fixes PR40276.
      
      Reviewers: dblaikie, echristo, tejohnson
      
      Reviewed By: dblaikie
      
      Differential Revision: https://reviews.llvm.org/D59673
      
      llvm-svn: 363496
      e1dc495e
    • Kang Zhang's avatar
      [PowerPC] Set the innermost hot loop to align 32 bytes · 2d51adcb
      Kang Zhang authored
      Summary:
      If the nested loop is an innermost loop, prefer to a 32-byte alignment, so that
      we can decrease cache misses and branch-prediction misses. Actual alignment of
       the loop will depend on the hotness check and other logic in alignBlocks.
      
      The old code will only align hot loop to 32 bytes when the LoopSize larger than
      16 bytes and smaller than 32 bytes, this patch will align the innermost hot loop
       to 32 bytes not only for the hot loop whose size is 16~32 bytes.
      
      Reviewed By: steven.zhang, jsji
      
      Differential Revision: https://reviews.llvm.org/D61228
      
      llvm-svn: 363495
      2d51adcb
    • Aaron Puchert's avatar
      [Clang] Rename -split-dwarf-file to -split-dwarf-output · 922759a6
      Aaron Puchert authored
      Summary:
      This is the first in a series of changes trying to align clang -cc1
      flags for Split DWARF with those of llc. The unfortunate side effect of
      having -split-dwarf-output for single file Split DWARF will disappear
      again in a subsequent change.
      
      The change is the result of a discussion in D59673.
      
      Reviewers: dblaikie, echristo
      
      Reviewed By: dblaikie
      
      Differential Revision: https://reviews.llvm.org/D63130
      
      llvm-svn: 363494
      922759a6
    • Gauthier Harnisch's avatar
      [clang] Add storage for APValue in ConstantExpr · 83c7b610
      Gauthier Harnisch authored
      Summary:
      When using ConstantExpr we often need the result of the expression to be kept in the AST. Currently this is done on a by the node that needs the result and has been done multiple times for enumerator, for constexpr variables... . This patch adds to ConstantExpr the ability to store the result of evaluating the expression. no functional changes expected.
      
      Changes:
       - Add trailling object to ConstantExpr that can hold an APValue or an uint64_t. the uint64_t is here because most ConstantExpr yield integral values so there is an optimized layout for integral values.
       - Add basic* serialization support for the trailing result.
       - Move conversion functions from an enum to a fltSemantics from clang::FloatingLiteral to llvm::APFloatBase. this change is to make it usable for serializing APValues.
       - Add basic* Import support for the trailing result.
       - ConstantExpr created in CheckConvertedConstantExpression now stores the result in the ConstantExpr Node.
       - Adapt AST dump to print the result when present.
      
      basic* : None, Indeterminate, Int, Float, FixedPoint, ComplexInt, ComplexFloat,
      the result is not yet used anywhere but for -ast-dump.
      
      Reviewers: rsmith, martong, shafik
      
      Reviewed By: rsmith
      
      Subscribers: rnkovacs, hiraditya, dexonsmith, cfe-commits, llvm-commits
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D62399
      
      llvm-svn: 363493
      83c7b610
    • Fangrui Song's avatar
      [BranchProbability] Delete a redundant overflow check · b6dc09e7
      Fangrui Song authored
      llvm-svn: 363492
      b6dc09e7
    • Csaba Dabis's avatar
      [analyzer] ReturnVisitor: Bypass everything to see inlined calls · 077f13c6
      Csaba Dabis authored
      Summary:
      When we traversed backwards on ExplodedNodes to see where processed the
      given statement we `break` too early. With the current approach we do not
      miss the CallExitEnd ProgramPoint which stands for an inlined call.
      
      Reviewers: NoQ, xazax.hun, ravikandhadai, baloghadamsoftware, Szelethus
      
      Reviewed By: NoQ
      
      Subscribers: szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy,
                   dkrupp, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D62926
      
      llvm-svn: 363491
      077f13c6
    • Nikita Popov's avatar
      [SCEV] Use unsigned/signed intersection type in SCEV · 8550fb38
      Nikita Popov authored
      Based on D59959, this switches SCEV to use unsigned/signed range
      intersection based on the sign hint. This will prefer non-wrapping
      ranges in the relevant domain. I've left the one intersection in
      getRangeForAffineAR() to use the smallest intersection heuristic,
      as there doesn't seem to be any obvious preference there.
      
      Differential Revision: https://reviews.llvm.org/D60035
      
      llvm-svn: 363490
      8550fb38
    • Nikita Popov's avatar
      [SimplifyIndVar] Simplify non-overflowing saturating add/sub · 9145562b
      Nikita Popov authored
      If we can detect that saturating math that depends on an IV cannot
      overflow, replace it with simple math. This is similar to the CVP
      optimization from D62703, just based on a different underlying
      analysis (SCEV vs LVI) that catches different cases.
      
      Differential Revision: https://reviews.llvm.org/D62792
      
      llvm-svn: 363489
      9145562b
    • Gauthier Harnisch's avatar
      [clang] perform semantic checking in constant context · 0bb4d46b
      Gauthier Harnisch authored
      Summary:
      Since the addition of __builtin_is_constant_evaluated the result of an expression can change based on whether it is evaluated in constant context. a lot of semantic checking performs evaluations with out specifying context. which can lead to wrong diagnostics.
      for example:
      ```
      constexpr int i0 = (long long)__builtin_is_constant_evaluated() * (1ll << 33); //#1
      constexpr int i1 = (long long)!__builtin_is_constant_evaluated() * (1ll << 33); //#2
      ```
      before the patch, #2 was diagnosed incorrectly and #1 wasn't diagnosed.
      after the patch #1 is diagnosed as it should and #2 isn't.
      
      Changes:
       - add a flag to Sema to passe in constant context mode.
       - in SemaChecking.cpp calls to Expr::Evaluate* are now done in constant context when they should.
       - in SemaChecking.cpp diagnostics for UB are not checked for in constant context because an error will be emitted by the constant evaluator.
       - in SemaChecking.cpp diagnostics for construct that cannot appear in constant context are not checked for in constant context.
       - in SemaChecking.cpp diagnostics on constant expression are always emitted because constant expression are always evaluated.
       - semantic checking for initialization of constexpr variables is now done in constant context.
       - adapt test that were depending on warning changes.
       - add test.
      
      Reviewers: rsmith
      
      Reviewed By: rsmith
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D62009
      
      llvm-svn: 363488
      0bb4d46b
    • Fangrui Song's avatar
      [RISCV] Regenerate remat.ll and atomic-rmw.ll after D43256 · e1aa69f7
      Fangrui Song authored
      llvm-svn: 363487
      e1aa69f7
    • Fangrui Song's avatar
      [RISCV] Simplify RISCVAsmBackend::writeNopData(). NFC · 44cc4e93
      Fangrui Song authored
      llvm-svn: 363486
      44cc4e93
    • Alex Brachet's avatar
      [objcopy] Error when --preserve-dates is specified with standard streams · 899a3072
      Alex Brachet authored
      Summary: llvm-objcopy/strip now error when -p is specified when reading from stdin or writing to stdout
      
      Reviewers: jhenderson, rupprecht, espindola, alexshap
      
      Reviewed By: jhenderson, rupprecht
      
      Subscribers: emaste, arichardson, jakehehrlich, MaskRay, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D63090
      
      llvm-svn: 363485
      899a3072
    • Michael Berg's avatar
      adding more fmf propagation for selects plus updated tests · ad6bb86b
      Michael Berg authored
      llvm-svn: 363484
      ad6bb86b
    • Shoaib Meenai's avatar
      [compiler-rt] Respect CMAKE_NM · 744870f4
      Shoaib Meenai authored
      The default nm executable may not be able to handle the architecture
      we're building the sanitizers for. Respect CMAKE_NM if it's set to
      ensure we're using the correct nm tool. Preserve the existing NM
      environment variable override to not break its users.
      
      Differential Revision: https://reviews.llvm.org/D63368
      
      llvm-svn: 363483
      744870f4
    • Fangrui Song's avatar
      Revert "adding more fmf propagation for selects plus tests" · 968b5f84
      Fangrui Song authored
      This reverts rL363474. -debug-only=isel was added to some tests that
      don't specify `REQUIRES: asserts`. This causes failures on
      -DLLVM_ENABLE_ASSERTIONS=off builds.
      
      I chose to revert instead of fixing the tests because I'm not sure
      whether we should add `REQUIRES: asserts` to more tests.
      
      llvm-svn: 363482
      968b5f84
    • Nathan Ridge's avatar
      [clangd] Index API and implementations for relations · f1e6f571
      Nathan Ridge authored
      Summary:
      This builds on the relations support added in D59407, D62459,
      and D62471 to expose relations in SymbolIndex and its
      implementations.
      
      Reviewers: kadircet
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D62839
      
      llvm-svn: 363481
      f1e6f571
    • Vitaly Buka's avatar
      Improve error message when '=' is missing in {ASAN,...}_OPTIONS. · 0b1ea8cb
      Vitaly Buka authored
      Summary:
      It's handling isses as described here:
      https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89832
      
      Patch by Martin Liška.
      
      Reviewers: kcc, vitalybuka
      
      Reviewed By: vitalybuka
      
      Subscribers: cryptoad, kubamracek
      
      Differential Revision: https://reviews.llvm.org/D59876
      
      llvm-svn: 363480
      0b1ea8cb
    • Huihui Zhang's avatar
      [InstCombine] Add tests to show missing fold opportunity for "icmp and shift" (nfc). · dc2fd6a1
      Huihui Zhang authored
      Summary:
      For icmp pred (and (sh X, Y), C), 0
      
        When C is signbit, expect to fold (X << Y) & signbit ==/!= 0 into (X << Y) >=/< 0,
        rather than (X & (signbit >> Y)) != 0.
      
        When C+1 is power of 2, expect to fold (X << Y) & ~C ==/!= 0 into (X << Y) </>= C+1,
        rather than (X & (~C >> Y)) == 0.
      
      For icmp pred (and X, (sh signbit, Y)), 0
      
        Expect to fold (X & (signbit l>> Y)) ==/!= 0 into (X << Y) >=/< 0
        Expect to fold (X & (signbit << Y)) ==/!= 0 into (X l>> Y) >=/< 0
      
        Reviewers: lebedev.ri, efriedma, spatel, craig.topper
      
        Reviewed By: lebedev.ri
      
        Subscribers: llvm-commits
      
        Tags: #llvm
      
        Differential Revision: https://reviews.llvm.org/D63025
      
      llvm-svn: 363479
      dc2fd6a1
    • Matt Arsenault's avatar
      Reapply "GlobalISel: Avoid producing Illegal copies in RegBankSelect" · 94872780
      Matt Arsenault authored
      This reapplies r363410, avoiding null dereference if there is no
      AltRegBank.
      
      llvm-svn: 363478
      94872780
    • Richard Smith's avatar
      Add a map_range function for applying map_iterator to a range. · dda35972
      Richard Smith authored
      In preparation for use in Clang.
      
      llvm-svn: 363477
      dda35972
    • Mitch Phillips's avatar
      Revert "GlobalISel: Avoid producing Illegal copies in RegBankSelect" · 0d44f129
      Mitch Phillips authored
      This patch breaks UBSan build bots. See
      https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild for
      a guide as to how to reproduce the error.
      
      This reverts commit c2864c0d.
      This reverts rL363410.
      
      llvm-svn: 363476
      0d44f129