diff options
author | Yingwei Zheng <dtcxzyw2333@gmail.com> | 2024-10-05 09:23:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-05 09:23:29 +0800 |
commit | e6549b8036089f20c6ac01e644a544aa2b231ca8 (patch) | |
tree | c570c7ed44ebd8c7e2501829b8eb54d3d3f46b2a /lldb/source/Commands/CommandObjectSession.cpp | |
parent | b5f6689dc93216f9272e790e787548cf29250566 (diff) | |
download | llvm-e6549b8036089f20c6ac01e644a544aa2b231ca8.zip llvm-e6549b8036089f20c6ac01e644a544aa2b231ca8.tar.gz llvm-e6549b8036089f20c6ac01e644a544aa2b231ca8.tar.bz2 |
[RISCV][ISel] Allow emitting `addiw` with u32simm12 rhs (#111116)
In InstCombine, we shrink the constant by setting unused bits to zero
(e.g. `((X + -2) & 4294967295) -> ((X + 4294967294) & 4294967295)`).
However, this canonicalization blocks emitting `addiw` and creates
redundant li for simm32 rhs:
```
; bin/llc -mtriple=riscv64 -mattr=+zba test.ll -o -
define i64 @add_u32simm32_zextw(i64 %x) nounwind {
entry:
%add = add i64 %x, 4294967294
%and = and i64 %add, 4294967295
ret i64 %and
}
```
```
add_u32simm32_zextw: # @add_u32simm32_zextw
# %bb.0: # %entry
li a1, -2
add a0, a0, a1
zext.w a0, a0
ret
```
This patch addresses the issue by matching u32simm12 rhs.
Diffstat (limited to 'lldb/source/Commands/CommandObjectSession.cpp')
0 files changed, 0 insertions, 0 deletions