Page MenuHomePhabricator

[DAGCombine] Fold insert_subvector(bitcast(x),bitcast(y)) -> bitcast(insert_subvector(x,y))
ClosedPublic

Authored by RKSimon on Mar 10 2019, 4:16 AM.

Details

Summary

Move this combine from x86 into generic DAGCombine, which currently only manages cases where the bitcast is between types of the same scalarsize.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Mar 10 2019, 4:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2019, 4:17 AM
nikic added inline comments.Mar 13 2019, 2:38 PM
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
18349

Should use getVectorIdxTy?

RKSimon updated this revision to Diff 190902.Mar 15 2019, 2:36 PM

Use getVectorIdxTy

nikic added inline comments.Mar 20 2019, 12:56 PM
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
18353

Can things like insert_subvector x:v7i8, (bitcast y:v2i16 to v4i8), 2 occur? Do we need to check NumElts % Scale == 0 here as well?

nikic requested changes to this revision.May 11 2019, 1:47 AM

Reverse ping. Apart from the previous comment this looks good, and I saw you already added some tests for that as well :)

This revision now requires changes to proceed.May 11 2019, 1:47 AM

Reverse ping. Apart from the previous comment this looks good, and I saw you already added some tests for that as well :)

Sorry this completely fell off my radar (again) - will take a look

RKSimon updated this revision to Diff 202592.Jun 2 2019, 4:15 AM

Check for (NumElts % Scale == 0) as well

Sorry for taking so long with this @nikic !

nikic accepted this revision.Jun 2 2019, 6:13 AM

LGTM

This revision is now accepted and ready to land.Jun 2 2019, 6:13 AM
This revision was automatically updated to reflect the committed changes.