This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][test] Add test of binop followed by extractelement.
ClosedPublic

Authored by jacquesguan on Jul 12 2022, 1:12 AM.

Diff Detail

Event Timeline

jacquesguan created this revision.Jul 12 2022, 1:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2022, 1:12 AM
jacquesguan requested review of this revision.Jul 12 2022, 1:12 AM

I've only briefly looked at shouldScalarizeBinop but it sounds like it should theoretically work for scalable vectors (barring an initial check against BUILD_VECTOR) - should we add some scalable-vector tests here too while we're at it? I don't know if you're planning on that change in the future but having consistency sounds desirable to me. Or at least we could make it clear this patch adds fixed-vector tests.

Add scalable vector cases.

I've only briefly looked at shouldScalarizeBinop but it sounds like it should theoretically work for scalable vectors (barring an initial check against BUILD_VECTOR) - should we add some scalable-vector tests here too while we're at it? I don't know if you're planning on that change in the future but having consistency sounds desirable to me. Or at least we could make it clear this patch adds fixed-vector tests.

Thanks for advice, I added scalable cases. And yes, it could work on scalable vectors too, I am doing the next patch which changes the DAGCombiner to enable these combinations for scalable vectors.

reames accepted this revision.Jul 12 2022, 9:56 AM

LGTM w/required changes before commit.

llvm/test/CodeGen/RISCV/rvv/extractelt-fp-rv32.ll
485

Naming wise, "ext" makes me think "extend" not "extractelement".

I'd suggest extractelt_<type>_<op>_splat.

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-extract.ll
653

Meta comment: "1" and "0" are special edge cases for mul and div. Please use a constant which is not an edge case if you're not testing that behavior.

662

Example of previous comment causing less than helpful test output.

This revision is now accepted and ready to land.Jul 12 2022, 9:56 AM

Address comment.

jacquesguan marked 3 inline comments as done.Jul 12 2022, 11:25 PM
jacquesguan added inline comments.
llvm/test/CodeGen/RISCV/rvv/extractelt-fp-rv32.ll
485

Done.

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-extract.ll
653

Done.

662

Done.

This revision was landed with ongoing or failed builds.Jul 12 2022, 11:54 PM
This revision was automatically updated to reflect the committed changes.
jacquesguan marked 3 inline comments as done.