This is an archive of the discontinued LLVM Phabricator instance.

[LegalizeTypes][VP] Add integer promotions support for VP_TRUNCATE
ClosedPublic

Authored by Jimerlife on May 16 2022, 8:05 PM.

Details

Summary

Add promoteRes and promoteOp for VP_TRUNCATE.

I couldn't write tests about VP_TRUNCATE when TargetLowering::TypeWidenVector in RISCV, so I reserved a TODO.

Diff Detail

Event Timeline

Jimerlife created this revision.May 16 2022, 8:05 PM
Jimerlife requested review of this revision.May 16 2022, 8:05 PM
Jimerlife retitled this revision from [LegalizeTypes][VP] Add promotions for VP_TRUNCATE to [LegalizeTypes][VP] Add integer promotions support for VP_TRUNCATE.May 16 2022, 8:22 PM
craig.topper added inline comments.May 16 2022, 11:45 PM
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
1356

Shouldn't we have if and else instead of two ifs?

1393

Use an if and two returns instead of ?: operator.

2099

Use an if and two returns.

Address comments

Jimerlife added inline comments.May 17 2022, 12:22 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
1356

Done. Use if and else instead of two ifs

1393

Done.

2099

Done

This revision is now accepted and ready to land.May 17 2022, 10:52 AM
This revision was landed with ongoing or failed builds.May 19 2022, 12:38 AM
This revision was automatically updated to reflect the committed changes.