diff options
author | Adam Nemet <anemet@apple.com> | 2017-03-28 20:11:52 +0000 |
---|---|---|
committer | Adam Nemet <anemet@apple.com> | 2017-03-28 20:11:52 +0000 |
commit | 5c57c1108edaf065bc7d288d6024cad3aec3204a (patch) | |
tree | 70bfb6769f38da5da687968e6bff55b991ec3700 /test | |
parent | d707b92e85f425bc8a50aed76bc1045957341376 (diff) |
[IR] Add AllowContract to FastMathFlags
-ffp-contract=fast does not currently work with LTO because it's passed as a
TargetOption to the backend rather than in the IR. This adds it to
FastMathFlags.
This is toward fixing PR25721
Differential Revision: https://reviews.llvm.org/D31164
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298939 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Assembler/fast-math-flags.ll | 12 | ||||
-rw-r--r-- | test/Bitcode/compatibility.ll | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/test/Assembler/fast-math-flags.ll b/test/Assembler/fast-math-flags.ll index f0d3ecc761d..4ef3607e1d0 100644 --- a/test/Assembler/fast-math-flags.ll +++ b/test/Assembler/fast-math-flags.ll @@ -74,6 +74,18 @@ entry: ret float %e } +; CHECK: @contract( +define float @contract(float %x, float %y) { +entry: +; CHECK: %a = fsub contract float %x, %y + %a = fsub contract float %x, %y +; CHECK: %b = fadd contract float %x, %y + %b = fadd contract float %x, %y +; CHECK: %c = fmul contract float %a, %b + %c = fmul contract float %a, %b + ret float %c +} + ; CHECK: no_nan_inf define float @no_nan_inf(float %x, float %y) { entry: diff --git a/test/Bitcode/compatibility.ll b/test/Bitcode/compatibility.ll index f1a883e53ad..b1f52bbe059 100644 --- a/test/Bitcode/compatibility.ll +++ b/test/Bitcode/compatibility.ll @@ -760,6 +760,8 @@ define void @fastmathflags(float %op1, float %op2) { ; CHECK: %f.nsz = fadd nsz float %op1, %op2 %f.arcp = fadd arcp float %op1, %op2 ; CHECK: %f.arcp = fadd arcp float %op1, %op2 + %f.contract = fadd contract float %op1, %op2 + ; CHECK: %f.contract = fadd contract float %op1, %op2 %f.fast = fadd fast float %op1, %op2 ; CHECK: %f.fast = fadd fast float %op1, %op2 ret void |