[SPIRV] Add PreLegalizer pattern matching for `degrees` GL extension
Open
backend:SPIR-V
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Follow-up to #213096.
Following the `degrees` implementation move, SPIR-V now lowers `degrees` as a generic `fmul` instead of the GL extension:
```asm
degrees(x) ->
fmul x, (180 / pi)
```
We can pattern match this in `SPIRVCombine.td` and `SPIRVCombinerHelper.cpp` to
```llvm
fmul(
x,
(180 / pi))
```
which would allow us to change `fmul(x, 180/pi)` back into `degrees(x)` so that SPIR-V emits the GL extension again.
Contributor guide
Assessment
This issue has not been assessed yet.