summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/PHITransAddr.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-11-16 12:16:38 +0000
committerDuncan Sands <baldrick@free.fr>2010-11-16 12:16:38 +0000
commit5ffc298bc7f58e85aa4bbe6471070a850e0f3ff3 (patch)
tree9be48590929e0c71f4b08d1e9a790e2f7561bc73 /llvm/lib/Analysis/PHITransAddr.cpp
parent40c98640e17cc2a3a636ac14d860995a93896861 (diff)
downloadbcm5719-llvm-5ffc298bc7f58e85aa4bbe6471070a850e0f3ff3.tar.gz
bcm5719-llvm-5ffc298bc7f58e85aa4bbe6471070a850e0f3ff3.zip
In which I discover the existence of loops. Threading an operation
over a phi node by applying it to each operand may be wrong if the operation and the phi node are mutually interdependent (the testcase has a simple example of this). So only do this transform if it would be correct to perform the operation in each predecessor of the block containing the phi, i.e. if the other operands all dominate the phi. This should fix the FFMPEG snow.c regression reported by İsmail Dönmez. llvm-svn: 119347
Diffstat (limited to 'llvm/lib/Analysis/PHITransAddr.cpp')
-rw-r--r--llvm/lib/Analysis/PHITransAddr.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/PHITransAddr.cpp b/llvm/lib/Analysis/PHITransAddr.cpp
index 8e4fa03f213..a9ccab1f469 100644
--- a/llvm/lib/Analysis/PHITransAddr.cpp
+++ b/llvm/lib/Analysis/PHITransAddr.cpp
@@ -217,7 +217,7 @@ Value *PHITransAddr::PHITranslateSubExpr(Value *V, BasicBlock *CurBB,
return GEP;
// Simplify the GEP to handle 'gep x, 0' -> x etc.
- if (Value *V = SimplifyGEPInst(&GEPOps[0], GEPOps.size(), TD)) {
+ if (Value *V = SimplifyGEPInst(&GEPOps[0], GEPOps.size(), TD, DT)) {
for (unsigned i = 0, e = GEPOps.size(); i != e; ++i)
RemoveInstInputs(GEPOps[i], InstInputs);
@@ -273,7 +273,7 @@ Value *PHITransAddr::PHITranslateSubExpr(Value *V, BasicBlock *CurBB,
}
// See if the add simplifies away.
- if (Value *Res = SimplifyAddInst(LHS, RHS, isNSW, isNUW, TD)) {
+ if (Value *Res = SimplifyAddInst(LHS, RHS, isNSW, isNUW, TD, DT)) {
// If we simplified the operands, the LHS is no longer an input, but Res
// is.
RemoveInstInputs(LHS, InstInputs);
OpenPOWER on IntegriCloud