chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.79k stars 421 forks source link

RV integration emits "loop not vectorized" warnings/remarks #11678

Closed mppf closed 5 years ago

mppf commented 5 years ago

After PR #11673, when RV is enabled, the Chapel compiler emits llvm.vectorize.enable metadata. When the stock LLVM LoopVectorizer (not RV) sees these metadata, it emits a lot of "loop not vectorized" remarks and warnings. This interferes with testing (and the prediff-ignore-remarks is a workaround).

export CHPL_SYSTEM_PREDIFF=`pwd`/util/test/prediff-ignore-remarks
simoll commented 5 years ago

How about we bypass that issue by using different metadata for RV (e.g. rv.vectorize.enable, instead of llvm.vectorize.enable)? That way you can leave LLVM's LV in the pipeline and have RV on annotated loops without spurious warnings/remarks.

mppf commented 5 years ago

Does RV already support rv.vectorize.enable? I'd be happy to use that instead. I'm sure there's some way to turn off the loop vectorizer remarks, I just havn't found it to date.

simoll commented 5 years ago

Well, it does now.. https://github.com/cdl-saarland/rv/commit/4965914c0e85a5d3db816e6fefed2a73d0fe4ed3

mppf commented 5 years ago

@simoll - perhaps would it make more sense to have RV simply remove the metadata after it vectorizes the loop? Generally speaking, I'm not sure that stacking RV and the LoopVectorizer is the best idea, because when both vectorizers operate, the result is 2 vectorized loop bodies. RV vectorizes it, and then the LoopVectorizer vectorizes the scalar left-over loop, which probably doesn't help in general actually since the left over loop has a small trip count.

simoll commented 5 years ago

We could protect the remainder loop from vectorization (by LLVM LV) again with MD annotations {"llvm.loop.vectorize.enable", 0}