Skip to content

Commit

Permalink
add nocontraction decoration to conversions to floating point (#1382)
Browse files Browse the repository at this point in the history
It will allow to avoid optimization of certain driver breaking the
implementation of the libclc.
  • Loading branch information
rjodinchr authored Jul 9, 2024
1 parent 2776a72 commit 9829752
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/SPIRVProducerPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,11 +531,13 @@ struct SPIRVProducerPassImpl {
bool CalledWithCoherentResource(Argument &Arg);

bool NeedDecorationNoContraction(spv::Op op) {
static const SmallVector<spv::Op> list_full = {spv::OpFMul, spv::OpFDiv,
spv::OpFNegate, spv::OpFAdd,
spv::OpFSub, spv::OpFRem};
static const SmallVector<spv::Op> list_full = {
spv::OpFMul, spv::OpFDiv, spv::OpFNegate,
spv::OpFAdd, spv::OpFSub, spv::OpFRem,
spv::OpFConvert, spv::OpConvertUToF, spv::OpConvertSToF};
static const SmallVector<spv::Op> list_mad_enable = {
spv::OpFDiv, spv::OpFNegate, spv::OpFSub, spv::OpFRem};
spv::OpFDiv, spv::OpFNegate, spv::OpFSub, spv::OpFRem,
spv::OpFConvert, spv::OpConvertUToF, spv::OpConvertSToF};
auto check_list = [&op](const SmallVector<spv::Op> &list) {
for (auto opf : list) {
if (op == opf)
Expand Down

0 comments on commit 9829752

Please sign in to comment.