This is an archive of the discontinued LLVM Phabricator instance.

[Polly][ScopDetect] Add option -polly-allow-nonaffine-read and enable by default.
AcceptedPublic

Authored by Meinersbur on Jul 26 2018, 1:32 PM.

Details

Summary

Read-only non-affine memory reads are not as destructive to the schedulability of a SCoP as writes are. Typical use cases such as table lookups have no influence on how statements can be arranged relative to other statements in the SCoP. This patch allows non-affine read accesses by default, but non-affine writes will still be rejected unless the -polly-allow-nonaffine flag is passed.

Table lookups are common in codes that @proton is working on adding to LLVM's test-suite.

Diff Detail

Event Timeline

Meinersbur created this revision.Jul 26 2018, 1:32 PM

Does this still allow disproving data dependences?

Does this still allow disproving data dependences?

Just like -polly-allow-nonaffine acesses will be are overestimated to any element in an array. It does not affect dependence checks for other arrays. If the array is not written to at all in the SCoP, there are not even additional dependences.

grosser accepted this revision.Jul 28 2018, 10:43 PM

Hi Michael,

this changes works for me. Thanks Michael.

Best,
Tobias

This revision is now accepted and ready to land.Jul 28 2018, 10:43 PM

Cannot commit this as it miscompiles a few test-suite tests (as does -polly-allow-nonaffine):

FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pabsw_239.test (64 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_packssdw_217.test (67 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_packusdw_296.test (73 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_paddsw_102.test (97 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_paddusw_104.test (104 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_paddw_92.test (110 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pavgw_127.test (119 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pavgw_128.test (120 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pcmpeqw_113.test (146 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pcmpgtw_114.test (160 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pmaxsw_129.test (174 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pmaxuw_283.test (186 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pminsw_130.test (194 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pminuw_284.test (206 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pmulhuw_110.test (210 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pmulhuw_134.test (212 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pmulhuw_133.test (213 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pmulhuw_135.test (214 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pmulhw_106.test (227 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pmulhw_107.test (228 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pmulhw_109.test (230 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pmulhw_108.test (231 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_pmullw_94.test (248 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_psubsw_103.test (265 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_psubusw_105.test (273 of 1340)
FAIL: test-suite :: Bitcode/simd_ops/simd_ops_test_op_psubw_93.test (281 of 1340)
NOEXE: test-suite :: External/SPEC/CFP2017rate/526.blender_r/526.blender_r.test (532 of 1340)
FAIL: test-suite :: External/SPEC/CINT2006/401.bzip2/401.bzip2.test (554 of 1340)
FAIL: test-suite :: External/SPEC/CINT2006/458.sjeng/458.sjeng.test (563 of 1340)
FAIL: test-suite :: External/SPEC/CINT2017rate/502.gcc_r/502.gcc_r.test (569 of 1340)
FAIL: test-suite :: External/SPEC/CINT2017speed/602.gcc_s/602.gcc_s.test (578 of 1340)
FAIL: test-suite :: MultiSource/Benchmarks/TSVC/ControlLoops-flt/ControlLoops-flt.test (741 of 1340)
FAIL: test-suite :: MultiSource/Benchmarks/TSVC/ControlLoops-dbl/ControlLoops-dbl.test (742 of 1340)
FAIL: test-suite :: Polybench/Polybench-boost/linear-algebra/kernels/3mm/Pboost_3mm.test (1021 of 1340)

Interesting. Any idea what is going wrong here?