aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectScript.cpp
diff options
context:
space:
mode:
authorYingwei Zheng <dtcxzyw2333@gmail.com>2024-02-06 02:30:12 +0800
committerGitHub <noreply@github.com>2024-02-06 02:30:12 +0800
commit930996e9e442d69a321cd5c945543d37c97f4c0e (patch)
tree6bdac45e71c448599da25200bd20c0040273623d /lldb/source/Commands/CommandObjectScript.cpp
parentdd70aef05a86bb0c1e04c49cc1bd0457ca362ce3 (diff)
downloadllvm-930996e9e442d69a321cd5c945543d37c97f4c0e.zip
llvm-930996e9e442d69a321cd5c945543d37c97f4c0e.tar.gz
llvm-930996e9e442d69a321cd5c945543d37c97f4c0e.tar.bz2
[ValueTracking][NFC] Pass `SimplifyQuery` to `computeKnownFPClass` family (#80657)
This patch refactors the interface of the `computeKnownFPClass` family to pass `SimplifyQuery` directly. The motivation of this patch is to compute known fpclass with `DomConditionCache`, which was introduced by https://github.com/llvm/llvm-project/pull/73662. With `DomConditionCache`, we can do more optimization with context-sensitive information. Example (extracted from [fmt/format.h](https://github.com/fmtlib/fmt/blob/e17bc67547a66cdd378ca6a90c56b865d30d6168/include/fmt/format.h#L3555-L3566)): ``` define float @test(float %x, i1 %cond) { %i32 = bitcast float %x to i32 %cmp = icmp slt i32 %i32, 0 br i1 %cmp, label %if.then1, label %if.else if.then1: %fneg = fneg float %x br label %if.end if.else: br i1 %cond, label %if.then2, label %if.end if.then2: br label %if.end if.end: %value = phi float [ %fneg, %if.then1 ], [ %x, %if.then2 ], [ %x, %if.else ] %ret = call float @llvm.fabs.f32(float %value) ret float %ret } ``` We can prove the signbit of `%value` is always zero. Then the fabs can be eliminated.
Diffstat (limited to 'lldb/source/Commands/CommandObjectScript.cpp')
0 files changed, 0 insertions, 0 deletions