remove asmparsing and documentation support for "volatile load", which was only produ...
authorChris Lattner <sabre@nondot.org>
Sun, 27 Nov 2011 06:56:53 +0000 (06:56 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 27 Nov 2011 06:56:53 +0000 (06:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145172 91177308-0d34-0410-b5e6-96231b3b80d8

docs/LangRef.html
docs/ReleaseNotes.html
lib/AsmParser/LLParser.cpp
lib/AsmParser/LLParser.h

index a9ec80069aedec6923faab785e6c6fa5b43d4f18..b133a532f1cb49bc4f441e6a9d66f75eda872c4e 100644 (file)
@@ -2583,7 +2583,7 @@ entry:
   store i32 %trap, i32* @g           ; Trap value conceptually stored to memory.
   %trap2 = load i32* @g              ; Returns a trap value, not just undef.
 
-  volatile store i32 %trap, i32* @g  ; External observation; undefined behavior.
+  store volatile i32 %trap, i32* @g  ; External observation; undefined behavior.
 
   %narrowaddr = bitcast i32* @g to i16*
   %wideaddr = bitcast i32* @g to i64*
@@ -2594,7 +2594,7 @@ entry:
   br i1 %cmp, label %true, label %end ; Branch to either destination.
 
 true:
-  volatile store i32 0, i32* @g      ; This is control-dependent on %cmp, so
+  store volatile i32 0, i32* @g      ; This is control-dependent on %cmp, so
                                      ; it has undefined behavior.
   br label %end
 
@@ -2604,7 +2604,7 @@ end:
                                      ; control-dependent on %cmp, so this
                                      ; always results in a trap value.
 
-  volatile store i32 0, i32* @g      ; This would depend on the store in %true
+  store volatile i32 0, i32* @g      ; This would depend on the store in %true
                                      ; if %cmp is true, or the store in %entry
                                      ; otherwise, so this is undefined behavior.
 
@@ -2617,7 +2617,7 @@ second_true:
   ret void
 
 second_end:
-  volatile store i32 0, i32* @g      ; This time, the instruction always depends
+  store volatile i32 0, i32* @g      ; This time, the instruction always depends
                                      ; on the store in %end. Also, it is
                                      ; control-equivalent to %end, so this is
                                      ; well-defined (again, ignoring earlier
index edfc1a0a078472d1eefa112feab9b688fa34fe93..7d82f5ea83bc02809588da7ee47e07b318cb3542 100644 (file)
@@ -776,14 +776,14 @@ be used to verify some algorithms.
  New PackedVector, TinyPtrVector class (see Programmer's Manual)
  New nonlazybind function attribute.
  ARC language specific optimizer (Transforms/ObjCARC) a decent example of language-specific transformation.
- LLVM 3.0 removes support for reading LLVM 2.8 and earlier files.
+ LLVM 3.0 removes support for reading LLVM 2.8 and earlier files.  Aim to maintain compatibility all the way back to 3.0 "forever".
 
  New llvm.expect intrinsic.
  Table generated MC expansion logic for pseudo instructions that expand to multiple MC instructions through the PseudoInstExpansion class. (JimG)
  New llvm.fma intrinsic.
  
  Euro dev meeting and main one too.
- New atomics instructions, "#i_fence" instruction, cmpxchg, atomicrmw too.  What target support?
+ New atomics instructions, "#i_fence" instruction, cmpxchg, atomicrmw too.  What target support? Also 'atomic load/store'.  See Atomics.html
  X86: inline assembler supports .code32 and .code64.
  Exception handling rewrite: new landingpad and resume instruction.  Unwind gone.
  LowerSetJmp pass removed, unused.
index f01e9954018a5842d7fdaa02b7a2f38ecac99684..212c9fb38d596ba44bc12bbb9520f3630d83b742 100644 (file)
@@ -2948,19 +2948,11 @@ int LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB,
   case lltok::kw_tail:           return ParseCall(Inst, PFS, true);
   // Memory.
   case lltok::kw_alloca:         return ParseAlloc(Inst, PFS);
-  case lltok::kw_load:           return ParseLoad(Inst, PFS, false);
-  case lltok::kw_store:          return ParseStore(Inst, PFS, false);
+  case lltok::kw_load:           return ParseLoad(Inst, PFS);
+  case lltok::kw_store:          return ParseStore(Inst, PFS);
   case lltok::kw_cmpxchg:        return ParseCmpXchg(Inst, PFS);
   case lltok::kw_atomicrmw:      return ParseAtomicRMW(Inst, PFS);
   case lltok::kw_fence:          return ParseFence(Inst, PFS);
-  case lltok::kw_volatile:
-    // For compatibility; canonical location is after load
-    if (EatIfPresent(lltok::kw_load))
-      return ParseLoad(Inst, PFS, true);
-    else if (EatIfPresent(lltok::kw_store))
-      return ParseStore(Inst, PFS, true);
-    else
-      return TokError("expected 'load' or 'store'");
   case lltok::kw_getelementptr: return ParseGetElementPtr(Inst, PFS);
   case lltok::kw_extractvalue:  return ParseExtractValue(Inst, PFS);
   case lltok::kw_insertvalue:   return ParseInsertValue(Inst, PFS);
@@ -3684,10 +3676,7 @@ int LLParser::ParseAlloc(Instruction *&Inst, PerFunctionState &PFS) {
 ///   ::= 'load' 'volatile'? TypeAndValue (',' 'align' i32)?
 ///   ::= 'load' 'atomic' 'volatile'? TypeAndValue 
 ///       'singlethread'? AtomicOrdering (',' 'align' i32)?
-///   Compatibility:
-///   ::= 'volatile' 'load' TypeAndValue (',' 'align' i32)?
-int LLParser::ParseLoad(Instruction *&Inst, PerFunctionState &PFS,
-                        bool isVolatile) {
+int LLParser::ParseLoad(Instruction *&Inst, PerFunctionState &PFS) {
   Value *Val; LocTy Loc;
   unsigned Alignment = 0;
   bool AteExtraComma = false;
@@ -3696,15 +3685,12 @@ int LLParser::ParseLoad(Instruction *&Inst, PerFunctionState &PFS,
   SynchronizationScope Scope = CrossThread;
 
   if (Lex.getKind() == lltok::kw_atomic) {
-    if (isVolatile)
-      return TokError("mixing atomic with old volatile placement");
     isAtomic = true;
     Lex.Lex();
   }
 
+  bool isVolatile = false;
   if (Lex.getKind() == lltok::kw_volatile) {
-    if (isVolatile)
-      return TokError("duplicate volatile before and after store");
     isVolatile = true;
     Lex.Lex();
   }
@@ -3731,10 +3717,7 @@ int LLParser::ParseLoad(Instruction *&Inst, PerFunctionState &PFS,
 ///   ::= 'store' 'volatile'? TypeAndValue ',' TypeAndValue (',' 'align' i32)?
 ///   ::= 'store' 'atomic' 'volatile'? TypeAndValue ',' TypeAndValue
 ///       'singlethread'? AtomicOrdering (',' 'align' i32)?
-///   Compatibility:
-///   ::= 'volatile' 'store' TypeAndValue ',' TypeAndValue (',' 'align' i32)?
-int LLParser::ParseStore(Instruction *&Inst, PerFunctionState &PFS,
-                         bool isVolatile) {
+int LLParser::ParseStore(Instruction *&Inst, PerFunctionState &PFS) {
   Value *Val, *Ptr; LocTy Loc, PtrLoc;
   unsigned Alignment = 0;
   bool AteExtraComma = false;
@@ -3743,15 +3726,12 @@ int LLParser::ParseStore(Instruction *&Inst, PerFunctionState &PFS,
   SynchronizationScope Scope = CrossThread;
 
   if (Lex.getKind() == lltok::kw_atomic) {
-    if (isVolatile)
-      return TokError("mixing atomic with old volatile placement");
     isAtomic = true;
     Lex.Lex();
   }
 
+  bool isVolatile = false;
   if (Lex.getKind() == lltok::kw_volatile) {
-    if (isVolatile)
-      return TokError("duplicate volatile before and after store");
     isVolatile = true;
     Lex.Lex();
   }
index cbc3c23e8631fa62f90b31b24b1fefd12c37c415..c2537d7bda744ead22f36276c0c4db6b5b845ab2 100644 (file)
@@ -363,8 +363,8 @@ namespace llvm {
     bool ParseLandingPad(Instruction *&I, PerFunctionState &PFS);
     bool ParseCall(Instruction *&I, PerFunctionState &PFS, bool isTail);
     int ParseAlloc(Instruction *&I, PerFunctionState &PFS);
-    int ParseLoad(Instruction *&I, PerFunctionState &PFS, bool isVolatile);
-    int ParseStore(Instruction *&I, PerFunctionState &PFS, bool isVolatile);
+    int ParseLoad(Instruction *&I, PerFunctionState &PFS);
+    int ParseStore(Instruction *&I, PerFunctionState &PFS);
     int ParseCmpXchg(Instruction *&I, PerFunctionState &PFS);
     int ParseAtomicRMW(Instruction *&I, PerFunctionState &PFS);
     int ParseFence(Instruction *&I, PerFunctionState &PFS);