mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198190 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user