Page MenuHomePhabricator

[LV] Record memory widening decisions (NFCI)
ClosedPublic

Authored by gilr on Sep 25 2021, 9:00 AM.

Details

Summary

Record widening decisions for memory operations within the planned recipes, and use the recorded decisions in code-gen rather than querying the cost model.

Diff Detail

Unit TestsFailed

TimeTest
660 msx64 debian > ORC-x86_64-linux.TestCases/Linux/x86-64::trivial-cxa-atexit.S
Script: -- : 'RUN: at line 3'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang -m64 -c -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/orc/X86_64LinuxConfig/TestCases/Linux/x86-64/Output/trivial-cxa-atexit.S.tmp /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/trivial-cxa-atexit.S
580 msx64 debian > ORC-x86_64-linux.TestCases/Linux/x86-64::trivial-static-initializer.S
Script: -- : 'RUN: at line 7'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang -m64 -c -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/orc/X86_64LinuxConfig/TestCases/Linux/x86-64/Output/trivial-static-initializer.S.tmp /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/trivial-static-initializer.S
690 msx64 debian > ORC-x86_64-linux.TestCases/Linux/x86-64::trivial-tls.S
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang -m64 -c -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/orc/X86_64LinuxConfig/TestCases/Linux/x86-64/Output/trivial-tls.S.tmp /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/orc/TestCases/Linux/x86-64/trivial-tls.S

Event Timeline

gilr created this revision.Sep 25 2021, 9:00 AM
gilr requested review of this revision.Sep 25 2021, 9:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 25 2021, 9:00 AM
fhahn added inline comments.Sep 25 2021, 12:46 PM
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
8781

nit: no () required.

llvm/lib/Transforms/Vectorize/VPlan.h
1517

Should we document both fields?

Ayal added inline comments.Sep 26 2021, 4:59 AM
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
2920

Update above comment? A gather/scatter will be created iff the stride is not consecutive, going either forward or reverse. This includes non-unit strided accesses, which may be part of interleave groups, and non strided accesses.

2927

Above comment, assert, and artificial use of ConsecutiveStride are now redundant; cleanup?

llvm/lib/Transforms/Vectorize/VPlan.h
1534

assert that Reverse implies Consecutive?

Another alternative may be to designate one recipe for Gather/Scatter with arbitrary non-unit strides, and a separate possibly derived recipe for Consecutive/VectorMemoryInstructions, with a Reverse indicator?

1543

ditto

1576

are consecutive and in reverse order

gilr marked 5 inline comments as done.Sep 26 2021, 7:17 AM
gilr updated this revision to Diff 375101.Sep 26 2021, 7:24 AM

Addressed comments.

fhahn accepted this revision.Oct 7 2021, 5:46 AM

LGTM, thanks

llvm/lib/Transforms/Vectorize/VPlan.h
1517

nit: /// for doc-comment

1520

might be good to mention that this also implies Consecutive

1573

nit: /// for doc-comment

This revision is now accepted and ready to land.Oct 7 2021, 5:46 AM
gilr updated this revision to Diff 380370.Oct 18 2021, 6:36 AM

Rebased.

This revision was automatically updated to reflect the committed changes.