diff options
author | Chris Lattner <sabre@nondot.org> | 2005-01-17 23:16:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-01-17 23:16:01 +0000 |
commit | a8b6f68a554b63fa94c78413c1d305bf658bca54 (patch) | |
tree | 85c2aab67f5068db34b4537b6b85db005f7c1ae8 /test/CodeGen | |
parent | 869e0434aec85e4653e5f5218077a36f71da7dd9 (diff) |
This is a carefully contrived testcase where the X86 ISel is emitting all loads
before other ops, causing it to spill like mad. This occurs in
164.gzip:flush_block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19648 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r-- | test/CodeGen/X86/regpressure.ll | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/CodeGen/X86/regpressure.ll b/test/CodeGen/X86/regpressure.ll index 8cb6b0ee5a..1ba381d30e 100644 --- a/test/CodeGen/X86/regpressure.ll +++ b/test/CodeGen/X86/regpressure.ll @@ -70,3 +70,48 @@ int %regpressure2(int* %P) { ret int %s9 } +;; adds should be the same as muls. +int %regpressure3(short* %P, bool %Cond, int* %Other) { + %A = load short* %P + %Bp = getelementptr short* %P, int 1 + %B = load short* %Bp + %Cp = getelementptr short* %P, int 2 + %C = load short* %Cp + %Dp = getelementptr short* %P, int 3 + %D = load short* %Dp + %Ep = getelementptr short* %P, int 4 + %E = load short* %Ep + %Fp = getelementptr short* %P, int 5 + %F = load short* %Fp + %Gp = getelementptr short* %P, int 6 + %G = load short* %Gp + %Hp = getelementptr short* %P, int 7 + %H = load short* %Hp + %Ip = getelementptr short* %P, int 8 + %I = load short* %Ip + %Jp = getelementptr short* %P, int 9 + %J = load short* %Jp + + ;; These casts prevent folding the loads into the adds. + %A = cast short %A to int + %B = cast short %B to int + %D = cast short %D to int + %C = cast short %C to int + %E = cast short %E to int + %F = cast short %F to int + %G = cast short %G to int + %H = cast short %H to int + %I = cast short %I to int + %J = cast short %J to int + %s1 = add int %A, %B + %s2 = add int %C, %s1 + %s3 = add int %D, %s2 + %s4 = add int %E, %s3 + %s5 = add int %F, %s4 + %s6 = add int %G, %s5 + %s7 = add int %H, %s6 + %s8 = add int %I, %s7 + %s9 = add int %J, %s8 + ret int %s9 +} + |