OSDN Git Service

[DAGCombiner] try to move bitcast after extract_subvector
authorSanjay Patel <spatel@rotateright.com>
Sun, 12 May 2019 14:43:20 +0000 (14:43 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 12 May 2019 14:43:20 +0000 (14:43 +0000)
commit874cb15d79cd15d4083e1a2b3144d18a8d2c7953
tree66ffec1d025352cce5c6614b72f5e24d7402a67e
parent93f4a114e41a52fec668648acc29dd071fcdc825
[DAGCombiner] try to move bitcast after extract_subvector

I noticed that we were failing to narrow an x86 ymm math op in a case similar
to the 'madd' test diff. That is because a bitcast is sitting between the math
and the extract subvector and thwarting our pattern matching for narrowing:

       t56: v8i32 = add t59, t58
      t68: v4i64 = bitcast t56
    t73: v2i64 = extract_subvector t68, Constant:i64<2>
  t96: v4i32 = bitcast t73

There are a few wins and neutral diffs in the other tests.

Differential Revision: https://reviews.llvm.org/D61806

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360541 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/extractelement-fp.ll
test/CodeGen/X86/madd.ll
test/CodeGen/X86/oddshuffles.ll
test/CodeGen/X86/sad.ll
test/CodeGen/X86/vector-fshl-256.ll
test/CodeGen/X86/vector-fshl-rot-256.ll
test/CodeGen/X86/vector-fshr-256.ll
test/CodeGen/X86/vector-fshr-rot-256.ll
test/CodeGen/X86/vector-rotate-256.ll
test/CodeGen/X86/vector-shift-ashr-256.ll
test/CodeGen/X86/vector-shuffle-256-v4.ll