Conversation
Diff moderunner: ariselab-64c-docker 3364 files changed, 2123743 insertions(+), 2096266 deletions(-) +26 grpc/ssl_transport_security.ll |
|
This patch contains numerous low-level LLVM IR optimizations across many benchmarks, primarily focused on improving boolean logic and control flow. The major changes are:
These changes collectively enhance code generation quality by tightening boolean semantics, reducing instruction overhead, and improving CFG structure — all without altering program behavior. model: qwen-plus-latest |
| %.val3.i5.i.i.i.i = load i32, ptr %12, align 4, !tbaa !696 | ||
| %13 = icmp eq i32 %.val.i4.i.i.i.i, %.val3.i5.i.i.i.i | ||
| %14 = and i1 %8, %13 | ||
| %14 = select i1 %13, i1 %8, i1 false |
There was a problem hiding this comment.
andjo403
left a comment
There was a problem hiding this comment.
from local run 860 files with less lines, 1668 same line count and 840 files that is more lines many due to more inlining
| 47: ; preds = %38 | ||
| %48 = icmp ne i32 %4, 0 | ||
| %or.cond = or i1 %48, %46 | ||
| %48 = trunc nuw i32 %4 to i1 |
There was a problem hiding this comment.
shall isGuaranteedNotToBePoison check the range for %4 so the select can be folded to or?
| %15 = trunc nuw i8 %14 to i1 | ||
| %16 = xor i1 %15, true |
There was a problem hiding this comment.
shall xor (trunc nuw x to i1), true be folded to icmp eq x, 0 ?
will lose information about the range of %14
| %.not = xor i1 %68, true | ||
| %69 = trunc nuw i8 %.pre22 to i1 | ||
| %or.cond = select i1 %.not, i1 %69, i1 false |
There was a problem hiding this comment.
missing demorgan when trunc is one of values
| %5 = icmp eq i8 %4, 0 | ||
| br i1 %5, label %.lr.ph, label %"_ZN4itoa55_$LT$impl$u20$itoa..private..Sealed$u20$for$u20$u32$GT$5write17hb7b886c46e130987E.exit" | ||
| %5 = tail call i8 @llvm.usub.sat.i8(i8 1, i8 %4) | ||
| %6 = trunc nuw i8 %5 to i1 |
There was a problem hiding this comment.
trunc usub.sat(1,X) to i1 -> icmp eq X, 0
| %276 = trunc nuw i8 %275 to i1 | ||
| %277 = or i1 %273, %276 | ||
| %278 = zext i1 %277 to i8 | ||
| store i8 %278, ptr %274, align 2, !tbaa !129 |
There was a problem hiding this comment.
zext (or X, (trunc nuw Y)) -> or (zext X), Y
maybe is llvm/llvm-project#98017
many times in this diff shall this have a special fold
| %or.cond142.i.i = trunc nuw i8 %.sink.i.i.i319 to i1 | ||
| %or.cond143.i.i = select i1 %or.cond142.i.i, i1 %.sroa.14.0.i138.i.i, i1 false |
| %.1 = phi i8 [ %46, %42 ], [ %.034, %36 ] | ||
| %48 = trunc nuw i8 %.1 to i1 |
There was a problem hiding this comment.
missing that the type can be change to i1 for the phi
| %4 = icmp eq i64 %3, 2 | ||
| %5 = trunc nuw i64 %3 to i1 | ||
| %spec.select = select i1 %4, i1 true, i1 %5 |
There was a problem hiding this comment.
as the range for %3 is (0,3]
X == 2 && X != 0 -> X != 0
There was a problem hiding this comment.
as we know that the range for %x is not (0,2] shall trunc nuw %x to i1 be converted to icmp ne %x , 0 or maybe at least if it is a second operand in a logical and/or
Link: llvm/llvm-project#184182
Requested by: @andjo403