[llvm] r346187 - Revert "[WebAssembly] Fixup `main` signature by default"
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 5 16:31:02 PST 2018
Author: sbc
Date: Mon Nov 5 16:31:02 2018
New Revision: 346187
URL: http://llvm.org/viewvc/llvm-project?rev=346187&view=rev
Log:
Revert "[WebAssembly] Fixup `main` signature by default"
This reverts rL345880. It caused some test failures on the
webassembly waterfall. e.g. binaryen2.test_mainenv fails due
the fact that `envp` ends up being undef rather than 0.
Differential Revision: https://reviews.llvm.org/D54117
Modified:
llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp
llvm/trunk/test/CodeGen/WebAssembly/call.ll
llvm/trunk/test/CodeGen/WebAssembly/function-bitcasts-varargs.ll
llvm/trunk/test/CodeGen/WebAssembly/function-bitcasts.ll
llvm/trunk/test/CodeGen/WebAssembly/main-declaration.ll
llvm/trunk/test/CodeGen/WebAssembly/main-no-args.ll
llvm/trunk/test/CodeGen/WebAssembly/main-with-args.ll
Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp?rev=346187&r1=346186&r2=346187&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp Mon Nov 5 16:31:02 2018
@@ -36,6 +36,11 @@ using namespace llvm;
#define DEBUG_TYPE "wasm-fix-function-bitcasts"
+static cl::opt<bool>
+ TemporaryWorkarounds("wasm-temporary-workarounds",
+ cl::desc("Apply certain temporary workarounds"),
+ cl::init(true), cl::Hidden);
+
namespace {
class FixFunctionBitcasts final : public ModulePass {
StringRef getPassName() const override {
@@ -236,7 +241,7 @@ bool FixFunctionBitcasts::runOnModule(Mo
// "int main(int argc, char *argv[])", create an artificial call with it
// bitcasted to that type so that we generate a wrapper for it, so that
// the C runtime can call it.
- if (!F.isDeclaration() && F.getName() == "main") {
+ if (!TemporaryWorkarounds && !F.isDeclaration() && F.getName() == "main") {
Main = &F;
LLVMContext &C = M.getContext();
Type *MainArgTys[] = {Type::getInt32Ty(C),
Modified: llvm/trunk/test/CodeGen/WebAssembly/call.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/call.ll?rev=346187&r1=346186&r2=346187&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/call.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/call.ll Mon Nov 5 16:31:02 2018
@@ -1,5 +1,5 @@
-; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -mattr=+sign-ext,+simd128 | FileCheck %s
-; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -fast-isel -fast-isel-abort=1 -mattr=+sign-ext,+simd128 | FileCheck %s
+; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -wasm-temporary-workarounds=false -mattr=+sign-ext,+simd128 | FileCheck %s
+; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -fast-isel -fast-isel-abort=1 -wasm-temporary-workarounds=false -mattr=+sign-ext,+simd128 | FileCheck %s
; Test that basic call operations assemble as expected.
Modified: llvm/trunk/test/CodeGen/WebAssembly/function-bitcasts-varargs.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/function-bitcasts-varargs.ll?rev=346187&r1=346186&r2=346187&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/function-bitcasts-varargs.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/function-bitcasts-varargs.ll Mon Nov 5 16:31:02 2018
@@ -1,4 +1,4 @@
-; RUN: llc < %s -asm-verbose=false -wasm-keep-registers | FileCheck %s
+; RUN: llc < %s -asm-verbose=false -wasm-temporary-workarounds=false -wasm-keep-registers | FileCheck %s
; Test that function pointer casts casting away varargs are replaced with
; wrappers.
Modified: llvm/trunk/test/CodeGen/WebAssembly/function-bitcasts.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/function-bitcasts.ll?rev=346187&r1=346186&r2=346187&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/function-bitcasts.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/function-bitcasts.ll Mon Nov 5 16:31:02 2018
@@ -1,4 +1,4 @@
-; RUN: llc < %s -asm-verbose=false -wasm-disable-explicit-locals -wasm-keep-registers -enable-emscripten-cxx-exceptions | FileCheck %s
+; RUN: llc < %s -asm-verbose=false -wasm-disable-explicit-locals -wasm-keep-registers -enable-emscripten-cxx-exceptions -wasm-temporary-workarounds=false | FileCheck %s
; Test that function pointer casts are replaced with wrappers.
Modified: llvm/trunk/test/CodeGen/WebAssembly/main-declaration.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/main-declaration.ll?rev=346187&r1=346186&r2=346187&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/main-declaration.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/main-declaration.ll Mon Nov 5 16:31:02 2018
@@ -1,4 +1,4 @@
-; RUN: llc < %s -asm-verbose=false | FileCheck %s
+; RUN: llc < %s -asm-verbose=false -wasm-temporary-workarounds=false | FileCheck %s
; Test main functions with alternate signatures.
Modified: llvm/trunk/test/CodeGen/WebAssembly/main-no-args.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/main-no-args.ll?rev=346187&r1=346186&r2=346187&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/main-no-args.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/main-no-args.ll Mon Nov 5 16:31:02 2018
@@ -1,4 +1,4 @@
-; RUN: llc < %s -asm-verbose=false | FileCheck %s
+; RUN: llc < %s -asm-verbose=false -wasm-temporary-workarounds=false | FileCheck %s
; Test main functions with alternate signatures.
Modified: llvm/trunk/test/CodeGen/WebAssembly/main-with-args.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/main-with-args.ll?rev=346187&r1=346186&r2=346187&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/main-with-args.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/main-with-args.ll Mon Nov 5 16:31:02 2018
@@ -1,4 +1,4 @@
-; RUN: llc < %s -asm-verbose=false | FileCheck %s
+; RUN: llc < %s -asm-verbose=false -wasm-temporary-workarounds=false | FileCheck %s
; Test that main function with expected signature is not wrapped
More information about the llvm-commits
mailing list