[PATCH] D112760: Require 'contract' fast-math flag for FMA generation

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 1 11:54:37 PDT 2021


tra added a comment.

> There may be a change needed to the front end for CUDA and HIP support before this patch is committed, but I'd like to keep that separate.

Do I understand it correctly is that the proposal is to explicitly annotate each instruction, instead of relying on LLVM to infer the FP contraction from the global flag. We should still be able to use `-ffp-contract=fast` in clang, only now it would affect IR generation directly.

In D112760#3097718 <https://reviews.llvm.org/D112760#3097718>, @arsenm wrote:

> I would rephrase the description as removing the global flag for contraction

Maybe, we should be even more specific -- `replace global flag for contractions with explicit instruction attributes`.



================
Comment at: clang/test/CodeGenCUDA/fp-contract.cu:3-7
+// FIXME: This test fails. The comment below describes broken behavior.
+//        The front end should generate IR for the semantics it expects and
+//        backends should respect the IR. Backends should never "disregard"
+//        elements of the IR.
+
----------------
We do need to have a way to preserve current behavior for CUDA compilation. There are many existing users that implicitly assume it.




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112760/new/

https://reviews.llvm.org/D112760



More information about the llvm-commits mailing list