[PATCH] D28907: [SLP] Fix for PR30787: Failure to beneficially vectorize 'copyable' elements in integer binary ops.

Dinar Temirbulatov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 9 06:06:09 PDT 2017


dtemirbulatov added inline comments.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:3639
+  // for such operations.
+  if (VL.size() > 2) {
+    unsigned SameOrAlt = 0;
----------------
ABataev wrote:
> I think you can check it earlier
Done.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:3641
+    unsigned SameOrAlt = 0;
+    Instruction *OpInstr = cast<Instruction>(OpValue);
+    const unsigned AltOpcode = getAltOpcode(OpInstr->getOpcode());
----------------
ABataev wrote:
> `auto *OpInstr`
Done.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:3644
+    for (Value *V : VL) {
+      Instruction *Instr = cast<Instruction>(V);
+      if (sameOpcodeOrAlt(OpInstr->getOpcode(), AltOpcode, Instr->getOpcode()))
----------------
ABataev wrote:
> `auto *Instr`
Done.


================
Comment at: test/Transforms/SLPVectorizer/SystemZ/pr34619.ll:1
+; RUN: opt < %s -mtriple=systemz-unknown -mcpu=z13 -slp-vectorizer
+%struct.ImageParameters.11.131.155.323.491.899.923.947.971.995.1043.1067.1091.1115.1139.1187.1235.1307.1331.1355.1379.1595.1691.1883.1907.2027.2099.2387.2411.2507.2531.2771.3179.3203.3227.3251.3275.3443.3467.3683.4115.4379.4859.6058.10.21.32.43.54.549.560 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8**, i8**, i32, i32***, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [9 x [16 x [16 x i16]]], [5 x [16 x [16 x i16]]], [9 x [8 x [8 x i16]]], [2 x [4 x [16 x [16 x i16]]]], [16 x [16 x i16]], [16 x [16 x i32]], i32****, i32***, i32***, i32***, i32****, i32****, %struct.Picture.8.128.152.320.488.896.920.944.968.992.1040.1064.1088.1112.1136.1184.1232.1304.1328.1352.1376.1592.1688.1880.1904.2024.2096.2384.2408.2504.2528.2768.3176.3200.3224.3248.3272.3440.3464.3680.4112.4376.4856.6055.7.18.29.40.51.546.557*, %struct.Slice.7.127.151.319.487.895.919.943.967.991.1039.1063.1087.1111.1135.1183.1231.1303.1327.1351.1375.1591.1687.1879.1903.2023.2095.2383.2407.2503.2527.2767.3175.3199.3223.3247.3271.3439.3463.3679.4111.4375.4855.6054.6.17.28.39.50.545.556*, %struct.macroblock.9.129.153.321.489.897.921.945.969.993.1041.1065.1089.1113.1137.1185.1233.1305.1329.1353.1377.1593.1689.1881.1905.2025.2097.2385.2409.2505.2529.2769.3177.3201.3225.3249.3273.3441.3465.3681.4113.4377.4857.6056.8.19.30.41.52.547.558*, i32*, i32*, i32, i32, i32, i32, [4 x [4 x i32]], i32, i32, i32, i32, i32, double, i32, i32, i32, i32, i16******, i16******, i16******, i16******, [15 x i16], i32, i32, i32, i32, i32, i32, i32, i32, [6 x [32 x i32]], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [1 x i32], i32, i32, [2 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.DecRefPicMarking_s.10.130.154.322.490.898.922.946.970.994.1042.1066.1090.1114.1138.1186.1234.1306.1330.1354.1378.1594.1690.1882.1906.2026.2098.2386.2410.2506.2530.2770.3178.3202.3226.3250.3274.3442.3466.3682.4114.4378.4858.6057.9.20.31.42.53.548.559*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, double**, double***, i32***, double**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [3 x [2 x i32]], [2 x i32], i32, i32, i16, i32, i32, i32, i32, i32 }
----------------
ABataev wrote:
> Could you simplify this test? 
Done.


https://reviews.llvm.org/D28907





More information about the llvm-commits mailing list