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.
Paths
| Differential D94851
[InstCombine] Don't transform (select c, ext(TI), ext(FI)) if ext is free AbandonedPublic Authored by Carrot on Jan 15 2021, 6:04 PM.
Details
Summary 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. This revision now requires changes to proceed.Jan 16 2021, 1:58 AM 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.
Revision Contents
Diff 317131 llvm/include/llvm/Transforms/InstCombine/InstCombiner.h
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/select-ext.ll
|