diff options
| author | Juneyoung Lee <aqjune@gmail.com> | 2023-02-15 18:05:20 +0000 |
|---|---|---|
| committer | Juneyoung Lee <aqjune@gmail.com> | 2023-03-08 18:13:57 +0000 |
| commit | a66bc1c4a30ca958fee094bd7dcb6bc4b9cdd49f (patch) | |
| tree | 3847910ccd1887c988b1076e848054fcd6687dcb /lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.cpp | |
| parent | 79ebb6385b3afe2b78a6923b3bbddadb791b7840 (diff) | |
[DAGCombiner] Avoid converting (x or/xor const) + y to (x + y) + const if benefit is unclear
This patch resolves suboptimal code generation reported by https://github.com/llvm/llvm-project/issues/60571 .
DAGCombiner currently converts `(x or/xor const) + y` to `(x + y) + const` if this is valid.
However, if `.. + const` is broken down into a sequences of adds with carries, the benefit is not clear, introducing two more add(-with-carry) ops (total 6) in the case of the reported issue whereas the optimal sequence must only have 4 add(-with-carry)s.
This patch resolves this issue by allowing this conversion only when (1) `.. + const` is legal or promotable, or (2) `const` is a sign bit because it does not introduce more adds.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D144116
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.cpp')
0 files changed, 0 insertions, 0 deletions
