[llvm-commits] [llvm] r67202 - /llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp

Duncan Sands baldrick at free.fr
Wed Mar 18 06:02:24 PDT 2009


Hi,

> @@ -1223,7 +1223,7 @@
>        CleanupGEP(GEPI);
>      else if (Instruction *I = dyn_cast<Instruction>(U)) {
>        SmallVector<DbgInfoIntrinsic *, 2> DbgInUses;
> -      if (!I->use_empty() && OnlyUsedByDbgInfoIntrinsics(I, &DbgInUses)) {
> +      if (!isa<StoreInst>(I) && OnlyUsedByDbgInfoIntrinsics(I, &DbgInUses)) {
>          // Safe to remove debug info uses.
>          while (!DbgInUses.empty()) {
>            DbgInfoIntrinsic *DI = DbgInUses.back(); DbgInUses.pop_back();

maybe the store can be removed if it is only storing to the alloca
(rather than storing the alloca somewhere) - not sure.  Also, looking
at the code it sounds like other parts of sroa have expectations about
what cleanups are performed, so not cleaning up stores may apriori
cause problems.  Finally, if removing the store is a problem, that
suggests to me that the alloca shouldn't have been promoted in the
first place.  I think Chris is the guy to answer these kinds of
worries.

Ciao,

Duncan.



More information about the llvm-commits mailing list