This allows vector fabs to be removed in more cases.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
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.