mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
889cd22a6a
Recommiting with compiler time improvements Recommitting 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 llvm-svn: 297695
51 lines
1.1 KiB
LLVM
51 lines
1.1 KiB
LLVM
; RUN: llc -march=mips64el -mcpu=mips64r2 < %s | FileCheck %s
|
|
|
|
@gld0 = external global fp128
|
|
@gld1 = external global fp128
|
|
|
|
; CHECK: foo0
|
|
; CHECK-DAG: sdc1 $f12, %lo(gld0)(${{[0-9]+}})
|
|
; CHECK-DAG: sdc1 $f13, 8(${{[0-9]+}})
|
|
|
|
define void @foo0(fp128 %a0) {
|
|
entry:
|
|
store fp128 %a0, fp128* @gld0, align 16
|
|
ret void
|
|
}
|
|
|
|
; CHECK: foo1
|
|
; CHECK-DAG: ldc1 $f12, %lo(gld0)(${{[0-9]+}})
|
|
; CHECK-DAG: ldc1 $f13, 8(${{[0-9]+}})
|
|
|
|
define void @foo1() {
|
|
entry:
|
|
%0 = load fp128, fp128* @gld0, align 16
|
|
tail call void @foo2(fp128 %0)
|
|
ret void
|
|
}
|
|
|
|
declare void @foo2(fp128)
|
|
|
|
|
|
; CHECK: foo3:
|
|
|
|
; CHECK: daddiu $[[R2:[0-9]+]], $[[R1:[0-9]+]], %lo(gld0)
|
|
; CHECK: sdc1 $f0, %lo(gld0)($[[R1]])
|
|
; CHECK: sdc1 $f2, 8($[[R2]])
|
|
; CHECK: daddiu $[[R3:[0-9]+]], ${{[0-9]+}}, %hi(gld1)
|
|
; CHECK: dsll $[[R4:[0-9]+]], $[[R3]], 16
|
|
; CHECK: ldc1 $f0, %lo(gld1)($[[R4]])
|
|
; CHECK: daddiu $[[R5:[0-9]]], $[[R4]], %lo(gld1)
|
|
; CHECK: ldc1 $f2, 8($[[R5]])
|
|
|
|
|
|
define fp128 @foo3() {
|
|
entry:
|
|
%call = tail call fp128 @foo4()
|
|
store fp128 %call, fp128* @gld0, align 16
|
|
%0 = load fp128, fp128* @gld1, align 16
|
|
ret fp128 %0
|
|
}
|
|
|
|
declare fp128 @foo4()
|