Function InstCombinerImpl::foldSelectOpOp can do following transformation
(select c, ext(TI), ext(FI)) ==> (ext(select c, TI, FI))
If TI and FI are load, then ext is free on x86, in this situation we should not move ext out of select.
Differential D94851
[InstCombine] Don't transform (select c, ext(TI), ext(FI)) if ext is free Carrot on Jan 15 2021, 6:04 PM. Authored by
Details
Function InstCombinerImpl::foldSelectOpOp can do following transformation (select c, ext(TI), ext(FI)) ==> (ext(select c, TI, FI)) If TI and FI are load, then ext is free on x86, in this situation we should not move ext out of select.
Diff Detail Event TimelineComment Actions InstCombine is a canonicalization pass, and by design it must not make use of TTI. Comment Actions Thanks for the info. I will discard this patch and reverse the pattern at function CodeGenPrepare::optimizeExt. Comment Actions Not really sure why that would go into CodeGenPrepare, which is a temporary hack, Comment Actions Because I found CodeGenPrepare::optimizeExt does some ext(load( )) optimization. |