mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
R600: Consider bitcast when folding const_address node.
Patch by: Vincent Lejeune Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 174098
This commit is contained in:
parent
585a9178bf
commit
fe5c14ff9a
@ -318,6 +318,9 @@ bool AMDGPUDAGToDAGISel::FoldOperands(unsigned Opcode,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ISD::BITCAST:
|
||||
Ops[OperandIdx[i] - 1] = Operand.getOperand(0);
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -991,6 +991,14 @@ SDValue R600TargetLowering::PerformDAGCombine(SDNode *N,
|
||||
return Arg->getOperand(Element);
|
||||
}
|
||||
}
|
||||
if (Arg.getOpcode() == ISD::BITCAST &&
|
||||
Arg.getOperand(0).getOpcode() == ISD::BUILD_VECTOR) {
|
||||
if (ConstantSDNode *Const = dyn_cast<ConstantSDNode>(N->getOperand(1))) {
|
||||
unsigned Element = Const->getZExtValue();
|
||||
return DAG.getNode(ISD::BITCAST, N->getDebugLoc(), N->getVTList(),
|
||||
Arg->getOperand(0).getOperand(Element));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return SDValue();
|
||||
|
Loading…
Reference in New Issue
Block a user