This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Remove PromoteIntOp_EXTRACT_SUBVECTOR.
ClosedPublic

Authored by sdesmalen on Sep 20 2021, 3:57 AM.

Details

Summary

This code seems untested and is likely obsolete, because this case
should already be handled by the code that legalizes the result type
of EXTRACT_SUBVECTOR.

Diff Detail

Event Timeline

sdesmalen created this revision.Sep 20 2021, 3:57 AM
sdesmalen requested review of this revision.Sep 20 2021, 3:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 20 2021, 3:57 AM
craig.topper accepted this revision.Sep 20 2021, 12:33 PM

I'm not sure we can write a test for RISCV either. This can only happen if the element type needs to be promoted on the larger vector type, but not the narrower vector type used for the result. I don't even know to exercise this code with fixed vectors. The llvm-cov bot says its untested http://lab.llvm.org:8080/coverage/coverage-reports/coverage/Users/buildslave/jenkins/workspace/coverage/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp.html#L5001. Looks like it was added to support some case with mask vectors on X86, but that case no longer happens. Maybe we can just delete it?

This revision is now accepted and ready to land.Sep 20 2021, 12:33 PM
craig.topper requested changes to this revision.Sep 20 2021, 12:33 PM
This revision now requires changes to proceed.Sep 20 2021, 12:33 PM
craig.topper added inline comments.Sep 20 2021, 12:35 PM
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
5095–5096

The use of MVT instead of EVT here is also questionable. That's probably another vote for dropping it.

sdesmalen updated this revision to Diff 373796.Sep 21 2021, 1:23 AM
sdesmalen retitled this revision from [SelectionDAG] Fix PromoteIntOp_EXTRACT_SUBVECTOR for scalable vectors. to [SelectionDAG] Remove PromoteIntOp_EXTRACT_SUBVECTOR..
sdesmalen edited the summary of this revision. (Show Details)

Changed patch to remove PromoteIntOp_EXTRACT_SUBVECTOR.

I'm not sure we can write a test for RISCV either. This can only happen if the element type needs to be promoted on the larger vector type, but not the narrower vector type used for the result. I don't even know to exercise this code with fixed vectors. The llvm-cov bot says its untested http://lab.llvm.org:8080/coverage/coverage-reports/coverage/Users/buildslave/jenkins/workspace/coverage/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp.html#L5001. Looks like it was added to support some case with mask vectors on X86, but that case no longer happens. Maybe we can just delete it?

Thanks, I wasn't aware of a code-coverage buildbot that actually showed this info, that's very useful. Is there a more friendly interface to get such a report? (Other than manually constructing the URL with a path to the file)

I've removed the function now and think it makes sense, because I can't think of any instance where the result type would be legal, and the (wider vector) input type requiring promotion.

I'm not sure we can write a test for RISCV either. This can only happen if the element type needs to be promoted on the larger vector type, but not the narrower vector type used for the result. I don't even know to exercise this code with fixed vectors. The llvm-cov bot says its untested http://lab.llvm.org:8080/coverage/coverage-reports/coverage/Users/buildslave/jenkins/workspace/coverage/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp.html#L5001. Looks like it was added to support some case with mask vectors on X86, but that case no longer happens. Maybe we can just delete it?

Thanks, I wasn't aware of a code-coverage buildbot that actually showed this info, that's very useful. Is there a more friendly interface to get such a report? (Other than manually constructing the URL with a path to the file)

There's an "llvm-cov" link in the left hand column on llvm.org that should take you to a list of all files.

This revision is now accepted and ready to land.Sep 21 2021, 8:52 AM
This revision was landed with ongoing or failed builds.Sep 22 2021, 6:24 AM
This revision was automatically updated to reflect the committed changes.
bsmith added a subscriber: bsmith.Oct 8 2021, 7:54 AM

I have reverted this patch in 7c68d4b8ff906ee97aa14c6ec97e19aaa766c08a as this code is still required for extracting fixed types from illegal scalable types on SVE, which is used for ACLE predicate types. We are lacking tests for this case, which I shall add.