Skip to content

Handling of std::tan and -ffast-math on more recent versions of LLVM #3101

Description

@nkoukpaizan

We are hitting an error in GridKit when attempting to differentiate std::tan with clang 19+ and -ffast-math. This works for clang 15 to clang 18.

Current workarounds include:

  • Removing the -ffast-math flag, which may limit performance
  • Adding a -fno-builtin-tan flag
  • Rewriting the std::tan call explicitly as std::sin/std::cos

I would rather natively supporting this on the Enzyme side.

Here's an Enzyme explorer reproducer

cc @pelesh @wsmoses @lukelowry

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions