File tree Expand file tree Collapse file tree 7 files changed +8
-84
lines changed Expand file tree Collapse file tree 7 files changed +8
-84
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ add_llvm_target(EVMCodeGen
3737 EVMMarkRecursiveFunctions.cpp
3838 EVMMCInstLower.cpp
3939 EVMMachineFunctionInfo.cpp
40- EVMModuleLayout.cpp
4140 EVMOptimizeLiveIntervals.cpp
4241 EVMRegColoring.cpp
4342 EVMRegisterInfo.cpp
Original file line number Diff line number Diff line change @@ -57,7 +57,6 @@ FunctionPass *createEVMCodegenPreparePass();
5757ImmutablePass *createEVMAAWrapperPass ();
5858ImmutablePass *createEVMExternalAAWrapperPass ();
5959ModulePass *createEVMAlwaysInlinePass ();
60- ModulePass *createEVMModuleLayoutPass ();
6160
6261// ISel and immediate followup passes.
6362FunctionPass *createEVMISelDag (EVMTargetMachine &TM,
@@ -93,7 +92,6 @@ void initializeEVMBPStackificationPass(PassRegistry &);
9392void initializeEVMAAWrapperPassPass (PassRegistry &);
9493void initializeEVMExternalAAWrapperPass (PassRegistry &);
9594void initializeEVMAlwaysInlinePass (PassRegistry &);
96- void initializeEVMModuleLayoutPass (PassRegistry &);
9795void initializeEVMLowerJumpUnlessPass (PassRegistry &);
9896void initializeEVMFinalizeStackFramesPass (PassRegistry &);
9997void initializeEVMMarkRecursiveFunctionsPass (PassRegistry &);
Original file line number Diff line number Diff line change @@ -102,6 +102,11 @@ void EVMAsmPrinter::emitFunctionEntryLabel() {
102102}
103103
104104void EVMAsmPrinter::emitFunctionBodyStart () {
105+ if (MF->getFunction ().hasFnAttribute (" evm-entry-function" ) &&
106+ FirstFunctIsHandled)
107+ report_fatal_error (" Entry function '" + MF->getName () +
108+ " ' isn't the first function in the module." );
109+
105110 if (const auto *MFI = MF->getInfo <EVMMachineFunctionInfo>();
106111 MFI->getHasPushDeployAddress ()) {
107112 // TODO: #778. Move the function with PUSHDEPLOYADDRESS to the
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -65,7 +65,6 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeEVMTarget() {
6565 initializeEVMAAWrapperPassPass (PR);
6666 initializeEVMExternalAAWrapperPass (PR);
6767 initializeEVMAlwaysInlinePass (PR);
68- initializeEVMModuleLayoutPass (PR);
6968 initializeEVMLowerJumpUnlessPass (PR);
7069 initializeEVMFinalizeStackFramesPass (PR);
7170 initializeEVMMarkRecursiveFunctionsPass (PR);
@@ -238,7 +237,6 @@ bool EVMPassConfig::addPreISel() {
238237}
239238
240239void EVMPassConfig::addCodeGenPrepare () {
241- addPass (createEVMModuleLayoutPass ());
242240 addPass (createEVMCodegenPreparePass ());
243241 TargetPassConfig::addCodeGenPrepare ();
244242}
Original file line number Diff line number Diff line change @@ -55,8 +55,6 @@ target triple = "evm"
5555; CHECK-NEXT: Expand reduction intrinsics
5656; CHECK-NEXT: Natural Loop Information
5757; CHECK-NEXT: TLS Variable Hoist
58- ; CHECK-NEXT: EVM module layout
59- ; CHECK-NEXT: FunctionPass Manager
6058; CHECK-NEXT: Final transformations before code generation
6159; CHECK-NEXT: Dominator Tree Construction
6260; CHECK-NEXT: Natural Loop Information
Original file line number Diff line number Diff line change 1- ; RUN: llc -O3 < %s | FileCheck %s
1+ ; RUN: not --crash llc -O3 < %s 2>&1 | FileCheck %s
22target datalayout = "E-p:256:256-i256:256:256-S256-a:256:256"
33target triple = "evm"
44
55declare void @llvm.evm.return (ptr addrspace (1 ), i256 )
66
7- ; CHECK-LABEL: __entry:
8- ; CHECK-LABEL: fun_fib:
7+ ; CHECK: LLVM ERROR: Entry function '__entry' isn't the first function in the module.
98
109define private fastcc i256 @fun_fib (i256 %0 ) noinline {
1110entry:
1211 %res = add i256 %0 , 1
1312 ret i256 %res
1413}
1514
16- define void @__entry () noreturn {
15+ define void @__entry () noreturn "evm-entry-function" {
1716entry:
1817 %fun_res = tail call fastcc i256 @fun_fib (i256 7 )
1918 tail call void @llvm.evm.return (ptr addrspace (1 ) null , i256 %fun_res )
You can’t perform that action at this time.
0 commit comments