Commit 7fed5cc
[CIR] Always zero-extend shift amounts (llvm#1568)
Negative shift amounts are undefined behavior in C and C++. Because of
that we can always zero-extend the shift amount which is slightly faster
on certain architectures (e. g. x86). This also matches the behavior of
the original clang Codegen.
Backported from llvm/llvm-project#133405
Co-authored-by: Morris Hafner <[email protected]>1 parent 2dc6f86 commit 7fed5cc
File tree
2 files changed
+4
-3
lines changed- clang
- lib/CIR/Lowering/DirectToLLVM
- test/CIR/Lowering
2 files changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2967 | 2967 | | |
2968 | 2968 | | |
2969 | 2969 | | |
| 2970 | + | |
| 2971 | + | |
2970 | 2972 | | |
2971 | 2973 | | |
2972 | | - | |
2973 | | - | |
| 2974 | + | |
2974 | 2975 | | |
2975 | 2976 | | |
2976 | 2977 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
0 commit comments