diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2012-12-17 13:51:03 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2012-12-17 13:51:03 +0000 |
| commit | 95e1fb8a42d56d1cb3d59ca09b01e584ac9c2f5e (patch) | |
| tree | e1fb8c0ee19130732d435d29cdd2777520e8217b /llvm/lib/Transforms | |
| parent | 041071c55882541e31bd50d9e6bd1212dc59c383 (diff) | |
| download | bcm5719-llvm-95e1fb8a42d56d1cb3d59ca09b01e584ac9c2f5e.tar.gz bcm5719-llvm-95e1fb8a42d56d1cb3d59ca09b01e584ac9c2f5e.zip | |
Hoist a convertValue call to the two paths where it is needed.
I noticed this while looking at r170328. We only ever do a vector
rewrite when the alloca *is* the vector type, so it's good to not paper
over bugs here by doing a convertValue that isn't needed.
llvm-svn: 170331
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/SROA.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp index 01c7b421b28..ef16f46580b 100644 --- a/llvm/lib/Transforms/Scalar/SROA.cpp +++ b/llvm/lib/Transforms/Scalar/SROA.cpp @@ -2807,6 +2807,7 @@ private: assert(V->getType() == IntTy && "Wrong type for an alloca wide integer!"); } + V = convertValue(TD, IRB, V, AllocaTy); } else { // Established these invariants above. assert(BeginOffset == NewAllocaBeginOffset); @@ -2814,13 +2815,13 @@ private: V = getIntegerSplat(IRB, II.getValue(), TD.getTypeSizeInBits(ScalarTy)/8); - if (VectorType *AllocaVecTy = dyn_cast<VectorType>(AllocaTy)) V = getVectorSplat(IRB, V, AllocaVecTy->getNumElements()); + + V = convertValue(TD, IRB, V, AllocaTy); } - Value *New = IRB.CreateAlignedStore(convertValue(TD, IRB, V, AllocaTy), - &NewAI, NewAI.getAlignment(), + Value *New = IRB.CreateAlignedStore(V, &NewAI, NewAI.getAlignment(), II.isVolatile()); (void)New; DEBUG(dbgs() << " to: " << *New << "\n"); |

