[llvm] [indvars] Allow widenWithVariantUse to succeed without extend users (PR #71557)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 9 07:47:48 PST 2023


================
@@ -34,11 +34,13 @@ define i16 @foo() {
 ; CHECK-NEXT:    [[J_011:%.*]] = phi i16 [ 0, [[FOR_COND1_PREHEADER]] ], [ [[INC:%.*]], [[FOR_BODY4]] ]
 ; CHECK-NEXT:    [[SUM_110:%.*]] = phi i16 [ [[SUM_012]], [[FOR_COND1_PREHEADER]] ], [ [[ADD5]], [[FOR_BODY4]] ]
 ; CHECK-NEXT:    [[TMP2:%.*]] = add nuw nsw i32 [[INDVAR]], [[TMP0]]
+; CHECK-NEXT:    [[TMP3:%.*]] = sext i16 [[J_011]] to i32
+; CHECK-NEXT:    [[TMP4:%.*]] = add nuw nsw i32 [[TMP3]], [[TMP0]]
----------------
nikic wrote:

I see, LoopFlatten ignores the DeadInsts parameter. It would be best to make it drop the dead insts directly instead of adding adce to tests.

https://github.com/llvm/llvm-project/pull/71557


More information about the llvm-commits mailing list