Details
Details
Diff Detail
Diff Detail
Event Timeline
llvm/test/Transforms/FunctionSpecialization/and-add-shl.ll | ||
---|---|---|
2 ↗ | (On Diff #546360) | Seems like a strange move? I'd expect a new patch to only add a test to the relevant pass, not delete one from another |
llvm/test/Transforms/FunctionSpecialization/and-add-shl.ll | ||
---|---|---|
2 ↗ | (On Diff #546360) | Apply your comment, thanks |
Comment Actions
1、 replace the test file under llvm/test/Transforms/SCCP
2、 Add a new negative case and_not_shl_overlap
llvm/test/Transforms/SCCP/and-add-shl.ll | ||
---|---|---|
2 | Can we replace ipsccp with sccp? These tests don't touch IPO, right? |
llvm/test/Transforms/SCCP/and-add-shl.ll | ||
---|---|---|
2 | I find they have some different result because we can propagate the value of llvm.ssa.copy.i8 when we enable the IPO. +++ b/llvm/test/Transforms/SCCP/and-add-shl.ll @@ -10,9 +10,10 @@ define i8 @and_add_shl(i8 %x) { ; CHECK-SAME: (i8 [[X:%.*]]) { ; CHECK-NEXT: [[OP1_P2:%.*]] = icmp ule i8 [[X]], 5 ; CHECK-NEXT: call void @llvm.assume(i1 [[OP1_P2]]) -; CHECK-NEXT: [[SHIFT:%.*]] = shl nuw nsw i8 1, [[X]] -; CHECK-NEXT: [[SUB:%.*]] = add nsw i8 [[SHIFT]], -1 -; CHECK-NEXT: ret i8 0 +; CHECK-NEXT: [[SHIFT:%.*]] = shl nuw i8 1, [[X]] +; CHECK-NEXT: [[SUB:%.*]] = add i8 [[SHIFT]], -1 +; CHECK-NEXT: [[R:%.*]] = and i8 [[SUB]], 32 +; CHECK-NEXT: ret i8 [[R]] ; %op1_p2 = icmp ule i8 %x, 5 call void @llvm.assume(i1 %op1_p2) @@ -65,8 +66,8 @@ define i8 @and_add_shl_overlap(i8 %x) { ; CHECK-SAME: (i8 [[X:%.*]]) { ; CHECK-NEXT: [[OP1_P2:%.*]] = icmp ule i8 [[X]], 6 ; CHECK-NEXT: call void @llvm.assume(i1 [[OP1_P2]]) -; CHECK-NEXT: [[SHIFT:%.*]] = shl nuw nsw i8 1, [[X]] -; CHECK-NEXT: [[SUB:%.*]] = add nsw i8 [[SHIFT]], -1 +; CHECK-NEXT: [[SHIFT:%.*]] = shl nuw i8 1, [[X]] +; CHECK-NEXT: [[SUB:%.*]] = add i8 [[SHIFT]], -1 ; CHECK-NEXT: [[R:%.*]] = and i8 [[SUB]], 32 |
Can we replace ipsccp with sccp? These tests don't touch IPO, right?