We can actually have dependences between accesses with different
underlying types. Bail in this case.
A test will follow shortly.
llvm-svn: 262267
unsigned NumForwarding = 0;
for (const StoreToLoadForwardingCandidate Cand : StoreToLoadDependences) {
DEBUG(dbgs() << "Candidate " << Cand);
+ // Only progagate value if they are of the same type.
+ if (Cand.Store->getPointerOperand()->getType() !=
+ Cand.Load->getPointerOperand()->getType())
+ continue;
+
// Make sure that the stored values is available everywhere in the loop in
// the next iteration.
if (!doesStoreDominatesAllLatches(Cand.Store->getParent(), L, DT))