diff options
author | Yingwei Zheng <dtcxzyw2333@gmail.com> | 2024-11-21 20:47:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-21 20:47:24 +0800 |
commit | 2e60048641e86b7a414aec51d920bc4e1e3fbeb6 (patch) | |
tree | 7ecff5b148642a96028d6a28a3bf1fd29cf245a6 /clang/unittests/Frontend/CompilerInvocationTest.cpp | |
parent | 4872ecf1cc3cb9c4939a9e6210a9b9e9a9032e9f (diff) | |
download | llvm-2e60048641e86b7a414aec51d920bc4e1e3fbeb6.zip llvm-2e60048641e86b7a414aec51d920bc4e1e3fbeb6.tar.gz llvm-2e60048641e86b7a414aec51d920bc4e1e3fbeb6.tar.bz2 |
[InstCombine] Fold zext(X) + C2 pred C -> X + C3 pred C4 (#110511)
Motivating case from
https://github.com/torvalds/linux/blob/9852d85ec9d492ebef56dc5f229416c925758edc/drivers/gpu/drm/drm_edid.c#L5238-L5240:
```
define i1 @src(i8 noundef %v13) {
entry:
%conv1 = zext i8 %v13 to i32
%add = add nsw i32 %conv1, -4
%cmp = icmp ult i32 %add, 3
%cmp4 = icmp slt i8 %v13, 4
%cond = select i1 %cmp4, i1 true, i1 %cmp
ret i1 %cond
}
define i1 @tgt(i8 noundef %v13) {
entry:
%cmp4 = icmp slt i8 %v13, 7
ret i1 %cmp4
}
```
Diffstat (limited to 'clang/unittests/Frontend/CompilerInvocationTest.cpp')
0 files changed, 0 insertions, 0 deletions