[PATCH] D141481: [SCEV] Canonicalize ext(min/max(x, y)) to min/max(ext(x), ext(y))
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 21 12:04:02 PDT 2023
efriedma added a comment.
I'm seeing a regression on the following testcase:
define void @foo() {
entry:
br label %for.body
for.body:
%indvars.iv696 = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
%x3 = trunc i64 %indvars.iv696 to i32
%x4 = add i32 %x3, 143
%x5 = icmp ult i32 %x4, 302
%cond355 = select i1 %x5, i32 %x4, i32 302
%idxprom363 = zext i32 %cond355 to i64
%indvars.iv.next = add nuw nsw i64 %indvars.iv696, 1
%exitcond = icmp eq i64 %indvars.iv.next, 160
br i1 %exitcond, label %exit, label %for.body
exit:
ret void
}
`opt '-passes=print<scalar-evolution>'` used to print the following:
%idxprom363 = zext i32 %cond355 to i64
--> {143,+,1}<nuw><%for.body> U: [143,303) S: [143,303) Exits: 302 LoopDispositions: { %for.body: Computable }
Now it prints
%idxprom363 = zext i32 %cond355 to i64
--> (zext i32 (302 umin {143,+,1}<%for.body>) to i64) U: [0,303) S: [0,303) Exits: 302 LoopDispositions: { %for.body: Computable }
Is this expected?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141481/new/
https://reviews.llvm.org/D141481
More information about the llvm-commits
mailing list