This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Teach cannotBeOrderedLessThanZeroImpl to handle vector constants.
ClosedPublic

Authored by craig.topper on Feb 24 2018, 11:07 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Feb 24 2018, 11:07 PM

This is an improvement, so I won't hold it up if you want to get it committed...

But I wonder if here - and maybe also for D43774 - we can enhance PatternMatching for FP as we've recently done for integer with:
D42818
rL325466

The benefit is that those can also match vectors with undef lanes. Also, once we have that templated in PatternMatch, we won't have to keep rewriting this vector-constant loop with getAggregateElement(). I was looking at adding that anyway to improve some FP instcombines, but I hadn't gotten there yet.

I'd like to go ahead and get this in. I have another follow up patch to teach cannotBeOrderedLessThanZeroImpl to walk through ExtractElement too. The original place I saw this was two fabs on elements extracted from a vector.

But I think you're probably right that we should probably improve pattern matching for FP here.

spatel accepted this revision.Feb 26 2018, 1:27 PM

LGTM.

I'll try to post a proposal for the FP pattern matching enhancement soon.

This revision is now accepted and ready to land.Feb 26 2018, 1:27 PM
This revision was automatically updated to reflect the committed changes.