This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Change representation of shuffle masks in MachineOperand.
ClosedPublic

Authored by efriedma on Jan 13 2020, 3:51 PM.

Details

Summary

We're planning to remove the shufflemask operand from ShuffleVectorInst (D72467); fix GlobalISel so it doesn't depend on that Constant.

The change to prelegalizercombiner-shuffle-vector.mir happens because the input contains a literal "-1" in the mask (so the parser/verifier weren't really handling it properly). We now treat it as equivalent to "undef" in all contexts.

Diff Detail

Event Timeline

efriedma created this revision.Jan 13 2020, 3:51 PM
arsenm added inline comments.Jan 13 2020, 4:08 PM
llvm/include/llvm/CodeGen/MachineOperand.h
178

Won't this double the size of every MachineOperand? That's an extremely high cost

arsenm added inline comments.Jan 13 2020, 4:11 PM
llvm/include/llvm/CodeGen/MachineOperand.h
178

I think it's important to avoid increasing the size of MachineOperand at any cost. Whatever goes here should fit in a single pointer to avoid the increase

efriedma marked an inline comment as done.Jan 13 2020, 4:25 PM
efriedma added inline comments.
llvm/include/llvm/CodeGen/MachineOperand.h
178

This patch doesn't make MachineOperand larger. ContentsUnion is at least two pointers wide anyway, for MO_Register etc. (There's a static_assert in the MachineOperand constructor that checks the size of both ContentsUnion and MachineOperand.)

arsenm accepted this revision.Jan 13 2020, 4:39 PM
This revision is now accepted and ready to land.Jan 13 2020, 4:39 PM
This revision was automatically updated to reflect the committed changes.