1. Aug 01, 2018
  2. Jul 31, 2018
    • Jakub Kuderski's avatar
      [Dominators] Make slow walks shorter · 3ae770aa
      Jakub Kuderski authored
      Summary:
      When DFS numbers are not yet calculated for a dominator tree, we have to walk it up to say whether one node dominates some other.
      
      This patch makes the slow walks shorter by only walking until the level of the node we check against is reached. This is because a node cannot possibly dominate something higher in its tree.
      
      When running opt with -O3, the patch results in:
      * 25% fewer loop iterations for `opt` (fullLTO)
      * 30% fewer loop iterations for sqlite
      
      Reviewers: brzycki, asbirlea, chandlerc, NutshellySima, grosser
      
      Reviewed By: NutshellySima
      
      Subscribers: mehdi_amini, dexonsmith, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D49955
      
      llvm-svn: 338396
      3ae770aa
    • Ewan Crawford's avatar
      Fix InstCombine address space assert · d83beb80
      Ewan Crawford authored
      Workaround bug where the InstCombine pass was asserting on the IR added in lit
      test, where we have a bitcast instruction after a GEP from an addrspace cast.
      
      The second bitcast in the test was getting combined into
      `bitcast <16 x i32>* %0 to <16 x i32> addrspace(3)*`, which looks like it should
      be an addrspace cast instruction instead. Otherwise if control flow is allowed
      to continue as it is now we create a GEP instruction
      `<badref> = getelementptr inbounds <16 x i32>, <16 x i32>* %0, i32 0`. However
      because the type of this instruction doesn't match the address space we hit an
      assert when replacing the bitcast with that GEP.
      
      ```
      void llvm::Value::doRAUW(llvm::Value*, bool): Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed.
      ```
      
      Differential Revision: https://reviews.llvm.org/D50058
      
      llvm-svn: 338395
      d83beb80
    • Andrea Di Biagio's avatar
      [llvm-mca][docs] Always use `llvm-mca` in place of `MCA`. · bdcf6ad6
      Andrea Di Biagio authored
      llvm-svn: 338394
      bdcf6ad6
    • Jonas Toth's avatar
      [clang-tidy] add all clang-tidy modules to plugin · 0b8fdd28
      Jonas Toth authored
      Summary:
      This patch addresses PR38359 and adds all existing clang-tidy
      modules to the plugin that can be used together with libclang.
      
      Reviewers: alexfh, aaron.ballman, hokein, ilya-biryukov
      
      Reviewed By: alexfh
      
      Subscribers: srhines, mgorny, xazax.hun, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D50060
      
      llvm-svn: 338393
      0b8fdd28
    • Sanjay Patel's avatar
      [InstCombine] regenerate checks and add tests for D50035; NFC · a35781fd
      Sanjay Patel authored
      llvm-svn: 338392
      a35781fd
    • Anastasis Grammenos's avatar
      [DebugInfo][LCSSA] Preserve debug location in lcssa phis · ac3f8028
      Anastasis Grammenos authored
      Summary:
      When inserting lcssa Phi Nodes in the exit block
      mak sure to preserve the original instructions DL.
      
      Reviewers: vsk
      
      Subscribers: JDevlieghere, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D50009
      
      llvm-svn: 338391
      ac3f8028
    • Hsiangkai Wang's avatar
      [DebugInfo] Generate DWARF debug information for labels. · cbc58ada
      Hsiangkai Wang authored
      There are two forms for label debug information in DWARF format.
      
      1. Labels in a non-inlined function:
      
      DW_TAG_label
        DW_AT_name
        DW_AT_decl_file
        DW_AT_decl_line
        DW_AT_low_pc
      
      2. Labels in an inlined function:
      
      DW_TAG_label
        DW_AT_abstract_origin
        DW_AT_low_pc
      
      We will collect label information from DBG_LABEL. Before every DBG_LABEL,
      we will generate a temporary symbol to denote the location of the label.
      The symbol could be used to get DW_AT_low_pc afterwards. So, we create a
      mapping between 'inlined label' and DBG_LABEL MachineInstr in DebugHandlerBase.
      The DBG_LABEL in the mapping is used to query the symbol before it.
      
      The AbstractLabels in DwarfCompileUnit is used to process labels in inlined
      functions.
      
      We also keep a mapping between scope and labels in DwarfFile to help to
      generate correct tree structure of DIEs.
      
      It also generates label debug information under global isel.
      
      Differential Revision: https://reviews.llvm.org/D45556
      
      llvm-svn: 338390
      cbc58ada
    • David Bolvansky's avatar
      Revert Enrich inline messages · ab79414f
      David Bolvansky authored
      llvm-svn: 338389
      ab79414f
    • Sanjay Patel's avatar
      [InstCombine] auto-generate checks; NFC · 57d617d6
      Sanjay Patel authored
      llvm-svn: 338388
      57d617d6
    • David Bolvansky's avatar
      Enrich inline messages · b562dbab
      David Bolvansky authored
      Summary:
      This patch improves Inliner to provide causes/reasons for negative inline decisions.
      1. It adds one new message field to InlineCost to report causes for Always and Never instances. All Never and Always instantiations must provide a simple message.
      2. Several functions that used to return the inlining results as boolean are changed to return InlineResult which carries the cause for negative decision.
      3. Changed remark priniting and debug output messages to provide the additional messages and related inline cost.
      4. Adjusted tests for changed printing.
      
      Patch by: yrouban (Yevgeny Rouban)
      
      
      Reviewers: craig.topper, sammccall, sgraenitz, NutshellySima, shchenz, chandlerc, apilipenko, javed.absar, tejohnson, dblaikie, sanjoy, eraman, xbolva00
      
      Reviewed By: tejohnson, xbolva00
      
      Subscribers: xbolva00, llvm-commits, arsenm, mehdi_amini, eraman, haicheng, steven_wu, dexonsmith
      
      Differential Revision: https://reviews.llvm.org/D49412
      
      llvm-svn: 338387
      b562dbab
    • Andrea Di Biagio's avatar
      [llvm-mca] Remove README.txt · 4a31bcff
      Andrea Di Biagio authored
      A detailed description of the tool has been recently added by Matt to
      CommandGuide/llvm-mca.rst. File README.txt is now redundant and can be removed;
      all the relevant user-guide information has been improved and then moved to
      llvm-mca.rst.
      
      In future, we should add another .rst for the "llvm-mca developer manual" to
      provide infromation about:
       - llvm-mca internals.
       - How to add custom stages to the simulated pipeline.
       - How to provide extra processor info in the scheduling model to improve the
         analysis performed by llvm-mca.
      
      llvm-svn: 338386
      4a31bcff
    • David Bolvansky's avatar
      [RISCV] Add driver for riscv32-unknown-elf baremetal target · f4be2535
      David Bolvansky authored
      Summary:
      This patch adds a driver for the baremetal RISC-V target (i.e. riscv32-unknown-elf). For reference, D39963 added basic target info and added support for riscv32-linux-unknown-elf.
      
      Patch by: asb (Alex Bradbury)
      
      Reviewers: efriedma, phosek, apazos, espindola, mgrang
      
      Reviewed By: mgrang
      
      Subscribers: jrtc27, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, emaste, mgorny, arichardson, rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, mgrang, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D46822
      
      llvm-svn: 338385
      f4be2535
    • John Brawn's avatar
      [MemDep] Use PhiValuesAnalysis to improve alias analysis results · cd5f37f3
      John Brawn authored
      This is being done in order to make GVN able to better optimize certain inputs.
      MemDep doesn't use PhiValues directly, but does need to notifiy it when things
      get invalidated.
      
      Differential Revision: https://reviews.llvm.org/D48489
      
      llvm-svn: 338384
      cd5f37f3
    • David Bolvansky's avatar
      [InstSimplify] Fold another Select with And/Or pattern · 16d8a69b
      David Bolvansky authored
      Summary: Proof: https://rise4fun.com/Alive/L5J
      
      Reviewers: lebedev.ri, spatel
      
      Reviewed By: spatel
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D49975
      
      llvm-svn: 338383
      16d8a69b
    • Matt Arsenault's avatar
      DAG: Fix PromoteFloatResult for fcanonicalize · a5ed0321
      Matt Arsenault authored
      llvm-svn: 338382
      a5ed0321
    • Matt Arsenault's avatar
      AMDGPU: Don't handle FP16_TO_FP in isCanonicalized · 638a2027
      Matt Arsenault authored
      This needs more special handling to do correctly.
      Fixes test in subsequent commit.
      
      llvm-svn: 338381
      638a2027
    • Alexey Bataev's avatar
      [SLP] Fix PR38339: Instruction does not dominate all uses! · c0c3a6ed
      Alexey Bataev authored
      Summary:
      If the ExtractElement instructions can be optimized out during the
      vectorization and we need to reshuffle the parent vector, this
      ShuffleInstruction may be inserted in the wrong place causing compiler
      to produce incorrect code.
      
      Reviewers: spatel, RKSimon, mkuper, hfinkel, javed.absar
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D49928
      
      llvm-svn: 338380
      c0c3a6ed
    • George Rimar's avatar
      [LLD][ELF] - ICF: Check we do not fold sections which relocations reffering to... · 7a49ce4a
      George Rimar authored
      [LLD][ELF] - ICF: Check we do not fold sections which relocations reffering to absolute symbols with a different values.
      
      This adds a test for the following uncovered piece of code:
      https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L263
      
      Without that lines we would crash.
      
      llvm-svn: 338379
      7a49ce4a
    • Ilya Biryukov's avatar
      [clangd] Do not build AST if no diagnostics were requested · ec9bd36f
      Ilya Biryukov authored
      Summary:
      It can be removed from the cache before the first access anyway, so
      building it can be a waste of time.
      
      Reviewers: ioeric
      
      Reviewed By: ioeric
      
      Subscribers: javed.absar, MaskRay, jkorous, arphaman, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D49991
      
      llvm-svn: 338378
      ec9bd36f
    • Peter Smith's avatar
      [ELF][ARM] Implement support for Tag_ABI_VFP_args · 70997f9a
      Peter Smith authored
      The Tag_ABI_VFP_args build attribute controls the procedure call standard
      used for floating point parameters on ARM. The values are:
      0 - Base AAPCS (FP Parameters passed in Core (Integer) registers
      1 - VFP AAPCS (FP Parameters passed in FP registers)
      2 - Toolchain specific (Neither Base or VFP)
      3 - Compatible with all (No use of floating point parameters)
      
      If the Tag_ABI_VFP_args build attribute is missing it has an implicit value
      of 0.
          
      We use the attribute in two ways:
      - Detect a clash in calling convention between Base, VFP and Toolchain.
      we follow ld.bfd's lead and do not error if there is a clash between an
      implicit Base AAPCS caused by a missing attribute. Many projects
      including the hard-float (VFP AAPCS) version of glibc contain assembler
      files that do not use floating point but do not have Tag_ABI_VFP_args.
      - Set the EF_ARM_ABI_FLOAT_SOFT or EF_ARM_ABI_FLOAT_HARD ELF header flag
      for Base or VFP AAPCS respectively. This flag is used by some ELF
      loaders.
          
      References:
      - Addenda to, and Errata in, the ABI for the ARM Architecture for
      Tag_ABI_VFP_args
      - Elf for the ARM Architecture for ELF header flags
          
      Fixes PR36009
          
      Differential Revision: https://reviews.llvm.org/D49993
      
      llvm-svn: 338377
      70997f9a
    • Matt Arsenault's avatar
      AMDGPU: Fold undef fcanonicalize to qNaN · 4aec86d3
      Matt Arsenault authored
      We could choose a free 0 for this, but this
      matches the behavior for fmul undef, 1.0. Also,
      the NaN use is more useful for folding use operations
      although if it's not eliminated it is more expensive
      in terms of code size.
      
      llvm-svn: 338376
      4aec86d3
    • George Rimar's avatar
      [LLD][ELF] - ICF: add test case testing we do not fold sections with the different flags. NFCI. · 511fed8a
      George Rimar authored
      Previously the following condition was not tested at all:
      https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L300
      
      Patch adds a test for `A->Flags != B->Flags` part.
      
      llvm-svn: 338375
      511fed8a
    • Matt Arsenault's avatar
      AMDGPU: Fix test check line bugs · c1335eaf
      Matt Arsenault authored
      llvm-svn: 338374
      c1335eaf
    • Peter Smith's avatar
      [ARM] Complete enumeration values for Tag_ABI_VFP_args · 08b54bb4
      Peter Smith authored
      The LLD implementation of Tag_ABI_VFP_args needs to check the rarely seen
      values of 3 (toolchain specific) and 4 compatible with both Base and VFP.
      Add the missing enumeration values so that LLD can refer to them without
      having to use the raw numbers.
      
      Differential Revision: https://reviews.llvm.org/D50049
      
      llvm-svn: 338373
      08b54bb4
    • Andrea Di Biagio's avatar
      [llvm-mca][BtVer2] Teach how to identify dependency-breaking idioms. · a1852b61
      Andrea Di Biagio authored
      This patch teaches llvm-mca how to identify dependency breaking instructions on
      btver2.
      
      An example of dependency breaking instructions is the zero-idiom XOR (example:
      `XOR %eax, %eax`), which always generates zero regardless of the actual value of
      the input register operands.
      Dependency breaking instructions don't have to wait on their input register
      operands before executing. This is because the computation is not dependent on
      the inputs.
      
      Not all dependency breaking idioms are also zero-latency instructions. For
      example, `CMPEQ %xmm1, %xmm1` is independent on
      the value of XMM1, and it generates a vector of all-ones.
      That instruction is not eliminated at register renaming stage, and its opcode is
      issued to a pipeline for execution. So, the latency is not zero. 
      
      This patch adds a new method named isDependencyBreaking() to the MCInstrAnalysis
      interface. That method takes as input an instruction (i.e. MCInst) and a
      MCSubtargetInfo.
      The default implementation of isDependencyBreaking() conservatively returns
      false for all instructions. Targets may override the default behavior for
      specific CPUs, and return a value which better matches the subtarget behavior.
      
      In future, we should teach to Tablegen how to automatically generate the body of
      isDependencyBreaking from scheduling predicate definitions. This would allow us
      to expose the knowledge about dependency breaking instructions to the machine
      schedulers (and, potentially, other codegen passes).
      
      Differential Revision: https://reviews.llvm.org/D49310
      
      llvm-svn: 338372
      a1852b61
    • Tim Northover's avatar
      [debuginfo-tests] tweak new test to be compatible with wider range of compilers. · c5018d46
      Tim Northover authored
      emplace_back was added in C++11, and its usage isn't critical to what's being
      tested so using push_back instead will allow this test to work with more
      compilers.
      
      llvm-svn: 338371
      c5018d46
    • Peter Smith's avatar
      [ELF][ARM] Add Arm ABI names for float ABI ELF Header flags · d9e74901
      Peter Smith authored
      The ELF for the Arm architecture document defines, for EF_ARM_EABI_VER5 and
      above, the flags EF_ARM_ABI_FLOAT_HARD and EF_ARM_ABI_FLOAT_SOFT. These
      have been defined to be compatible with the existing EF_ARM_VFP_FLOAT and
      EF_ARM_SOFT_FLOAT used by gcc for EF_ARM_EABI_UNKNOWN.
      
      This patch adds the flags in addition to the existing ones so that any code
      depending on the old names will still work.
      
      Differential Revision: https://reviews.llvm.org/D49992
      
      llvm-svn: 338370
      d9e74901
    • Simon Pilgrim's avatar
      Revert r338365: [X86] Improved sched models for X86 BT*rr instructions. · 0aa28675
      Simon Pilgrim authored
      https://reviews.llvm.org/D49243
      
      Contains WIP code that should not have been included.
      
      llvm-svn: 338369
      0aa28675
    • Jonas Paulsson's avatar
      [SystemZ] Improve decoding in case of instructions with four register operands. · 2f12e45d
      Jonas Paulsson authored
      Since z13, the max group size will be 2 if any μop has more than 3 register
      sources.
      
      This has been ignored sofar in the SystemZHazardRecognizer, but is now
      handled by recognizing those instructions and adjusting the tracking of
      decoding and the cost heuristic for grouping.
      
      Review: Ulrich Weigand
      https://reviews.llvm.org/D49847
      
      llvm-svn: 338368
      2f12e45d
    • Sanjay Patel's avatar
      [InstCombine] simplify code for A & (A ^ B) --> A & ~B · 9a801cb5
      Sanjay Patel authored
      This fold was written in an odd way and tried to avoid
      an endless loop by bailing out on all constants instead
      of the supposedly problematic case of -1. But (X & -1) 
      should always be simplified before we reach here, so I'm
      not sure how that is a problem.
      
      There were no tests for the commuted patterns, so I added
      those at rL338364.
      
      llvm-svn: 338367
      9a801cb5
    • Hans Wennborg's avatar
      clang-format: try to make the doc for ConstructorInitializerAllOnOneLineOrOnePerLine more clear · a592adbb
      Hans Wennborg authored
      PR38080 complained that the "OnePerLine" case wasn't previously shown.
      
      llvm-svn: 338366
      a592adbb
    • Andrew V. Tischenko's avatar
    • Sanjay Patel's avatar
      [InstCombine] move/add tests for xor+add fold; NFC · 995138ce
      Sanjay Patel authored
      llvm-svn: 338364
      995138ce
    • Hans Wennborg's avatar
      windows_support.rst: Add links for downloading · 1cc3f51b
      Hans Wennborg authored
      llvm-svn: 338363
      1cc3f51b
    • Hans Wennborg's avatar
      index.rst: pe/coff does support pdbs now · c7792a6c
      Hans Wennborg authored
      llvm-svn: 338362
      c7792a6c
    • Ilya Biryukov's avatar
      [clangd] Report diagnostics even if WantDiags::No AST was reused · 442c2832
      Ilya Biryukov authored
      Summary:
      After r338256, clangd stopped reporting diagnostics if WantDiags::No request
      is followed by a WantDiags::Yes request but the AST can be reused.
      
      Reviewers: ioeric
      
      Reviewed By: ioeric
      
      Subscribers: javed.absar, MaskRay, jkorous, arphaman, jfb, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D50045
      
      llvm-svn: 338361
      442c2832