diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-04-11 22:05:16 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-04-11 22:05:16 +0000 |
| commit | fe94f0bf93e658d2d6ca94cfcc2acfc21d93be8b (patch) | |
| tree | 25a171e2587362dd78e55d33f13dbf73de52460c | |
| parent | dcb750f015e64ecc95f4c2d9542a13a4351d6dbc (diff) | |
| download | bcm5719-llvm-fe94f0bf93e658d2d6ca94cfcc2acfc21d93be8b.tar.gz bcm5719-llvm-fe94f0bf93e658d2d6ca94cfcc2acfc21d93be8b.zip | |
New testcase
llvm-svn: 12843
| -rw-r--r-- | llvm/test/Regression/CodeGen/X86/fp_load_fold.llx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/llvm/test/Regression/CodeGen/X86/fp_load_fold.llx b/llvm/test/Regression/CodeGen/X86/fp_load_fold.llx new file mode 100644 index 00000000000..7ce437d492d --- /dev/null +++ b/llvm/test/Regression/CodeGen/X86/fp_load_fold.llx @@ -0,0 +1,40 @@ +; RUN: llvm-as < %s | llc -march=x86 | grep ST | not grep 'fadd\|fsub\|fdiv\|fmul' + +; Test that the load of the memory location is folded into the operation. + + +double %test_add(double %X, double *%P) { + %Y = load double* %P + %R = add double %X, %Y + ret double %R +} + +double %test_mul(double %X, double *%P) { + %Y = load double* %P + %R = mul double %X, %Y + ret double %R +} + +double %test_sub(double %X, double *%P) { + %Y = load double* %P + %R = sub double %X, %Y + ret double %R +} + +double %test_subr(double %X, double *%P) { + %Y = load double* %P + %R = sub double %Y, %X + ret double %R +} + +double %test_div(double %X, double *%P) { + %Y = load double* %P + %R = div double %X, %Y + ret double %R +} + +double %test_divr(double %X, double *%P) { + %Y = load double* %P + %R = div double %Y, %X + ret double %R +} |

