IAddressSpace);
if (VCost > ICost + JCost)
return false;
+
+ // FIXME: We don't want to fuse to a type that will be split, even
+ // if the two input types will also be split and there is no other
+ // associated cost. This check depends on the fact
+ // that the current implementation of getMemoryOpCost returns only
+ // the type-splitting cost.
+ if (VCost > 1)
+ return false;
+
CostSavings = ICost + JCost - VCost;
}
} else {
if (VCost > ICost + JCost)
return false;
+
+ // FIXME: We don't want to fuse to a type that will be split, even
+ // if the two input types will also be split and there is no other
+ // associated cost. This check depends on the fact
+ // that the current implementation of getMemoryOpCost returns only
+ // the type-splitting cost (and does nothing else).
+ unsigned VTypeCost = VTTI->getMemoryOpCost(I->getOpcode(), VT1, 0, 0);
+ if (VTypeCost > 1)
+ return false;
+
CostSavings = ICost + JCost - VCost;
}