From 2e073f55ebef49b3f60bd5bb2987388177952f0b Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Mon, 29 Feb 2016 22:53:59 +0000 Subject: [PATCH] [LLE] Fix SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper with Polly We can actually have dependences between accesses with different underlying types. Bail in this case. A test will follow shortly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262267 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LoopLoadElimination.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Transforms/Scalar/LoopLoadElimination.cpp b/lib/Transforms/Scalar/LoopLoadElimination.cpp index db96beaac4ce..a363d246d372 100644 --- a/lib/Transforms/Scalar/LoopLoadElimination.cpp +++ b/lib/Transforms/Scalar/LoopLoadElimination.cpp @@ -429,6 +429,11 @@ class LoadEliminationForLoop { 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))