microsoft / qsharp-compiler

Q# compiler, command line tool, and Q# language server
https://docs.microsoft.com/quantum
MIT License
684 stars 170 forks source link

QIR generation for math functions should use LLVM intrinsics where possible, use `rt` functions otherwise #1557

Open swernli opened 1 year ago

swernli commented 1 year ago

Right now the math functions in Q# are treated as if they are quantum intrinsics, and become __quantum__qis__* declarations. Instead, the compiler should insert calls to the appropriate LLVM intrinsic trig functions or combinations thereof, and for those that can't it should treat them as functions supported by the standard library and named with the __quantum__rt__* pattern.