[PATCH] D132591: [LV] Use safe-divisor lowering for fixed vectors if profitable

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 06:31:14 PDT 2022


fhahn accepted this revision.
fhahn added a comment.

> I have no concerns with simply enabling this. We have no evidence of problems, and we can revert if actual performance issues are revealed.

Enabling this by default should be fine, AFAICT.

LGTM, thanks! I think it would be good to add ` -force-widen-divrem-via-safe-divisor=0` to `induction.ll` and `pr44488-predication.ll` to make sure they test the same as before.



================
Comment at: llvm/test/Transforms/LoopVectorize/induction.ll:2036
+; CHECK-NEXT:    [[VEC_IND:%.*]] = phi <2 x i32> [ <i32 0, i32 1>, [[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], [[VECTOR_BODY]] ]
+; CHECK-NEXT:    [[VEC_PHI:%.*]] = phi <2 x i32> [ zeroinitializer, [[VECTOR_PH]] ], [ [[TMP7:%.*]], [[VECTOR_BODY]] ]
 ; CHECK-NEXT:    [[TMP0:%.*]] = add i32 [[INDEX]], 0
----------------
I think the division here is used intentionally to force uses of an IV in predicated blocks and with this change we are now not checking for that scenario any longer. This should probably use ` -force-widen-divrem-via-safe-divisor=0` to preserve the original behavior.


================
Comment at: llvm/test/Transforms/LoopVectorize/pr44488-predication.ll:11
 
 define i16 @test_true_and_false_branch_equal() {
 ; CHECK-LABEL: @test_true_and_false_branch_equal(
----------------
It looks like this test specially tests for a special case with branches and it should probably use ` -force-widen-divrem-via-safe-divisor=0` .


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132591/new/

https://reviews.llvm.org/D132591



More information about the llvm-commits mailing list