From 83be06e52960e56ed6b7c78d151bbe4dff941a5f Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Mon, 29 Feb 2016 22:53:59 +0000 Subject: [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. llvm-svn: 262267 --- llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/Transforms/Scalar') diff --git a/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp b/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp index db96beaac4c..a363d246d37 100644 --- a/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp +++ b/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp @@ -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)) -- cgit v1.2.3