diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-04-22 22:08:42 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2016-04-22 22:08:42 +0000 |
commit | 0aa9845d1581378768a49ab70cff825f5a535d6a (patch) | |
tree | 7f009c247fe07851b304f46636a233981b066b39 /llvm/lib/Transforms | |
parent | aa641a51719eed9509566e8352bf59e75e2c81b4 (diff) | |
download | bcm5719-llvm-0aa9845d1581378768a49ab70cff825f5a535d6a.tar.gz bcm5719-llvm-0aa9845d1581378768a49ab70cff825f5a535d6a.zip |
Revert r267210, it makes clang assert (PR27490).
llvm-svn: 267232
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index e8314006dd1..96f09084482 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -327,8 +327,6 @@ static LoadInst *combineLoadToNewType(InstCombiner &IC, LoadInst &LI, Type *NewT LoadInst *NewLoad = IC.Builder->CreateAlignedLoad( IC.Builder->CreateBitCast(Ptr, NewTy->getPointerTo(AS)), LI.getAlignment(), LI.getName() + Suffix); - NewLoad->setAtomic(LI.getOrdering(), LI.getSynchScope()); - assert(!LI.isVolatile() && "volatile unhandled here"); MDBuilder MDB(NewLoad->getContext()); for (const auto &MDPair : MD) { unsigned ID = MDPair.first; @@ -401,8 +399,6 @@ static StoreInst *combineStoreToNewValue(InstCombiner &IC, StoreInst &SI, Value StoreInst *NewStore = IC.Builder->CreateAlignedStore( V, IC.Builder->CreateBitCast(Ptr, V->getType()->getPointerTo(AS)), SI.getAlignment()); - NewStore->setAtomic(SI.getOrdering(), SI.getSynchScope()); - assert(!SI.isVolatile() && "volatile unhandled here"); for (const auto &MDPair : MD) { unsigned ID = MDPair.first; MDNode *N = MDPair.second; @@ -460,9 +456,9 @@ static StoreInst *combineStoreToNewValue(InstCombiner &IC, StoreInst &SI, Value /// later. However, it is risky in case some backend or other part of LLVM is /// relying on the exact type loaded to select appropriate atomic operations. static Instruction *combineLoadToOperationType(InstCombiner &IC, LoadInst &LI) { - // FIXME: We could probably with some care handle both volatile and ordered - // atomic loads here but it isn't clear that this is important. - if (!LI.isUnordered()) + // FIXME: We could probably with some care handle both volatile and atomic + // loads here but it isn't clear that this is important. + if (!LI.isSimple()) return nullptr; if (LI.use_empty()) @@ -896,7 +892,6 @@ Instruction *InstCombiner::visitLoadInst(LoadInst &LI) { V1->setAtomic(LI.getOrdering(), LI.getSynchScope()); V2->setAlignment(Align); V2->setAtomic(LI.getOrdering(), LI.getSynchScope()); - assert(!LI.isVolatile() && "volatile unhandled here"); return SelectInst::Create(SI->getCondition(), V1, V2); } @@ -939,9 +934,9 @@ Instruction *InstCombiner::visitLoadInst(LoadInst &LI) { /// the store instruction as otherwise there is no way to signal whether it was /// combined or not: IC.EraseInstFromFunction returns a null pointer. static bool combineStoreToValueType(InstCombiner &IC, StoreInst &SI) { - // FIXME: We could probably with some care handle both volatile and ordered - // atomic stores here but it isn't clear that this is important. - if (!SI.isUnordered()) + // FIXME: We could probably with some care handle both volatile and atomic + // stores here but it isn't clear that this is important. + if (!SI.isSimple()) return false; Value *V = SI.getValueOperand(); |