@@ -327,8 +327,6 @@ static LoadInst *combineLoadToNewType(InstCombiner &IC, LoadInst &LI, Type *NewT
327
327
LoadInst *NewLoad = IC.Builder ->CreateAlignedLoad (
328
328
IC.Builder ->CreateBitCast (Ptr, NewTy->getPointerTo (AS)),
329
329
LI.getAlignment (), LI.getName () + Suffix);
330
- NewLoad->setAtomic (LI.getOrdering (), LI.getSynchScope ());
331
- assert (!LI.isVolatile () && " volatile unhandled here" );
332
330
MDBuilder MDB (NewLoad->getContext ());
333
331
for (const auto &MDPair : MD) {
334
332
unsigned ID = MDPair.first ;
@@ -401,8 +399,6 @@ static StoreInst *combineStoreToNewValue(InstCombiner &IC, StoreInst &SI, Value
401
399
StoreInst *NewStore = IC.Builder ->CreateAlignedStore (
402
400
V, IC.Builder ->CreateBitCast (Ptr, V->getType ()->getPointerTo (AS)),
403
401
SI.getAlignment ());
404
- NewStore->setAtomic (SI.getOrdering (), SI.getSynchScope ());
405
- assert (!SI.isVolatile () && " volatile unhandled here" );
406
402
for (const auto &MDPair : MD) {
407
403
unsigned ID = MDPair.first ;
408
404
MDNode *N = MDPair.second ;
@@ -460,9 +456,9 @@ static StoreInst *combineStoreToNewValue(InstCombiner &IC, StoreInst &SI, Value
460
456
// / later. However, it is risky in case some backend or other part of LLVM is
461
457
// / relying on the exact type loaded to select appropriate atomic operations.
462
458
static Instruction *combineLoadToOperationType (InstCombiner &IC, LoadInst &LI) {
463
- // FIXME: We could probably with some care handle both volatile and ordered
464
- // atomic loads here but it isn't clear that this is important.
465
- if (!LI.isUnordered ())
459
+ // FIXME: We could probably with some care handle both volatile and atomic
460
+ // loads here but it isn't clear that this is important.
461
+ if (!LI.isSimple ())
466
462
return nullptr ;
467
463
468
464
if (LI.use_empty ())
@@ -896,7 +892,6 @@ Instruction *InstCombiner::visitLoadInst(LoadInst &LI) {
896
892
V1->setAtomic (LI.getOrdering (), LI.getSynchScope ());
897
893
V2->setAlignment (Align);
898
894
V2->setAtomic (LI.getOrdering (), LI.getSynchScope ());
899
- assert (!LI.isVolatile () && " volatile unhandled here" );
900
895
return SelectInst::Create (SI->getCondition (), V1, V2);
901
896
}
902
897
@@ -939,9 +934,9 @@ Instruction *InstCombiner::visitLoadInst(LoadInst &LI) {
939
934
// / the store instruction as otherwise there is no way to signal whether it was
940
935
// / combined or not: IC.EraseInstFromFunction returns a null pointer.
941
936
static bool combineStoreToValueType (InstCombiner &IC, StoreInst &SI) {
942
- // FIXME: We could probably with some care handle both volatile and ordered
943
- // atomic stores here but it isn't clear that this is important.
944
- if (!SI.isUnordered ())
937
+ // FIXME: We could probably with some care handle both volatile and atomic
938
+ // stores here but it isn't clear that this is important.
939
+ if (!SI.isSimple ())
945
940
return false ;
946
941
947
942
Value *V = SI.getValueOperand ();
0 commit comments