Page MenuHomePhabricator

[VP] Add support for vp.inttoptr & vp.ptrtoint

Authored by inclyc on Nov 1 2022, 9:30 AM.



This patch add vp.inttoptr & vp.ptrtoint support by lowering them into
vp.zext / vp.truncate with in SelectionDAGBuilder.

Diff Detail

Event Timeline

inclyc created this revision.Nov 1 2022, 9:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 1 2022, 9:30 AM
inclyc published this revision for review.Nov 1 2022, 9:34 AM
inclyc updated this revision to Diff 472335.Nov 1 2022, 9:42 AM

Drop extra Function Attr

inclyc updated this revision to Diff 472501.Nov 1 2022, 10:09 PM

Add comments

craig.topper added inline comments.Nov 17 2022, 10:32 AM

Probably better to pass Mask and EVL explicitly. Op is the same as Ops[0]


I don't think you need to check the element type.. The number of elements should match.

Something like this looks better to me structurally.

if (VT.bitsGT(Op.getValueType())
  return getNode(ISD::VP_ZERO_EXTEND, DL, VT, Op, Mask, EVL);
if (VT.bitsLT(Op.getValueType())
  return getNode(ISD::VP_TRUNCATE, DL, VT, Op, Mask, EVL);
return Op;

This is OpValues[0] is it not?



inclyc updated this revision to Diff 476307.Nov 17 2022, 6:30 PM

Address comments

  • Pass EVL & Mask Directly
  • Clearer control flow logics
  • OpValues[0]
inclyc marked 4 inline comments as done.Nov 17 2022, 6:31 PM
This revision is now accepted and ready to land.Nov 17 2022, 6:35 PM
inclyc updated this revision to Diff 476311.Nov 17 2022, 6:38 PM

drop extra whitespace in comments

This revision was landed with ongoing or failed builds.Nov 17 2022, 6:43 PM
This revision was automatically updated to reflect the committed changes.