[llvm-dev] Possible missing DAGCombine opportunity?

陳韋任 via llvm-dev
2017-06-19T10:32:22Z

Hi All,

  The initial SelectionDAG I have has the following snippet.

    t10: i64,ch = load<LD8[%1](align=4)> t0, t4, undef:i32
            t13: i64 = srl t10, Constant:i32<8>
          t14: i32 = truncate t13

and after DAGCombine the SelectionDAG becomes,

    t10: i64,ch = load<LD8[%1](align=4)> t0, t4, undef:i32
            t30: i32 = truncate t10
          t36: i32 = srl t30, Constant:i32<6>

Here I want to load i32 if possible. Can above pattern be combined further?
If not, I find it's because srl and truncate be swapped, and the truncate in
the middle blocks DAGCombine combine srl and load. Any idea on why
DAGCombine perform this way?

Thanks.

Regards,
chenwj

--
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20170619/2606fdb9/attachment.html>