Page MenuHomePhabricator

[NewPassManager] Add tuning option: SLPVectorization [clang-change]
ClosedPublic

Authored by asbirlea on May 6 2019, 4:07 PM.

Diff Detail

Repository
rC Clang

Event Timeline

asbirlea created this revision.May 6 2019, 4:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2019, 4:07 PM
chandlerc accepted this revision.May 6 2019, 4:16 PM

Can you update some Clang IR generation test that uses these flags to run w/ the new PM? It should fail without this and pass with this.

LGTM w/ that test updated.

This revision is now accepted and ready to land.May 6 2019, 4:16 PM
asbirlea updated this revision to Diff 198540.May 7 2019, 3:04 PM

Added test. The last RUN line fails before this patch (i.e. the flag to disable vectorization was not used by the new pass manager)

asbirlea updated this revision to Diff 198561.May 7 2019, 4:15 PM

Rename new test for clarity.

chandlerc requested changes to this revision.May 7 2019, 4:20 PM

The file name of the test seems odd? How about vectorize-loops.c? I'd also make it a C test and put it in test/CodeGen instead of a C++ test.

test/CodeGenCXX/no-pragma-loop.cpp
7 ↗(On Diff #198540)

I'd check for an instruction on a vector type as the block labels aren't really that stable.

Should be able to just check for something like:

// CHECK-LABEL: define @vectorize_loop_test {
// CHECK: mul <{{[0-9]+}} x double>

Or something...

Also, you'll want to explicitly pass a target triple here and require that target to be registered so we're not flaky when the host target changes.

This revision now requires changes to proceed.May 7 2019, 4:20 PM
asbirlea updated this revision to Diff 198562.May 7 2019, 4:41 PM

Updated test.

(Sorry for still more comments)

test/CodeGen/loop-vectorize.c
11

You'll want to check that the vector form *doesn't* show up. I would expect this to pass even w/ vectorization enabled due to potential fallback loops.

asbirlea updated this revision to Diff 198587.May 7 2019, 11:43 PM

Updated test.
Improvement suggestions are always *very* much welcome!

asbirlea marked an inline comment as done.May 7 2019, 11:44 PM
This revision is now accepted and ready to land.May 17 2019, 2:52 PM
This revision was automatically updated to reflect the committed changes.
rnk added a subscriber: rnk.May 23 2019, 1:25 PM
rnk added inline comments.
test/CodeGen/loop-vectorize.c
1

Please do not use %clang for codegen tests, please only use %clang_cc1.