Page MenuHomePhabricator

AVX-512: Removed AssertZext node before TRUNCATE

Authored by delena on Jul 27 2016, 4:19 AM.



Removed AssertZext node, which was inserted between X86ISD::SETCC and "truncate to i1".
Added a pattern to the .td file, as Eli suggested.

Diff Detail


Event Timeline

delena updated this revision to Diff 65702.Jul 27 2016, 4:19 AM
delena retitled this revision from to AVX-512: Removed AssertZext node before TRUNCATE.
delena updated this object.
delena added reviewers: eli.friedman, igorb.
delena set the repository for this revision to rL LLVM.
delena added a subscriber: llvm-commits.
eli.friedman accepted this revision.Jul 27 2016, 11:37 AM
eli.friedman edited edge metadata.

LGTM... with the caveat that I'm not sure I completely understand how the AVX-512 boolean registers work.

2133 ↗(On Diff #65702)

Maybe you could match this with patterns rather than C++ code?

This revision is now accepted and ready to land.Jul 27 2016, 11:37 AM
delena added inline comments.
2133 ↗(On Diff #65702)

I can't find another solution right now. I don't want to set a new "truncate_z" node in DAG because the regular "truncate" may be merged with "ext" nodes. I'll add Simon, may be he has another idea?

RKSimon added inline comments.Jul 28 2016, 5:12 AM
2133 ↗(On Diff #65702)

Possibly split this into 2 simpler pat frags? trunc_setcc and trunc_mask_i1?

Also you should probably use isa<ConstantSDNode> instead of dyn_cast<ConstantSDNode>.

delena updated this revision to Diff 65921.Jul 28 2016, 6:29 AM

Uploaded a new patch according to Simon's comments.

This revision was automatically updated to reflect the committed changes.