diff options
author | dianqk <dianqk@dianqk.net> | 2025-10-06 12:56:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-10-06 04:56:43 +0000 |
commit | bbdcba9b851abe37cf2b10ec6d9b50c12cdd3604 (patch) | |
tree | a8356e4aad042550ac85bf24f0db21ba0ec789f1 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 36cfdebe927c34508c1e245b459da43b745ae620 (diff) | |
download | llvm-bbdcba9b851abe37cf2b10ec6d9b50c12cdd3604.zip llvm-bbdcba9b851abe37cf2b10ec6d9b50c12cdd3604.tar.gz llvm-bbdcba9b851abe37cf2b10ec6d9b50c12cdd3604.tar.bz2 |
[SimplifyCFG] Fold the contiguous wrapping cases into ICmp. (#161000)
Fixes #157113.
Take the following IR as an example; we know the destination of the `[1,
3]` cases is `%else`.
```llvm
define i32 @src(i8 range(i8 0, 6) %arg) {
switch i8 %arg, label %else [
i8 0, label %if
i8 4, label %if
i8 5, label %if
]
if:
ret i32 0
else:
ret i32 1
}
```
We can first try the non-wrapping range for both destinations, but I
don't see how that would be any better.
Proof: https://alive2.llvm.org/ce/z/acdWD4.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions