1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 21:13:02 +02:00
llvm-mirror/lib/CodeGen/SelectionDAG
Nirav Dave afe2eccae3 In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled.
Retrying after fixing after removing load-store factoring through
token factors in favor of improved token factor operand pruning

Simplify Consecutive Merge Store Candidate Search

Now that address aliasing is much less conservative, push through
simplified store merging search 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.

Whem 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 generally the output CodeGen (with some
exceptions).

Additional Minor Changes:

   1. Finishes removing unused AliasLoad code
   2. Unifies the 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 seemed sufficient to not cause regressions in
      tests.

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. Some tests relying on the order were changed to use
volatile memory operations

Noteworthy tests:

    CodeGen/AArch64/argument-blocks.ll -
      It's not entirely clear what the test_varargs_stackalign test is
      supposed to be asserting, but the new code looks right.

    CodeGen/AArch64/arm64-memset-inline.lli -
    CodeGen/AArch64/arm64-stur.ll -
    CodeGen/ARM/memset-inline.ll -

      The backend now generates *worse* code due to store merging
      succeeding, as we do do a 16-byte constant-zero store efficiently.

    CodeGen/AArch64/merge-store.ll -
      Improved, but there still seems to be an extraneous vector insert
      from an element to itself?

    CodeGen/PowerPC/ppc64-align-long-double.ll -
      Worse code emitted in this case, due to the improved store->load
      forwarding.

    CodeGen/X86/dag-merge-fast-accesses.ll -
    CodeGen/X86/MergeConsecutiveStores.ll -
    CodeGen/X86/stores-merging.ll -
    CodeGen/Mips/load-store-left-right.ll -
      Restored correct merging of non-aligned stores

    CodeGen/AMDGPU/promote-alloca-stored-pointer-value.ll -
      Improved. Correctly merges buffer_store_dword calls

    CodeGen/AMDGPU/si-triv-disjoint-mem-access.ll -
      Improved. Sidesteps loading a stored value and
      merges two stores

    CodeGen/X86/pr18023.ll -
      This test has been removed, as it was asserting incorrect
      behavior. Non-volatile stores *CAN* be moved past volatile loads,
      and now are.

    CodeGen/X86/vector-idiv.ll -
    CodeGen/X86/vector-lzcnt-128.ll -
      It's basically impossible to tell what these tests are actually
      testing. But, looks like the code got better due to the memory
      operations being recognized as non-aliasing.

    CodeGen/X86/win32-eh.ll -
      Both loads of the securitycookie are now merged.

Reviewers: arsenm, hfinkel, tstellarAMD, jyknight, nhaehnle

Subscribers: wdng, nhaehnle, nemanjai, arsenm, weimingz, niravd, RKSimon, aemerson, qcolombet, dsanders, resistor, tstellarAMD, t.p.northover, spatel

Differential Revision: https://reviews.llvm.org/D14834

llvm-svn: 289659
2016-12-14 15:44:26 +00:00
..
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
DAGCombiner.cpp In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled. 2016-12-14 15:44:26 +00:00
FastISel.cpp IR: Change the gep_type_iterator API to avoid always exposing the "current" type. 2016-12-02 02:24:42 +00:00
FunctionLoweringInfo.cpp Move most EH from MachineModuleInfo to MachineFunction 2016-12-01 19:32:15 +00:00
InstrEmitter.cpp SDAG: Make sure we use an allocatable reg class when we create this vreg 2016-10-28 22:42:54 +00:00
InstrEmitter.h
LegalizeDAG.cpp [SelectionDAG] Add expansion and promotion of [US]MUL_LOHI 2016-12-08 14:08:14 +00:00
LegalizeFloatTypes.cpp Replace APFloatBase static fltSemantics data members with getter functions 2016-12-14 11:57:17 +00:00
LegalizeIntegerTypes.cpp AMDGPU: Fix i128 mul 2016-12-09 17:49:14 +00:00
LegalizeTypes.cpp SDAG: Avoid a large, usually empty SmallVector in a recursive function 2016-12-02 00:11:01 +00:00
LegalizeTypes.h [SelectionDAGBuilder] Support llvm.flt.rounds on targets where i32 is not legal 2016-10-10 20:45:15 +00:00
LegalizeTypesGeneric.cpp Do not assume that FP vector operands are never legalized by expanding 2016-10-26 19:51:35 +00:00
LegalizeVectorOps.cpp [SelectionDAG] Add expansion and promotion of [US]MUL_LOHI 2016-12-08 14:08:14 +00:00
LegalizeVectorTypes.cpp Type legalization for compressstore and expandload intrinsics. 2016-11-23 13:58:24 +00:00
LLVMBuild.txt
ResourcePriorityQueue.cpp Use the range variant of find instead of unpacking begin/end 2016-08-11 22:21:41 +00:00
ScheduleDAGFast.cpp
ScheduleDAGRRList.cpp Use the range variant of find instead of unpacking begin/end 2016-08-11 22:21:41 +00:00
ScheduleDAGSDNodes.cpp
ScheduleDAGSDNodes.h
ScheduleDAGVLIW.cpp
SDNodeDbgValue.h
SelectionDAG.cpp [DAGCombiner] Try to use SelectionDAG::isKnownToBeAPowerOfTwo instead of just APInt::isPowerOf2 2016-12-14 15:08:13 +00:00
SelectionDAGBuilder.cpp Replace APFloatBase static fltSemantics data members with getter functions 2016-12-14 11:57:17 +00:00
SelectionDAGBuilder.h Expandload and Compressstore intrinsics 2016-11-03 03:23:55 +00:00
SelectionDAGDumper.cpp Replace APFloatBase static fltSemantics data members with getter functions 2016-12-14 11:57:17 +00:00
SelectionDAGISel.cpp Move most EH from MachineModuleInfo to MachineFunction 2016-12-01 19:32:15 +00:00
SelectionDAGPrinter.cpp
SelectionDAGTargetInfo.cpp
StatepointLowering.cpp [Statepoints] Reuse stack slots more than once within a basic block 2016-12-13 01:21:15 +00:00
StatepointLowering.h
TargetLowering.cpp [SelectionDAG] Use SelectionDAG.getBuildVector helper. NFCI. 2016-12-09 15:23:41 +00:00