}
// Try to fold a VTRUNCUS or VTRUNCS into a truncating store.
- if (!St->isTruncatingStore() && StoredVal.hasOneUse() &&
+ if (!St->isTruncatingStore() &&
(StoredVal.getOpcode() == X86ISD::VTRUNCUS ||
StoredVal.getOpcode() == X86ISD::VTRUNCS) &&
+ StoredVal.hasOneUse() &&
TLI.isTruncStoreLegal(StoredVal.getOperand(0).getValueType(), VT)) {
bool IsSigned = StoredVal.getOpcode() == X86ISD::VTRUNCS;
return EmitTruncSStore(IsSigned, St->getChain(),
}
// Try to fold a extract_element(VTRUNC) pattern into a truncating store.
- if (!St->isTruncatingStore() && StoredVal.hasOneUse()) {
+ if (!St->isTruncatingStore()) {
auto IsExtractedElement = [](SDValue V) {
- if (V.getOpcode() == ISD::TRUNCATE && V.getOperand(0).hasOneUse())
+ if (V.getOpcode() == ISD::TRUNCATE && V.hasOneUse())
V = V.getOperand(0);
unsigned Opc = V.getOpcode();
- if (Opc == ISD::EXTRACT_VECTOR_ELT || Opc == X86ISD::PEXTRW) {
- if (V.getOperand(0).hasOneUse() && isNullConstant(V.getOperand(1)))
- return V.getOperand(0);
- }
+ if ((Opc == ISD::EXTRACT_VECTOR_ELT || Opc == X86ISD::PEXTRW) &&
+ isNullConstant(V.getOperand(1)) && V.hasOneUse() &&
+ V.getOperand(0).hasOneUse())
+ return V.getOperand(0);
return SDValue();
};
if (SDValue Extract = IsExtractedElement(StoredVal)) {