This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fix i64<->f64 and i32<->f32 bitcasts with VLS vectors enabled.
ClosedPublic

Authored by craig.topper on May 31 2022, 5:56 PM.

Details

Summary

We enable a custom handler to optimize conversions between scalars
and fixed vectors. Unfortunately, the custom handler picks up scalar
to scalar conversions as well. If the scalar types are both legal,
we wouldn't match any of the fixed vector cases and would return SDValue()
causing LegalizeDAG to expand the bitcast through memory.

This patch fixes this by checking if it's a scalar to scalar conversion
and returns Op if both types are legal.

Diff Detail

Event Timeline

craig.topper created this revision.May 31 2022, 5:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2022, 5:56 PM
craig.topper requested review of this revision.May 31 2022, 5:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2022, 5:56 PM
craig.topper edited the summary of this revision. (Show Details)May 31 2022, 5:57 PM
frasercrmck accepted this revision.May 31 2022, 11:58 PM

Oh dear, thanks for catching that. LGTM

This revision is now accepted and ready to land.May 31 2022, 11:58 PM