summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5e5ed44)
raw | patch | inline | side by side (parent: 5e5ed44)
author | Nick Lewycky <nicholas@mxc.ca> | |
Mon, 13 Jun 2011 07:52:46 +0000 (07:52 +0000) | ||
committer | Nick Lewycky <nicholas@mxc.ca> | |
Mon, 13 Jun 2011 07:52:46 +0000 (07:52 +0000) |
intrinsics. In fact, we'll optimize a bitcast to that when possible. Detect it
when looking for the lifetime intrinsics.
No test case, noticed by inspection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132906 91177308-0d34-0410-b5e6-96231b3b80d8
when looking for the lifetime intrinsics.
No test case, noticed by inspection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132906 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/InlineFunction.cpp | patch | blob | history |
index 8416170d903264c2ece235c02c5434394ca15145..3eeedab925007139aeb4620a7252a2955ceb7a64 100644 (file)
if (AI->getType() == Int8PtrTy)
return isUsedByLifetimeMarker(AI);
- // Do a scan to find all the bitcasts to i8*.
+ // Do a scan to find all the bitcasts or GEPs to i8*.
for (Value::use_iterator I = AI->use_begin(), E = AI->use_end(); I != E;
++I) {
if (I->getType() != Int8PtrTy) continue;
- if (!isa<BitCastInst>(*I)) continue;
+ if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(*I)) {
+ if (!GEPI->hasAllZeroIndices()) continue;
+ } else if (!isa<BitCastInst>(*I)) {
+ continue;
+ }
if (isUsedByLifetimeMarker(*I))
return true;
}