diff options
| author | Narayan <32898329+vortex73@users.noreply.github.com> | 2025-01-31 20:47:58 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-31 23:17:58 +0800 |
| commit | 55be370f375416f615a840d1c0cabe2c819e6bbb (patch) | |
| tree | 7fd4fbcad0ad90c738623c2c93d413b68824a628 /lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp | |
| parent | a325622be523e977e0c4bae81ea8e4c6916cdb21 (diff) | |
[InstCombine] Fold frexp of select to select of frexp (#121227)
This patch implements an optimization to push select operations through
frexp when one of the select operands is a constant. When we encounter:
```
define float @src(float %x, i1 %bool) {
%select = select i1 %bool, float 1.000000e+00, float %x
%frexp = tail call { float, i32 } @llvm.frexp.f32.i32(float %select)
%frexp.0 = extractvalue { float, i32 } %frexp, 0
ret float %frexp.0
}
```
We transform it to:
```
define float @tgt(float %x, i1 %bool) {
%frexp = tail call { float, i32 } @llvm.frexp.f32.i32(float %x)
%frexp.0 = extractvalue { float, i32 } %frexp, 0
%select = select i1 %bool, float 5.000000e-01, float %frexp.0
ret float %select
}
```
Fixes #92542
Diffstat (limited to 'lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp')
0 files changed, 0 insertions, 0 deletions
