OSDN Git Service

In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled.
authorNirav Dave <niravd@google.com>
Sat, 25 Feb 2017 11:43:58 +0000 (11:43 +0000)
committerNirav Dave <niravd@google.com>
Sat, 25 Feb 2017 11:43:58 +0000 (11:43 +0000)
commit32147cef642e471eaeca4859fca4694726757f33
tree96ca6be477c3532be9690d3bf6be202a519a64f0
parent79b977862eeca03514ecfd4f96050f2894fdb7fb
In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled.

    Recommiting after fixup of 32-bit aliasing sign offset bug in DAGCombiner.

    * Simplify Consecutive Merge Store Candidate Search

    Now that address aliasing is much less conservative, push through
    simplified store merging search and chain alias analysis which only
    checks for parallel stores through the chain subgraph. This is cleaner
    as the separation of non-interfering loads/stores from the
    store-merging logic.

    When merging stores search up the chain through a single load, and
    finds all possible stores by looking down from through a load and a
    TokenFactor to all stores visited.

    This improves the quality of the output SelectionDAG and the output
    Codegen (save perhaps for some ARM cases where we correctly constructs
    wider loads, but then promotes them to float operations which appear
    but requires more expensive constant generation).

    Some minor peephole optimizations to deal with improved SubDAG shapes (listed below)

    Additional Minor Changes:

      1. Finishes removing unused AliasLoad code

      2. Unifies the chain aggregation in the merged stores across code
         paths

      3. Re-add the Store node to the worklist after calling
         SimplifyDemandedBits.

      4. Increase GatherAllAliasesMaxDepth from 6 to 18. That number is
         arbitrary, but seems sufficient to not cause regressions in
         tests.

      5. Remove Chain dependencies of Memory operations on CopyfromReg
         nodes as these are captured by data dependence

      6. Forward loads-store values through tokenfactors containing
          {CopyToReg,CopyFromReg} Values.

      7. Peephole to convert buildvector of extract_vector_elt to
         extract_subvector if possible (see
         CodeGen/AArch64/store-merge.ll)

      8. Store merging for the ARM target is restricted to 32-bit as
         some in some contexts invalid 64-bit operations are being
         generated. This can be removed once appropriate checks are
         added.

    This finishes the change Matt Arsenault started in r246307 and
    jyknight's original patch.

    Many tests required some changes as memory operations are now
    reorderable, improving load-store forwarding. One test in
    particular is worth noting:

      CodeGen/PowerPC/ppc64-align-long-double.ll - Improved load-store
      forwarding converts a load-store pair into a parallel store and
      a memory-realized bitcast of the same value. However, because we
      lose the sharing of the explicit and implicit store values we
      must create another local store. A similar transformation
      happens before SelectionDAG as well.

    Reviewers: arsenm, hfinkel, tstellarAMD, jyknight, nhaehnle

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296252 91177308-0d34-0410-b5e6-96231b3b80d8
74 files changed:
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/TargetLoweringBase.cpp
lib/Target/AArch64/AArch64ISelLowering.cpp
lib/Target/ARM/ARMISelLowering.h
test/CodeGen/AArch64/argument-blocks.ll
test/CodeGen/AArch64/arm64-abi.ll
test/CodeGen/AArch64/arm64-memset-inline.ll
test/CodeGen/AArch64/arm64-variadic-aapcs.ll
test/CodeGen/AArch64/merge-store.ll
test/CodeGen/AArch64/vector_merge_dep_check.ll
test/CodeGen/AMDGPU/debugger-insert-nops.ll
test/CodeGen/AMDGPU/insert_vector_elt.ll
test/CodeGen/AMDGPU/merge-stores.ll
test/CodeGen/AMDGPU/private-element-size.ll
test/CodeGen/AMDGPU/si-triv-disjoint-mem-access.ll
test/CodeGen/ARM/2012-10-04-AAPCS-byval-align8.ll
test/CodeGen/ARM/alloc-no-stack-realign.ll
test/CodeGen/ARM/gpr-paired-spill.ll
test/CodeGen/ARM/ifcvt10.ll
test/CodeGen/ARM/illegal-bitfield-loadstore.ll
test/CodeGen/ARM/static-addr-hoisting.ll
test/CodeGen/BPF/undef.ll
test/CodeGen/MSP430/Inst16mm.ll
test/CodeGen/Mips/cconv/arguments-float.ll
test/CodeGen/Mips/cconv/arguments-varargs.ll
test/CodeGen/Mips/fastcc.ll
test/CodeGen/Mips/load-store-left-right.ll
test/CodeGen/Mips/micromips-li.ll
test/CodeGen/Mips/mips64-f128-call.ll
test/CodeGen/Mips/mips64-f128.ll
test/CodeGen/Mips/mno-ldc1-sdc1.ll
test/CodeGen/Mips/msa/f16-llvm-ir.ll
test/CodeGen/Mips/msa/i5_ld_st.ll
test/CodeGen/Mips/o32_cc_byval.ll
test/CodeGen/Mips/o32_cc_vararg.ll
test/CodeGen/PowerPC/anon_aggr.ll
test/CodeGen/PowerPC/complex-return.ll
test/CodeGen/PowerPC/jaggedstructs.ll
test/CodeGen/PowerPC/ppc64-align-long-double.ll
test/CodeGen/PowerPC/structsinmem.ll
test/CodeGen/PowerPC/structsinregs.ll
test/CodeGen/SystemZ/unaligned-01.ll
test/CodeGen/Thumb/2010-07-15-debugOrdering.ll
test/CodeGen/Thumb/stack-access.ll
test/CodeGen/X86/2010-09-17-SideEffectsInChain.ll
test/CodeGen/X86/2012-11-28-merge-store-alias.ll
test/CodeGen/X86/MergeConsecutiveStores.ll
test/CodeGen/X86/avx512-mask-op.ll
test/CodeGen/X86/chain_order.ll
test/CodeGen/X86/clear_upper_vector_element_bits.ll
test/CodeGen/X86/combiner-aa-0.ll [deleted file]
test/CodeGen/X86/combiner-aa-1.ll [deleted file]
test/CodeGen/X86/copy-eflags.ll
test/CodeGen/X86/dag-merge-fast-accesses.ll
test/CodeGen/X86/dont-trunc-store-double-to-float.ll
test/CodeGen/X86/extractelement-legalization-store-ordering.ll
test/CodeGen/X86/i256-add.ll
test/CodeGen/X86/i386-shrink-wrapping.ll
test/CodeGen/X86/illegal-bitfield-loadstore.ll
test/CodeGen/X86/live-range-nosubreg.ll
test/CodeGen/X86/longlong-deadload.ll
test/CodeGen/X86/merge-consecutive-loads-128.ll
test/CodeGen/X86/merge-consecutive-loads-256.ll
test/CodeGen/X86/merge-store-partially-alias-loads.ll
test/CodeGen/X86/pr18023.ll [deleted file]
test/CodeGen/X86/split-store.ll
test/CodeGen/X86/stores-merging.ll
test/CodeGen/X86/vector-compare-results.ll
test/CodeGen/X86/vector-shuffle-variable-128.ll
test/CodeGen/X86/vector-shuffle-variable-256.ll
test/CodeGen/X86/vectorcall.ll
test/CodeGen/X86/win32-eh.ll
test/CodeGen/XCore/varargs.ll