Skip to content

clang pragma fp should allow emission of IR arcp flag #64798

@arsenm

Description

@arsenm

pragma clang fp already exists which enables fast math flags within a scope. It currently supports pragma clang fp contract(value) and pragma clang fp reassociate(on).

I would like this extended to cover other fast math flags, in particular arcp. For something like

float fast_div(float x, float y) { #pragma clang fp reciprocal(on) return x / y; } 

I would hope to get

float @fast_div(float %, float %y) { %0 = fdiv arcp float %x, %y ret float %0 } 

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"enhancementImproving things as opposed to bug fixing, e.g. new or missing featurefloating-pointFloating-point math

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions