aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/TestModuleFileExtension.cpp
diff options
context:
space:
mode:
authorKrzysztof Drewniak <Krzysztof.Drewniak@amd.com>2023-06-15 13:42:54 -0500
committerKrzysztof Drewniak <Krzysztof.Drewniak@amd.com>2023-07-11 20:32:35 +0000
commit10b56e0210bf615519570f561acbeb916db032f4 (patch)
treeae1038e0b0d83d2a52fa60692eeb2d68dbe12d76 /clang/lib/Frontend/TestModuleFileExtension.cpp
parent980cd183543d13689d736952d83ef4ee8964274d (diff)
downloadllvm-10b56e0210bf615519570f561acbeb916db032f4.zip
llvm-10b56e0210bf615519570f561acbeb916db032f4.tar.gz
llvm-10b56e0210bf615519570f561acbeb916db032f4.tar.bz2
[mlir][Arith] Add pass for emulating unsupported float ops (#1079)
To complement the bf16 expansion and truncation patterns added to ExpandOps, define a pass that replaces, for any arithmetic operation op, %y = arith.op %v0, %v1, ... : T with %e0 = arith.expf %v0 : T to U %e1 = arith.expf %v1 : T to U ... %y.exp = arith.op %e0, %e1, ... : U %y = arith.truncf %y.exp : U to T This allows for "emulating" floating-point operations not supported on a given target (such as bfloat operations or most arithmetic on 8-bit floats) by extending those types to supported ones, performing the arithmetic operation, and then truncating back to the original type (which ensures appropriate rounding behavior). The lowering of the extf and truncf ops introduced by this transformation should be handled by subsequent passes. Reviewed By: rsuderman Differential Revision: https://reviews.llvm.org/D154539
Diffstat (limited to 'clang/lib/Frontend/TestModuleFileExtension.cpp')
0 files changed, 0 insertions, 0 deletions