Page MenuHomePhabricator

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

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

Unit TestsFailed

TimeTest
90 mswindows > LLVM.Analysis/ConstantFolding::vscale.ll
Script: -- : 'RUN: at line 2'; c:\ws\w6\llvm-project\premerge-checks\build\bin\opt.exe < C:\ws\w6\llvm-project\premerge-checks\llvm\test\Analysis\ConstantFolding\vscale.ll -constprop -S -verify | c:\ws\w6\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w6\llvm-project\premerge-checks\llvm\test\Analysis\ConstantFolding\vscale.ll

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
8

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.Tue, Jun 30, 3:49 PM

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