If extload is legal, following transform
(zext (select c, load1, load2)) -> (select c, zextload1, zextload2)
can save one ext instruction.
Paths
| Differential D95086
[DAGCombiner] Transform (zext (select c, load1, load2)) -> (select c, zextload1, zextload2) ClosedPublic Authored by Carrot on Jan 20 2021, 1:14 PM.
Details Summary If extload is legal, following transform (zext (select c, load1, load2)) -> (select c, zextload1, zextload2) can save one ext instruction.
Diff Detail
Event TimelineHerald added subscribers: ecnelises, pengfei, hiraditya. · View Herald TranscriptJan 20 2021, 1:14 PM
Comment Actions Add more test cases.
Comment Actions @Carrot I've added the new tests to trunk along with some vselect test cases - please can you rebase?
Carrot marked an inline comment as done.
Comment Actions ANY_EXTEND of SEXTLOAD/ZEXTLOAD should not be allowed.
Comment Actions LGTM - cheers
This revision is now accepted and ready to land.Feb 17 2021, 6:35 AM Closed by commit rG66f2d09ebf8d: [DAGCombiner] Transform (zext (select c, load1, load2)) -> (select c, zextload1… (authored by Carrot). · Explain WhyFeb 18 2021, 1:16 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 324753 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/select-ext.ll
|
We also need to ensure that the loads aren't already a extload - or are either the same type of extension (or just ISD::EXTLOAD which I guess we can replace). This will need more tests (inc negative tests).