This is an archive of the discontinued LLVM Phabricator instance.

[SVE] Take constant fold fast path for splatted vscale vectors
ClosedPublic

Authored by ctetreau on Apr 3 2020, 5:01 PM.

Details

Summary

This should be a perfectly reasonable operation for scalable vectors.
Currently, it only works for zeroinitializer values of
ScalableVectorType, but the fundamental operation is sound and it should
be possible to make it work for other splats

Diff Detail

Event Timeline

ctetreau created this revision.Apr 3 2020, 5:01 PM
Herald added a project: Restricted Project. · View Herald Transcript

Please add test coverage in llvm/test/Analysis/ConstantFolding/

ctetreau edited the summary of this revision. (Show Details)May 8 2020, 4:18 PM

By the way, this test case was generated via a script. Should I commit the script also? If so, where should I put it?

spatel added a comment.May 9 2020, 6:44 AM

By the way, this test case was generated via a script. Should I commit the script also? If so, where should I put it?

Not sure if you mean the test code itself or the assertion for the tests? llvm/utils/ is probably the spot to find/add scripts that help with testing.

llvm/test/Analysis/ConstantFolding/cmp-vec-fast-path.ll
7 ↗(On Diff #262975)

This should be handled more specifically with "-constprop" (don't need the full power of -instcombine).

Use the standard "utils/update_test_checks.py" to auto-generate the CHECK lines? Can also pre-commit the baseline tests, then update here so we just have diffs for the assertion lines.

ctetreau updated this revision to Diff 269991.Jun 10 2020, 4:13 PM
ctetreau edited the summary of this revision. (Show Details)

rebase

ctetreau updated this revision to Diff 274635.Jun 30 2020, 3:49 PM

fix tests, use new support for getSplatValue workikng with scalable vectors from D82416

ctetreau updated this revision to Diff 305588.Nov 16 2020, 1:45 PM

Necro patch. address code review issues.

rkruppe removed a subscriber: rkruppe.Nov 16 2020, 1:58 PM
ctetreau updated this revision to Diff 305610.Nov 16 2020, 3:09 PM

Fix broken test

This revision is now accepted and ready to land.Nov 17 2020, 1:40 AM
This revision was landed with ongoing or failed builds.Nov 17 2020, 12:45 PM
This revision was automatically updated to reflect the committed changes.