remove asmparser support for the old getresult instruction, which has been subsumed...
authorChris Lattner <sabre@nondot.org>
Fri, 17 Jun 2011 06:57:15 +0000 (06:57 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 17 Jun 2011 06:57:15 +0000 (06:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133247 91177308-0d34-0410-b5e6-96231b3b80d8

13 files changed:
lib/AsmParser/LLLexer.cpp
lib/AsmParser/LLParser.cpp
lib/AsmParser/LLParser.h
lib/AsmParser/LLToken.h
test/CodeGen/CBackend/2008-05-21-MRV-InlineAsm.ll [deleted file]
test/CodeGen/Generic/getresult-undef.ll [deleted file]
test/CodeGen/Generic/multiple-return-values-cross-block-with-invoke.ll
test/CodeGen/X86/fp-stack-2results.ll
test/CodeGen/X86/inline-asm-mrv.ll
test/CodeGen/X86/multiple-return-values-cross-block.ll
test/Transforms/JumpThreading/crash.ll
test/Transforms/LoopRotate/crash.ll
test/Transforms/SCCP/2008-04-22-multiple-ret-sccp.ll

index 3350a45678e7fe7fa9d1fdeefa13d975fb192924..3c63106e8c3b52f4dd089a1dcfcf19ed8724b41d 100644 (file)
@@ -635,7 +635,6 @@ lltok::Kind LLLexer::LexIdentifier() {
   INSTKEYWORD(extractelement, ExtractElement);
   INSTKEYWORD(insertelement,  InsertElement);
   INSTKEYWORD(shufflevector,  ShuffleVector);
-  INSTKEYWORD(getresult,      ExtractValue);
   INSTKEYWORD(extractvalue,   ExtractValue);
   INSTKEYWORD(insertvalue,    InsertValue);
 #undef INSTKEYWORD
index 024d013b8149ec9720a517a71f0b95c29445ccbe..ab3b86e018d3084efbc27929fa7231cba176f0d6 100644 (file)
@@ -3024,7 +3024,6 @@ int LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB,
       return ParseStore(Inst, PFS, true);
     else
       return TokError("expected 'load' or 'store'");
-  case lltok::kw_getresult:     return ParseGetResult(Inst, PFS);
   case lltok::kw_getelementptr: return ParseGetElementPtr(Inst, PFS);
   case lltok::kw_extractvalue:  return ParseExtractValue(Inst, PFS);
   case lltok::kw_insertvalue:   return ParseInsertValue(Inst, PFS);
@@ -3717,25 +3716,6 @@ int LLParser::ParseStore(Instruction *&Inst, PerFunctionState &PFS,
   return AteExtraComma ? InstExtraComma : InstNormal;
 }
 
-/// ParseGetResult
-///   ::= 'getresult' TypeAndValue ',' i32
-/// FIXME: Remove support for getresult in LLVM 3.0
-bool LLParser::ParseGetResult(Instruction *&Inst, PerFunctionState &PFS) {
-  Value *Val; LocTy ValLoc, EltLoc;
-  unsigned Element;
-  if (ParseTypeAndValue(Val, ValLoc, PFS) ||
-      ParseToken(lltok::comma, "expected ',' after getresult operand") ||
-      ParseUInt32(Element, EltLoc))
-    return true;
-
-  if (!Val->getType()->isStructTy() && !Val->getType()->isArrayTy())
-    return Error(ValLoc, "getresult inst requires an aggregate operand");
-  if (!ExtractValueInst::getIndexedType(Val->getType(), Element))
-    return Error(EltLoc, "invalid getresult index for value");
-  Inst = ExtractValueInst::Create(Val, Element);
-  return false;
-}
-
 /// ParseGetElementPtr
 ///   ::= 'getelementptr' 'inbounds'? TypeAndValue (',' TypeAndValue)*
 int LLParser::ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) {
index ddc03f7ebc11a1c402f9bf75b66b2cf0bb82df35..c486799f2929e4730cfc1ab8a0f164fc38fec20d 100644 (file)
@@ -361,7 +361,6 @@ namespace llvm {
     int ParseAlloc(Instruction *&I, PerFunctionState &PFS);
     int ParseLoad(Instruction *&I, PerFunctionState &PFS, bool isVolatile);
     int ParseStore(Instruction *&I, PerFunctionState &PFS, bool isVolatile);
-    bool ParseGetResult(Instruction *&I, PerFunctionState &PFS);
     int ParseGetElementPtr(Instruction *&I, PerFunctionState &PFS);
     int ParseExtractValue(Instruction *&I, PerFunctionState &PFS);
     int ParseInsertValue(Instruction *&I, PerFunctionState &PFS);
index cfa867b79f3e77d7aa7fffee29a2d36357f2bcf3..a5f89fcce0c0f856b37a96982e6ffaa66474809e 100644 (file)
@@ -123,7 +123,7 @@ namespace lltok {
 
     kw_alloca, kw_load, kw_store, kw_getelementptr,
 
-    kw_extractelement, kw_insertelement, kw_shufflevector, kw_getresult,
+    kw_extractelement, kw_insertelement, kw_shufflevector,
     kw_extractvalue, kw_insertvalue, kw_blockaddress,
 
     // Unsigned Valued tokens (UIntVal).
diff --git a/test/CodeGen/CBackend/2008-05-21-MRV-InlineAsm.ll b/test/CodeGen/CBackend/2008-05-21-MRV-InlineAsm.ll
deleted file mode 100644 (file)
index 8db3167..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: llc < %s -march=c
-
-declare {i32, i32} @foo()
-
-define i32 @test() {
-  %A = call {i32, i32} @foo()
-  %B = getresult {i32, i32} %A, 0
-  %C = getresult {i32, i32} %A, 1
-  %D = add i32 %B, %C
-  ret i32 %D
-}
-
-define i32 @test2() {
-  %A = call {i32, i32} asm sideeffect "...", "={cx},={di},~{dirflag},~{fpsr},~{flags},~{memory}"()
-  %B = getresult {i32, i32} %A, 0
-  %C = getresult {i32, i32} %A, 1
-  %D = add i32 %B, %C
-  ret i32 %D
-}
diff --git a/test/CodeGen/Generic/getresult-undef.ll b/test/CodeGen/Generic/getresult-undef.ll
deleted file mode 100644 (file)
index c675535..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llc < %s
-
-define double @foo() {
-  %t = getresult {double, double} undef, 1
-  ret double %t
-}
index 282e973ff9adc87db7e14002386ef5dfbf3fea60..a3cab5d2e45310ec9a2bd442f40545e2323f482c 100644 (file)
@@ -6,9 +6,9 @@ define void @foo(i64* %p, double* %q) nounwind {
         %t = invoke { i64, double } @wild() to label %normal unwind label %handler
 
 normal:
-        %mrv_gr = getresult { i64, double } %t, 0
+        %mrv_gr = extractvalue { i64, double } %t, 0
         store i64 %mrv_gr, i64* %p
-        %mrv_gr12681 = getresult { i64, double } %t, 1   
+        %mrv_gr12681 = extractvalue { i64, double } %t, 1   
         store double %mrv_gr12681, double* %q
        ret void
   
index bb86cd383394524a9ef1c442fbf76a2d589594a8..e986e36e16d9cc681863222f0fa3c93df718a63d 100644 (file)
@@ -28,10 +28,10 @@ define {x86_fp80, x86_fp80} @test2() {
 ; Uses both values.
 define void @call1(x86_fp80 *%P1, x86_fp80 *%P2) {
   %a = call {x86_fp80,x86_fp80} @test()
-  %b = getresult {x86_fp80,x86_fp80} %a, 0
+  %b = extractvalue {x86_fp80,x86_fp80} %a, 0
   store x86_fp80 %b, x86_fp80* %P1
 
-  %c = getresult {x86_fp80,x86_fp80} %a, 1
+  %c = extractvalue {x86_fp80,x86_fp80} %a, 1
   store x86_fp80 %c, x86_fp80* %P2
   ret void 
 }
@@ -39,10 +39,10 @@ define void @call1(x86_fp80 *%P1, x86_fp80 *%P2) {
 ; Uses both values, requires fxch
 define void @call2(x86_fp80 *%P1, x86_fp80 *%P2) {
   %a = call {x86_fp80,x86_fp80} @test()
-  %b = getresult {x86_fp80,x86_fp80} %a, 1
+  %b = extractvalue {x86_fp80,x86_fp80} %a, 1
   store x86_fp80 %b, x86_fp80* %P1
 
-  %c = getresult {x86_fp80,x86_fp80} %a, 0
+  %c = extractvalue {x86_fp80,x86_fp80} %a, 0
   store x86_fp80 %c, x86_fp80* %P2
   ret void
 }
@@ -50,7 +50,7 @@ define void @call2(x86_fp80 *%P1, x86_fp80 *%P2) {
 ; Uses ST(0), ST(1) is dead but must be popped.
 define void @call3(x86_fp80 *%P1, x86_fp80 *%P2) {
   %a = call {x86_fp80,x86_fp80} @test()
-  %b = getresult {x86_fp80,x86_fp80} %a, 0
+  %b = extractvalue {x86_fp80,x86_fp80} %a, 0
   store x86_fp80 %b, x86_fp80* %P1
   ret void 
 }
@@ -59,7 +59,7 @@ define void @call3(x86_fp80 *%P1, x86_fp80 *%P2) {
 define void @call4(x86_fp80 *%P1, x86_fp80 *%P2) {
   %a = call {x86_fp80,x86_fp80} @test()
 
-  %c = getresult {x86_fp80,x86_fp80} %a, 1
+  %c = extractvalue {x86_fp80,x86_fp80} %a, 1
   store x86_fp80 %c, x86_fp80* %P2
   ret void 
 }
index 78d7e776cf227930191a5a915997f2f20efb5fe4..733205d6a91534a06091a3f750fbc60f1da90906 100644 (file)
@@ -11,7 +11,7 @@ define i32 @test1(i8* %v, i8* %blk2, i8* %blk1, i32 %stride, i32 %h) nounwind  {
        %tmp12 = sext i32 %stride to i64                ; <i64> [#uses=1]
        %mrv = call {i32, i8*, i8*} asm sideeffect "$0 $1 $2 $3 $4 $5 $6",
          "=r,=r,=r,r,r,r,r"( i64 %tmp12, i32 %h, i8* %blk1, i8* %blk2 ) nounwind
-        %tmp6 = getresult {i32, i8*, i8*} %mrv, 0
+        %tmp6 = extractvalue {i32, i8*, i8*} %mrv, 0
        %tmp7 = call i32 asm sideeffect "set $0",
              "=r,~{dirflag},~{fpsr},~{flags}"( ) nounwind
        ret i32 %tmp7
@@ -19,16 +19,16 @@ define i32 @test1(i8* %v, i8* %blk2, i8* %blk1, i32 %stride, i32 %h) nounwind  {
 
 define <4 x float> @test2() nounwind {
        %mrv = call {<4 x float>, <4 x float>} asm "set $0, $1", "=x,=x"()
-       %a = getresult {<4 x float>, <4 x float>} %mrv, 0
-       %b = getresult {<4 x float>, <4 x float>} %mrv, 1
+       %a = extractvalue {<4 x float>, <4 x float>} %mrv, 0
+       %b = extractvalue {<4 x float>, <4 x float>} %mrv, 1
        %c = fadd <4 x float> %a, %b
        ret <4 x float> %c
 }
 
 define <4 x i32> @test3() nounwind {
        %mrv = call {<4 x i32>, <4 x i32>} asm "set $0, $1", "=x,=x"()
-       %a = getresult {<4 x i32>, <4 x i32>} %mrv, 0
-       %b = getresult {<4 x i32>, <4 x i32>} %mrv, 1
+       %a = extractvalue {<4 x i32>, <4 x i32>} %mrv, 0
+       %b = extractvalue {<4 x i32>, <4 x i32>} %mrv, 1
        %c = add <4 x i32> %a, %b
        ret <4 x i32> %c
 }
index e9837d0ebbf5c8579470c9740fc95d6d5c191cb6..b0cb0611134843659131617b72faf4f976752958 100644 (file)
@@ -4,12 +4,12 @@ declare {x86_fp80, x86_fp80} @test()
 
 define void @call2(x86_fp80 *%P1, x86_fp80 *%P2) {
   %a = call {x86_fp80,x86_fp80} @test()
-  %b = getresult {x86_fp80,x86_fp80} %a, 1
+  %b = extractvalue {x86_fp80,x86_fp80} %a, 1
   store x86_fp80 %b, x86_fp80* %P1
 br label %L
 
 L:
-  %c = getresult {x86_fp80,x86_fp80} %a, 0
+  %c = extractvalue {x86_fp80,x86_fp80} %a, 0
   store x86_fp80 %c, x86_fp80* %P2
   ret void
 }
index aed51a1c9ee9c0d0d6f83ebef6f40000bca0a13f..2115dd3840074a30f1638b8cee3bd3fe80ef9ad6 100644 (file)
@@ -18,7 +18,7 @@ bb13:         ; preds = %bb
        br label %bb
 
 bb110:         ; preds = %bb
-       %mrv_gr124 = getresult %struct.system__secondary_stack__mark_id %tmp120, 1              ; <i64> [#uses=0]
+       %mrv_gr124 = extractvalue %struct.system__secondary_stack__mark_id %tmp120, 1           ; <i64> [#uses=0]
        unreachable
 }
 
index 16a6868f8ff14f91923258df994daa7de5b797a4..954b834765517f9ce188f8539e419b9fce4d643d 100644 (file)
@@ -113,7 +113,7 @@ bb116:              ; preds = %bb131, %entry
        br i1 false, label %bb141, label %bb131
 
 bb131:         ; preds = %bb116
-       %mrv_gr125 = getresult %struct.NSRange %tmp123, 1               ; <i64> [#uses=0]
+       %mrv_gr125 = extractvalue %struct.NSRange %tmp123, 1            ; <i64> [#uses=0]
        br label %bb116
 
 bb141:         ; preds = %bb116
index 1b26ca9e194db7762e2d48f5b22f9c58946a4b9b..a40455cf5d009ebfcd9f1b2018883c769599e68e 100644 (file)
@@ -5,7 +5,7 @@ declare {i32, i32} @bar(i32 %A)
 
 define i32 @foo() {
        %X = call {i32, i32} @bar(i32 17)
-        %Y = getresult {i32, i32} %X, 0
+        %Y = extractvalue {i32, i32} %X, 0
        %Z = add i32 %Y, %Y
        ret i32 %Z
 }