[all-commits] [llvm/llvm-project] be2277: [Matrix] Support #pragma clang fp

Effective Light via All-commits all-commits at lists.llvm.org
Thu Apr 22 03:46:51 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: be2277fbf233cca8e1bd698fa9ab6de404001c3a
      https://github.com/llvm/llvm-project/commit/be2277fbf233cca8e1bd698fa9ab6de404001c3a
  Author: Hamza Mahfooz <someguy at effective-light.com>
  Date:   2021-04-22 (Thu, 22 Apr 2021)

  Changed paths:
    M clang/lib/CodeGen/CGExprScalar.cpp
    A clang/test/CodeGen/fp-matrix-pragma.c

  Log Message:
  -----------
  [Matrix] Support #pragma clang fp

>From https://bugs.llvm.org/show_bug.cgi?id=49739:

Currently, `#pragma clang fp` are ignored for matrix types.

For the code below, the `contract` fast-math flag should be added to the generated call to `llvm.matrix.multiply` and `fadd`

```
typedef float fx2x2_t __attribute__((matrix_type(2, 2)));

void foo(fx2x2_t &A, fx2x2_t &C, fx2x2_t &B) {
  #pragma clang fp contract(fast)
  C = A*B + C;
}
```

Reviewed By: fhahn, mibintc

Differential Revision: https://reviews.llvm.org/D100834




More information about the All-commits mailing list