diff options
| author | Bill Wendling <isanbard@gmail.com> | 2012-03-16 18:20:54 +0000 | 
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2012-03-16 18:20:54 +0000 | 
| commit | 55b6b2b6a92f5817772f80b7e5c6e6d68df6a851 (patch) | |
| tree | 46133fd72fba95f2e3bc589e13e5984fdcaefb30 /llvm/lib/Transforms | |
| parent | 411d5a2026c7c10a448d21993c3291ffa8efd055 (diff) | |
| download | bcm5719-llvm-55b6b2b6a92f5817772f80b7e5c6e6d68df6a851.tar.gz bcm5719-llvm-55b6b2b6a92f5817772f80b7e5c6e6d68df6a851.zip | |
Revert r152907.
llvm-svn: 152935
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 18 | 
1 files changed, 3 insertions, 15 deletions
| diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index fa68000df58..7446a51a4db 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -379,22 +379,10 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) {      unsigned EffectiveStoreAlign = StoreAlign != 0 ? StoreAlign :        TD->getABITypeAlignment(Val->getType()); -    if (KnownAlign > EffectiveStoreAlign) { +    if (KnownAlign > EffectiveStoreAlign)        SI.setAlignment(KnownAlign); -    } else if (StoreAlign == 0) { -      unsigned PtrAlign = 0; -      if (GlobalValue *GV = dyn_cast<GlobalValue>(Ptr->stripPointerCasts())) -        PtrAlign = GV->getAlignment(); - -      if (PtrAlign != 0 && PtrAlign < EffectiveStoreAlign) -        // The pointer alignment may be less than the effective store -        // alignment. If so, then we don't want to increase the alignment here, -        // since that could lead to code-gen using instructions which require a -        // higher alignment than the pointer guarantees. -        SI.setAlignment(PtrAlign); -      else -        SI.setAlignment(EffectiveStoreAlign); -    } +    else if (StoreAlign == 0) +      SI.setAlignment(EffectiveStoreAlign);    }    // Don't hack volatile/atomic stores. | 

