-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[SECV] Try to push the op into ZExt: A + zext (-A + B) -> zext (B) #151227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,21 +10,21 @@ define void @pred_mip_12(ptr %dst, ptr %src, i32 %n, i64 %offset) { | |
| ; CHECK-SAME: ptr [[DST:%.*]], ptr [[SRC:%.*]], i32 [[N:%.*]], i64 [[OFFSET:%.*]]) { | ||
| ; CHECK-NEXT: [[ENTRY:.*]]: | ||
| ; CHECK-NEXT: [[SMAX:%.*]] = call i32 @llvm.smax.i32(i32 [[N]], i32 1) | ||
| ; CHECK-NEXT: [[TMP0:%.*]] = zext nneg i32 [[SMAX]] to i64 | ||
| ; CHECK-NEXT: [[TMP1:%.*]] = mul i64 [[OFFSET]], [[TMP0]] | ||
| ; CHECK-NEXT: [[SCEVGEP:%.*]] = getelementptr i8, ptr [[SRC]], i64 [[TMP1]] | ||
|
||
| ; CHECK-NEXT: br label %[[OUTER_LOOP:.*]] | ||
| ; CHECK: [[OUTER_LOOP_LOOPEXIT:.*]]: | ||
| ; CHECK-NEXT: [[PTR_IV_NEXT_LCSSA:%.*]] = phi ptr [ [[PTR_IV_NEXT:%.*]], %[[INNER_LOOP:.*]] ] | ||
| ; CHECK-NEXT: br label %[[OUTER_LOOP]] | ||
| ; CHECK: [[OUTER_LOOP]]: | ||
| ; CHECK-NEXT: [[OUTER_PTR:%.*]] = phi ptr [ [[SRC]], %[[ENTRY]] ], [ [[PTR_IV_NEXT_LCSSA]], %[[OUTER_LOOP_LOOPEXIT]] ] | ||
| ; CHECK-NEXT: [[OUTER_PTR:%.*]] = phi ptr [ [[SRC]], %[[ENTRY]] ], [ [[SCEVGEP]], %[[OUTER_LOOP_LOOPEXIT]] ] | ||
| ; CHECK-NEXT: [[C:%.*]] = call i1 @cond() | ||
| ; CHECK-NEXT: br i1 [[C]], label %[[INNER_LOOP_PREHEADER:.*]], label %[[EXIT:.*]] | ||
| ; CHECK: [[INNER_LOOP_PREHEADER]]: | ||
| ; CHECK-NEXT: br label %[[INNER_LOOP]] | ||
| ; CHECK-NEXT: br label %[[INNER_LOOP:.*]] | ||
| ; CHECK: [[INNER_LOOP]]: | ||
| ; CHECK-NEXT: [[IV:%.*]] = phi i32 [ [[IV_NEXT:%.*]], %[[INNER_LOOP]] ], [ 0, %[[INNER_LOOP_PREHEADER]] ] | ||
| ; CHECK-NEXT: [[PTR_IV:%.*]] = phi ptr [ [[PTR_IV_NEXT]], %[[INNER_LOOP]] ], [ [[SRC]], %[[INNER_LOOP_PREHEADER]] ] | ||
| ; CHECK-NEXT: [[L:%.*]] = load i8, ptr [[OUTER_PTR]], align 1 | ||
| ; CHECK-NEXT: [[PTR_IV_NEXT]] = getelementptr i8, ptr [[PTR_IV]], i64 [[OFFSET]] | ||
| ; CHECK-NEXT: store i8 [[L]], ptr [[DST]], align 2 | ||
| ; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1 | ||
| ; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i32 [[IV_NEXT]], [[SMAX]] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check
isa<SCEVAddExpr>(B)before computinggetTruncateExpr?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, should be done in ab9b23c by introducing a new
m_scec_Add()which matches and captures SCEVAddExpr with an abitrary number of operands