aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/MathExtrasTest.cpp
diff options
context:
space:
mode:
authorZahira Ammarguellat <zahira.ammarguellat@intel.com>2023-01-25 17:11:07 -0500
committerZahira Ammarguellat <zahira.ammarguellat@intel.com>2023-01-26 14:18:28 -0500
commitb4b06d8ff82647824a658356e1e8f7dc9d1ac7d2 (patch)
tree4622b38d2fdcba790ee748a7a36bd9ed512a786e /llvm/unittests/Support/MathExtrasTest.cpp
parent42e371b174d4407ec5805010c2ecfef9c086b5c2 (diff)
downloadllvm-b4b06d8ff82647824a658356e1e8f7dc9d1ac7d2.zip
llvm-b4b06d8ff82647824a658356e1e8f7dc9d1ac7d2.tar.gz
llvm-b4b06d8ff82647824a658356e1e8f7dc9d1ac7d2.tar.bz2
__arithmetic_fence enforces ordering on expression evaluation when fast-math
is enabled. In fast math mode some floating-point optimizations are performed such as reassociation and distribution. For example, the compiler may transform (a+b)+c into a+(b+c). Although these two expressions are equivalent in integer arithmetic, they may not be in floating-point arithmetic. The builtin tells the compiler that the expression in parenthesis can’t be re-associated or distributed. __arithmetic_fence(a+b)+c is not equivalent to a+(b+c). This patch adds the support of the builtin to SPIR target. Differential Revision: https://reviews.llvm.org/D142583
Diffstat (limited to 'llvm/unittests/Support/MathExtrasTest.cpp')
0 files changed, 0 insertions, 0 deletions