[llvm] [InstCombine] InstCombine should fold frexp of select to select of frexp (PR #121227)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 10 00:10:42 PST 2025


nikic wrote:

> > > I.e. do the transform in two steps, first pushing frexp over select, and then the extractvalue? (Probably implementing #112408 would automatically do this?)
> 
> I don't see isTriviallyVectorizable used in InstCombine so I don't think that would help.

isTriviallyVectorizable is used by isNotCrossLaneOperation (but we can also add it to isNotCrossLaneOperation independently, it's just how all the other intrinsics are currently handled).

> Do you mean such that we would end up producing a select of struct?

Yes, that's what I had in mind. We'd create the select of struct and then fold in the extractvalue if possible. Is the concern here that doing the transform if we can't then fold extractvalue is non-profitable?

https://github.com/llvm/llvm-project/pull/121227


More information about the llvm-commits mailing list