]> granicus.if.org Git - llvm/commit
[DAGCombiner] fold sext into negation
authorSanjay Patel <spatel@rotateright.com>
Thu, 28 Mar 2019 15:46:02 +0000 (15:46 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 28 Mar 2019 15:46:02 +0000 (15:46 +0000)
commite540281a26fc54bf5707f8b8dca070f99ee5617e
treea1af07b5d0686859132e2833f9c9887ea375e15a
parentf3dc6d4c2003dce6e3e11d9e37b5b8db0b915f18
[DAGCombiner] fold sext into negation

As noted in D59818:
  %z = zext i8 %x to i32
  %neg = sub i32 0, %z
  %r = sext i32 %neg to i64
  =>
  %z2 = zext i8 %x to i64
  %r = sub i64 0, %z2

https://rise4fun.com/Alive/KzSR

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357178 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/vector-compare-all_of.ll
test/CodeGen/X86/vector-compare-any_of.ll
test/CodeGen/X86/vector-sext.ll