[x86] Fix an embarressing bug in the INSERTPS formation code. The mask
[oota-llvm.git] / lib / IR / Instruction.cpp
index 50b1f04d41e1ebbd432e775144e5105bc4b2455e..3e7b03144737e444e554aa4d5197b94da380aa6e 100644 (file)
@@ -443,6 +443,21 @@ bool Instruction::mayWriteToMemory() const {
   }
 }
 
+bool Instruction::isAtomic() const {
+  switch (getOpcode()) {
+  default:
+    return false;
+  case Instruction::AtomicCmpXchg:
+  case Instruction::AtomicRMW:
+  case Instruction::Fence:
+    return true;
+  case Instruction::Load:
+    return cast<LoadInst>(this)->getOrdering() != NotAtomic;
+  case Instruction::Store:
+    return cast<StoreInst>(this)->getOrdering() != NotAtomic;
+  }
+}
+
 bool Instruction::mayThrow() const {
   if (const CallInst *CI = dyn_cast<CallInst>(this))
     return !CI->doesNotThrow();