From: Thomas Lively Date: Tue, 8 Jan 2019 06:25:55 +0000 (+0000) Subject: [WebAssembly] Instruction renaming X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25ff8937126eabe8537489df7356d520a47c5b1c;p=platform%2Fupstream%2Fllvm.git [WebAssembly] Instruction renaming Summary: Associated with D56338. Reviewers: aheejin, aardappel Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D56339 llvm-svn: 350610 --- diff --git a/lld/test/wasm/alias.ll b/lld/test/wasm/alias.ll index d91f4b1..358582e 100644 --- a/lld/test/wasm/alias.ll +++ b/lld/test/wasm/alias.ll @@ -25,7 +25,7 @@ entry: ; CHECK-NEXT: FunctionTypes: [ 0, 0 ] ; CHECK-NEXT: - Type: TABLE ; CHECK-NEXT: Tables: -; CHECK-NEXT: - ElemType: ANYFUNC +; CHECK-NEXT: - ElemType: FUNCREF ; CHECK-NEXT: Limits: ; CHECK-NEXT: Flags: [ HAS_MAX ] ; CHECK-NEXT: Initial: 0x00000001 diff --git a/lld/test/wasm/call-indirect.ll b/lld/test/wasm/call-indirect.ll index 1b9e172..7f8fe47 100644 --- a/lld/test/wasm/call-indirect.ll +++ b/lld/test/wasm/call-indirect.ll @@ -60,7 +60,7 @@ define void @call_ptr(i64 (i64)* %arg) { ; CHECK-NEXT: FunctionTypes: [ 3, 0, 3, 1, 3, 4 ] ; CHECK-NEXT: - Type: TABLE ; CHECK-NEXT: Tables: -; CHECK-NEXT: - ElemType: ANYFUNC +; CHECK-NEXT: - ElemType: FUNCREF ; CHECK-NEXT: Limits: ; CHECK-NEXT: Flags: [ HAS_MAX ] ; CHECK-NEXT: Initial: 0x00000003 diff --git a/lld/test/wasm/export-table.test b/lld/test/wasm/export-table.test index 58775b9..e2d05f0 100644 --- a/lld/test/wasm/export-table.test +++ b/lld/test/wasm/export-table.test @@ -6,7 +6,7 @@ # CHECK: - Type: TABLE # CHECK-NEXT: Tables: -# CHECK-NEXT: - ElemType: ANYFUNC +# CHECK-NEXT: - ElemType: FUNCREF # CHECK-NEXT: Limits: # CHECK-NEXT: Flags: [ HAS_MAX ] # CHECK-NEXT: Initial: 0x00000001 diff --git a/lld/test/wasm/import-table.test b/lld/test/wasm/import-table.test index ae42311..440509b 100644 --- a/lld/test/wasm/import-table.test +++ b/lld/test/wasm/import-table.test @@ -10,7 +10,7 @@ # CHECK-NEXT: Field: __indirect_function_table # CHECK-NEXT: Kind: TABLE # CHECK-NEXT: Table: -# CHECK-NEXT: ElemType: ANYFUNC +# CHECK-NEXT: ElemType: FUNCREF # CHECK-NEXT: Limits: # CHECK-NEXT: Initial: 0x00000001 diff --git a/lld/test/wasm/local-symbols.ll b/lld/test/wasm/local-symbols.ll index 6d1a324..dd92b4e 100644 --- a/lld/test/wasm/local-symbols.ll +++ b/lld/test/wasm/local-symbols.ll @@ -36,7 +36,7 @@ entry: ; CHECK-NEXT: FunctionTypes: [ 0, 1, 0 ] ; CHECK-NEXT: - Type: TABLE ; CHECK-NEXT: Tables: -; CHECK-NEXT: - ElemType: ANYFUNC +; CHECK-NEXT: - ElemType: FUNCREF ; CHECK-NEXT: Limits: ; CHECK-NEXT: Flags: [ HAS_MAX ] ; CHECK-NEXT: Initial: 0x00000001 diff --git a/lld/test/wasm/locals-duplicate.test b/lld/test/wasm/locals-duplicate.test index 8da0b22..b673aeb 100644 --- a/lld/test/wasm/locals-duplicate.test +++ b/lld/test/wasm/locals-duplicate.test @@ -20,7 +20,7 @@ ; CHECK-NEXT: 1, 1, 1 ] ; CHECK-NEXT: - Type: TABLE ; CHECK-NEXT: Tables: -; CHECK-NEXT: - ElemType: ANYFUNC +; CHECK-NEXT: - ElemType: FUNCREF ; CHECK-NEXT: Limits: ; CHECK-NEXT: Flags: [ HAS_MAX ] ; CHECK-NEXT: Initial: 0x00000007 @@ -253,7 +253,7 @@ ; RELOC-NEXT: 0, 0 ] ; RELOC-NEXT: - Type: TABLE ; RELOC-NEXT: Tables: -; RELOC-NEXT: - ElemType: ANYFUNC +; RELOC-NEXT: - ElemType: FUNCREF ; RELOC-NEXT: Limits: ; RELOC-NEXT: Flags: [ HAS_MAX ] ; RELOC-NEXT: Initial: 0x00000007 diff --git a/lld/test/wasm/relocatable.ll b/lld/test/wasm/relocatable.ll index 4e8a887..b7f1977 100644 --- a/lld/test/wasm/relocatable.ll +++ b/lld/test/wasm/relocatable.ll @@ -63,7 +63,7 @@ entry: ; CHECK-NEXT: FunctionTypes: [ 2, 1, 1 ] ; CHECK-NEXT: - Type: TABLE ; CHECK-NEXT: Tables: -; CHECK-NEXT: - ElemType: ANYFUNC +; CHECK-NEXT: - ElemType: FUNCREF ; CHECK-NEXT: Limits: ; CHECK-NEXT: Flags: [ HAS_MAX ] ; CHECK-NEXT: Initial: 0x00000004 diff --git a/lld/test/wasm/shared.ll b/lld/test/wasm/shared.ll index 088c650..f3abd11 100644 --- a/lld/test/wasm/shared.ll +++ b/lld/test/wasm/shared.ll @@ -42,7 +42,7 @@ declare void @func_external() ; CHECK-NEXT: Field: __indirect_function_table ; CHECK-NEXT: Kind: TABLE ; CHECK-NEXT: Table: -; CHECK-NEXT: ElemType: ANYFUNC +; CHECK-NEXT: ElemType: FUNCREF ; CHECK-NEXT: Limits: ; CHECK-NEXT: Initial: 0x00000002 ; CHECK-NEXT: - Module: env @@ -66,7 +66,7 @@ declare void @func_external() ; CHECK: - Type: ELEM ; CHECK-NEXT: Segments: ; CHECK-NEXT: - Offset: -; CHECK-NEXT: Opcode: GET_GLOBAL +; CHECK-NEXT: Opcode: GLOBAL_GET ; CHECK-NEXT: Index: 2 ; CHECK-NEXT: Functions: [ 2, 0 ] @@ -77,6 +77,6 @@ declare void @func_external() ; CHECK-NEXT: - SectionOffset: 6 ; CHECK-NEXT: MemoryIndex: 0 ; CHECK-NEXT: Offset: -; CHECK-NEXT: Opcode: GET_GLOBAL +; CHECK-NEXT: Opcode: GLOBAL_GET ; CHECK-NEXT: Index: 1 ; CHECK-NEXT: Content: '0000000001000000' diff --git a/lld/test/wasm/stack-pointer.ll b/lld/test/wasm/stack-pointer.ll index 888c938..8b5b01fe 100644 --- a/lld/test/wasm/stack-pointer.ll +++ b/lld/test/wasm/stack-pointer.ll @@ -31,7 +31,7 @@ entry: ; CHECK-NEXT: FunctionTypes: [ 0 ] ; CHECK-NEXT: - Type: TABLE ; CHECK-NEXT: Tables: -; CHECK-NEXT: - ElemType: ANYFUNC +; CHECK-NEXT: - ElemType: FUNCREF ; CHECK-NEXT: Limits: ; CHECK-NEXT: Flags: [ HAS_MAX ] ; CHECK-NEXT: Initial: 0x00000001 diff --git a/lld/test/wasm/undefined-weak-call.ll b/lld/test/wasm/undefined-weak-call.ll index 920379e..0b7d0c7 100644 --- a/lld/test/wasm/undefined-weak-call.ll +++ b/lld/test/wasm/undefined-weak-call.ll @@ -45,7 +45,7 @@ define i32 @callWeakFuncs() { ; CHECK-NEXT: FunctionTypes: [ 0, 0, 0, 1, 2 ] ; CHECK-NEXT: - Type: TABLE ; CHECK-NEXT: Tables: -; CHECK-NEXT: - ElemType: ANYFUNC +; CHECK-NEXT: - ElemType: FUNCREF ; CHECK-NEXT: Limits: ; CHECK-NEXT: Flags: [ HAS_MAX ] ; CHECK-NEXT: Initial: 0x00000001 diff --git a/lld/test/wasm/weak-alias-overide.ll b/lld/test/wasm/weak-alias-overide.ll index 496900b..7fefad0 100644 --- a/lld/test/wasm/weak-alias-overide.ll +++ b/lld/test/wasm/weak-alias-overide.ll @@ -35,7 +35,7 @@ entry: ; CHECK-NEXT: FunctionTypes: [ 0, 1, 0, 1, 1, 1, 1, 1 ] ; CHECK-NEXT: - Type: TABLE ; CHECK-NEXT: Tables: -; CHECK-NEXT: - ElemType: ANYFUNC +; CHECK-NEXT: - ElemType: FUNCREF ; CHECK-NEXT: Limits: ; CHECK-NEXT: Flags: [ HAS_MAX ] ; CHECK-NEXT: Initial: 0x00000003 diff --git a/lld/test/wasm/weak-alias.ll b/lld/test/wasm/weak-alias.ll index 49f2885..eaebef1 100644 --- a/lld/test/wasm/weak-alias.ll +++ b/lld/test/wasm/weak-alias.ll @@ -32,7 +32,7 @@ entry: ; CHECK-NEXT: FunctionTypes: [ 0, 0, 1, 1, 1, 1, 1 ] ; CHECK-NEXT: - Type: TABLE ; CHECK-NEXT: Tables: -; CHECK-NEXT: - ElemType: ANYFUNC +; CHECK-NEXT: - ElemType: FUNCREF ; CHECK-NEXT: Limits: ; CHECK-NEXT: Flags: [ HAS_MAX ] ; CHECK-NEXT: Initial: 0x00000002 @@ -170,7 +170,7 @@ entry: ; RELOC-NEXT: FunctionTypes: [ 0, 1, 1, 1, 1, 1 ] ; RELOC-NEXT: - Type: TABLE ; RELOC-NEXT: Tables: -; RELOC-NEXT: - ElemType: ANYFUNC +; RELOC-NEXT: - ElemType: FUNCREF ; RELOC-NEXT: Limits: ; RELOC-NEXT: Flags: [ HAS_MAX ] ; RELOC-NEXT: Initial: 0x00000002 diff --git a/lld/test/wasm/weak-symbols.ll b/lld/test/wasm/weak-symbols.ll index 7af4323..41ade7c 100644 --- a/lld/test/wasm/weak-symbols.ll +++ b/lld/test/wasm/weak-symbols.ll @@ -32,7 +32,7 @@ entry: ; CHECK-NEXT: FunctionTypes: [ 0, 0, 1, 1, 1 ] ; CHECK-NEXT: - Type: TABLE ; CHECK-NEXT: Tables: -; CHECK-NEXT: - ElemType: ANYFUNC +; CHECK-NEXT: - ElemType: FUNCREF ; CHECK-NEXT: Limits: ; CHECK-NEXT: Flags: [ HAS_MAX ] ; CHECK-NEXT: Initial: 0x00000002 diff --git a/lld/test/wasm/weak-undefined.ll b/lld/test/wasm/weak-undefined.ll index 2f2451a..41e992e 100644 --- a/lld/test/wasm/weak-undefined.ll +++ b/lld/test/wasm/weak-undefined.ll @@ -43,7 +43,7 @@ entry: ; CHECK-NEXT: FunctionTypes: [ 0, 1, 1, 0 ] ; CHECK-NEXT: - Type: TABLE ; CHECK-NEXT: Tables: -; CHECK-NEXT: - ElemType: ANYFUNC +; CHECK-NEXT: - ElemType: FUNCREF ; CHECK-NEXT: Limits: ; CHECK-NEXT: Flags: [ HAS_MAX ] ; CHECK-NEXT: Initial: 0x00000001 diff --git a/lld/wasm/OutputSections.cpp b/lld/wasm/OutputSections.cpp index 38d32d2..4123d63 100644 --- a/lld/wasm/OutputSections.cpp +++ b/lld/wasm/OutputSections.cpp @@ -142,7 +142,7 @@ DataSection::DataSection(ArrayRef Segments) if (Config->Pic) { assert(Segments.size() <= 1 && "Currenly only a single data segment is supported in PIC mode"); - InitExpr.Opcode = WASM_OPCODE_GET_GLOBAL; + InitExpr.Opcode = WASM_OPCODE_GLOBAL_GET; InitExpr.Value.Global = WasmSym::MemoryBase->getGlobalIndex(); } else { InitExpr.Opcode = WASM_OPCODE_I32_CONST; diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp index 710f9cc..42146c4 100644 --- a/lld/wasm/Writer.cpp +++ b/lld/wasm/Writer.cpp @@ -175,7 +175,7 @@ void Writer::createImportSection() { Import.Module = "env"; Import.Field = kFunctionTableName; Import.Kind = WASM_EXTERNAL_TABLE; - Import.Table.ElemType = WASM_TYPE_ANYFUNC; + Import.Table.ElemType = WASM_TYPE_FUNCREF; Import.Table.Limits = {0, TableSize, 0}; writeImport(OS, Import); } @@ -304,7 +304,7 @@ void Writer::createTableSection() { writeUleb128(OS, 1, "table count"); WasmLimits Limits = {WASM_LIMITS_FLAG_HAS_MAX, TableSize, TableSize}; - writeTableType(OS, WasmTable{WASM_TYPE_ANYFUNC, Limits}); + writeTableType(OS, WasmTable{WASM_TYPE_FUNCREF, Limits}); } void Writer::createExportSection() { @@ -364,7 +364,7 @@ void Writer::createElemSection() { writeUleb128(OS, 0, "table index"); WasmInitExpr InitExpr; if (Config->Pic) { - InitExpr.Opcode = WASM_OPCODE_GET_GLOBAL; + InitExpr.Opcode = WASM_OPCODE_GLOBAL_GET; InitExpr.Value.Global = WasmSym::TableBase->getGlobalIndex(); } else { InitExpr.Opcode = WASM_OPCODE_I32_CONST; diff --git a/lld/wasm/WriterUtils.cpp b/lld/wasm/WriterUtils.cpp index 6af152a..80bfc09 100644 --- a/lld/wasm/WriterUtils.cpp +++ b/lld/wasm/WriterUtils.cpp @@ -83,7 +83,7 @@ void wasm::writeInitExpr(raw_ostream &OS, const WasmInitExpr &InitExpr) { case WASM_OPCODE_I64_CONST: writeSleb128(OS, InitExpr.Value.Int64, "literal (i64)"); break; - case WASM_OPCODE_GET_GLOBAL: + case WASM_OPCODE_GLOBAL_GET: writeUleb128(OS, InitExpr.Value.Global, "literal (global index)"); break; default: @@ -120,7 +120,7 @@ void wasm::writeEvent(raw_ostream &OS, const WasmEvent &Event) { } void wasm::writeTableType(raw_ostream &OS, const llvm::wasm::WasmTable &Type) { - writeU8(OS, WASM_TYPE_ANYFUNC, "table type"); + writeU8(OS, WASM_TYPE_FUNCREF, "table type"); writeLimits(OS, Type.Limits); }