OSDN Git Service

[DAGCombine] Make sext(setcc) combine respect getBooleanContents
authorMichael Kuperstein <mkuper@google.com>
Mon, 1 Aug 2016 19:39:49 +0000 (19:39 +0000)
committerMichael Kuperstein <mkuper@google.com>
Mon, 1 Aug 2016 19:39:49 +0000 (19:39 +0000)
commit8be735fdf712e2f32d898f7099db77eb801e92b4
treef716f0ebacef6d18aaed3dd42496dfe7e071db39
parent16082a39ea9fed8b360a8d342e0dc37cc46c1944
[DAGCombine] Make sext(setcc) combine respect getBooleanContents

We used to combine "sext(setcc x, y, cc) -> (select (setcc x, y, cc), -1, 0)"
Instead, we should combine to (select (setcc x, y, cc), T, 0) where the value
of T is 1 or -1, depending on the type of the setcc, and getBooleanContents()
for the type if it is not i1.

This fixes PR28504.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277371 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/TargetLowering.cpp
test/CodeGen/X86/pr28504.ll [new file with mode: 0644]