[llvm-commits] [llvm] r132954 - /llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
Nick Lewycky
nicholas at mxc.ca
Mon Jun 13 17:59:24 PDT 2011
Author: nicholas
Date: Mon Jun 13 19:59:24 2011
New Revision: 132954
URL: http://llvm.org/viewvc/llvm-project?rev=132954&view=rev
Log:
Use Value::stripPointerCasts instead of reinventing part of the wheel.
Modified:
llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=132954&r1=132953&r2=132954&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Mon Jun 13 19:59:24 2011
@@ -734,15 +734,11 @@
if (AI->getType() == Int8PtrTy)
return isUsedByLifetimeMarker(AI);
- // Do a scan to find all the bitcasts or GEPs to i8*.
+ // Do a scan to find all the casts to i8*.
for (Value::use_iterator I = AI->use_begin(), E = AI->use_end(); I != E;
++I) {
if (I->getType() != Int8PtrTy) continue;
- if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(*I)) {
- if (!GEPI->hasAllZeroIndices()) continue;
- } else if (!isa<BitCastInst>(*I)) {
- continue;
- }
+ if (I->stripPointerCasts() != AI) continue;
if (isUsedByLifetimeMarker(*I))
return true;
}
More information about the llvm-commits
mailing list