[LLE] Fix SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper with Polly
authorAdam Nemet <anemet@apple.com>
Mon, 29 Feb 2016 22:53:59 +0000 (22:53 +0000)
committerAdam Nemet <anemet@apple.com>
Mon, 29 Feb 2016 22:53:59 +0000 (22:53 +0000)
We can actually have dependences between accesses with different
underlying types.  Bail in this case.

A test will follow shortly.

llvm-svn: 262267

llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp

index db96bea..a363d24 100644 (file)
@@ -429,6 +429,11 @@ public:
     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))