[PATCH] D78918: [CostModel] Modify BasicTTI getCastInstrCost
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 12 08:34:55 PDT 2020
spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.
LGTM, but give @craig.topper / @RKSimon a day at least to comment further. I can't tell if there are any target-specific issues that can arise from a change like this.
================
Comment at: llvm/test/Transforms/SLPVectorizer/X86/load-merge.ll:115
; CHECK-NEXT: [[T8:%.*]] = lshr i64 [[T1]], 32
-; CHECK-NEXT: [[T9:%.*]] = trunc i64 [[T8]] to i32
-; CHECK-NEXT: [[T10:%.*]] = bitcast i32 [[T9]] to float
-; CHECK-NEXT: [[T11:%.*]] = insertelement <4 x float> [[T7]], float [[T10]], i32 1
+; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> undef, i64 [[T1]], i32 0
+; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x i64> [[TMP1]], i64 [[T8]], i32 1
----------------
I looked at this diff through x86 codegen, and it seems like an improvement to create the vector trunc here. But it's likely a moot point in the motivating real-world example from the bug report because instcombine reduces the IR before SLP sees this form. We may be able to add some load-combining transforms to -vector-combine to catch this.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78918/new/
https://reviews.llvm.org/D78918
More information about the llvm-commits
mailing list