1 ; RUN: llc < %s -mtriple=i686-- -x86-asm-syntax=intel | \
2 ; RUN: grep -i ST | not grep "fadd\|fsub\|fdiv\|fmul"
4 ; Test that the load of the memory location is folded into the operation.
6 define double @test_add(double %X, double* %P) {
7 %Y = load double, double* %P ; <double> [#uses=1]
8 %R = fadd double %X, %Y ; <double> [#uses=1]
12 define double @test_mul(double %X, double* %P) {
13 %Y = load double, double* %P ; <double> [#uses=1]
14 %R = fmul double %X, %Y ; <double> [#uses=1]
18 define double @test_sub(double %X, double* %P) {
19 %Y = load double, double* %P ; <double> [#uses=1]
20 %R = fsub double %X, %Y ; <double> [#uses=1]
24 define double @test_subr(double %X, double* %P) {
25 %Y = load double, double* %P ; <double> [#uses=1]
26 %R = fsub double %Y, %X ; <double> [#uses=1]
30 define double @test_div(double %X, double* %P) {
31 %Y = load double, double* %P ; <double> [#uses=1]
32 %R = fdiv double %X, %Y ; <double> [#uses=1]
36 define double @test_divr(double %X, double* %P) {
37 %Y = load double, double* %P ; <double> [#uses=1]
38 %R = fdiv double %Y, %X ; <double> [#uses=1]