This is an archive of the discontinued LLVM Phabricator instance.

[LegalizeVectorTypes][VP] Add widen and split support for VP_SETCC
ClosedPublic

Authored by Jimerlife on May 11 2022, 8:36 PM.

Diff Detail

Event Timeline

Jimerlife created this revision.May 11 2022, 8:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2022, 8:36 PM
Jimerlife requested review of this revision.May 11 2022, 8:36 PM
frasercrmck added a subscriber: simoll.

I think @simoll should be included in VP reviews.

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
5230

What if we hit this case? It looks like it might silently just work and generate non-VP code. It's not the end of the world but might be unexpected. Can we test this particular path with RISC-V? I'm not sure we can..

My first thought is that maybe we should add support for splitting VP_SETCC first so we know this function works in principle, then come back to widening afterwards.

5257

Unnecessary parens ()

Jimerlife retitled this revision from [LegalizeVectorTypes][VP] Add widening support for VP_SETCC to [LegalizeVectorTypes][VP] Add widen and split support for VP_SETCC.
Jimerlife edited the summary of this revision. (Show Details)

add splitOp and splitRes for vp.setcc

Jimerlife marked an inline comment as done.May 16 2022, 12:31 AM
Jimerlife added inline comments.
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
5230

I add SplitVecOp_VSETCC and SplitVecRes_SETCC for vp.setcc

craig.topper added inline comments.May 17 2022, 12:03 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
2119

This assert provides no value. It's the oppose of the if you wrote above.

3487

Use an else with an assert(N->getOpcode() == ISD::VP_SETCC) inside

Jimerlife updated this revision to Diff 429953.May 17 2022, 1:36 AM
Jimerlife added inline comments.May 17 2022, 1:38 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
2119

Now, I used if and else instead.Thanks.

3487

Done. Use an else instead.

craig.topper added inline comments.May 17 2022, 10:51 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
5255

You can drop the else. The if returned

Jimerlife updated this revision to Diff 430219.May 17 2022, 7:02 PM

rebase and address comment

Jimerlife added inline comments.May 17 2022, 7:03 PM
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
5255

Drop the else and returned in if

This revision is now accepted and ready to land.May 17 2022, 7:14 PM
frasercrmck added inline comments.May 18 2022, 2:07 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
3488

I suppose this is a non-VP extend? Could this be a TODO to use a VP extend?

frasercrmck accepted this revision.May 18 2022, 2:08 AM

LGTM - that last comment isn't a blocker, btw.

This revision was landed with ongoing or failed builds.May 19 2022, 12:54 AM
This revision was automatically updated to reflect the committed changes.