summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorKevin Qin <Kevin.Qin@arm.com>2013-12-30 02:05:13 +0000
committerKevin Qin <Kevin.Qin@arm.com>2013-12-30 02:05:13 +0000
commitede9ce1933bb2c7ed3c4f82f32cd381bf4151a61 (patch)
tree9ec3d863e1142d23ca21d262984f8cb7e8d62766 /llvm/lib/CodeGen
parent751d635a2adc85ae9e5f7d1413deb8dbc72fa634 (diff)
downloadbcm5719-llvm-ede9ce1933bb2c7ed3c4f82f32cd381bf4151a61.tar.gz
bcm5719-llvm-ede9ce1933bb2c7ed3c4f82f32cd381bf4151a61.zip
Fix a bug in DAGcombiner about zero-extend after setcc.
For AArch64 backend, if DAGCombiner see "sext(setcc)", it will combine them together to a single setcc with extended value type. Then if it see "zext(setcc)", it assumes setcc is Vxi1, and try to create "(and (vsetcc), (1, 1, ...)". While setcc isn't Vxi1, DAGcombiner will create wrong node and get wrong code emitted. llvm-svn: 198190
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 68d0521e763..3b87922b789 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -4970,7 +4970,8 @@ SDValue DAGCombiner::visitZERO_EXTEND(SDNode *N) {
}
if (N0.getOpcode() == ISD::SETCC) {
- if (!LegalOperations && VT.isVector()) {
+ if (!LegalOperations && VT.isVector() &&
+ N0.getValueType().getVectorElementType() == MVT::i1) {
// zext(setcc) -> (and (vsetcc), (1, 1, ...) for vectors.
// Only do this before legalize for now.
EVT N0VT = N0.getOperand(0).getValueType();
OpenPOWER on IntegriCloud