[llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Jul 29 00:56:49 PDT 2004
Changes in directory llvm/lib/Analysis:
BasicAliasAnalysis.cpp updated: 1.50 -> 1.51
---
Log message:
Fix test/Regression/Analysis/BasicAA/2004-07-28-MustAliasbug.llx
This also fixes the miscompilation of MallocBench/gs with dead store
elimination enabled.
---
Diffs of the changes: (+9 -5)
Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.50 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.51
--- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.50 Mon Jul 26 21:18:52 2004
+++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Thu Jul 29 02:56:39 2004
@@ -322,11 +322,15 @@
BasePtr1 = GetGEPOperands(V1, GEP1Ops);
BasePtr2 = GetGEPOperands(V2, GEP2Ops);
- AliasResult GAlias =
- CheckGEPInstructions(BasePtr1->getType(), GEP1Ops, V1Size,
- BasePtr2->getType(), GEP2Ops, V2Size);
- if (GAlias != MayAlias)
- return GAlias;
+ // If GetGEPOperands were able to fold to the same must-aliased pointer,
+ // do the comparison.
+ if (BasePtr1 == BasePtr2) {
+ AliasResult GAlias =
+ CheckGEPInstructions(BasePtr1->getType(), GEP1Ops, V1Size,
+ BasePtr2->getType(), GEP2Ops, V2Size);
+ if (GAlias != MayAlias)
+ return GAlias;
+ }
}
}
More information about the llvm-commits
mailing list