diff --git a/Makefile b/Makefile index b5e8992d..2805d72c 100644 --- a/Makefile +++ b/Makefile @@ -90,13 +90,13 @@ build/tgo: *.go go build -o build/tgo -i . # Build IR with the Go compiler. -build/%.o: src/examples/% src/examples/%/*.go build/tgo src/runtime/*.go build/runtime-$(TARGET)-combined.bc +build/%.bc: src/examples/% src/examples/%/*.go build/tgo src/runtime/*.go build/runtime-$(TARGET)-combined.bc ./build/tgo $(TGOFLAGS) -runtime build/runtime-$(TARGET)-combined.bc -o $@ $(subst src/,,$<) # Compile and optimize bitcode file. -#build/%.o: build/%.bc -# $(OPT) -coro-early -coro-split -coro-elide -Os -coro-cleanup -o $< $< -# $(LLC) -filetype=obj -o $@ $< +build/%.o: build/%.bc + $(OPT) -Os -enable-coroutines -o $< $< + $(LLC) -filetype=obj -o $@ $< # Compile C sources for the runtime. build/%.bc: src/runtime/%.c src/runtime/*.h diff --git a/compiler.go b/compiler.go index dbb9b3c9..297fb454 100644 --- a/compiler.go +++ b/compiler.go @@ -1746,12 +1746,8 @@ func (c *Compiler) Optimize(optLevel, sizeLevel int) { builder.PopulateFunc(funcPasses) modPasses := llvm.NewPassManager() - modPasses.AddCoroEarlyPass() - modPasses.AddCoroSplitPass() - modPasses.AddCoroElidePass() defer modPasses.Dispose() builder.Populate(modPasses) - modPasses.AddCoroCleanupPass() modPasses.Run(c.mod) } diff --git a/main.go b/main.go index 8d44f6a3..0e0ad398 100644 --- a/main.go +++ b/main.go @@ -55,7 +55,7 @@ func Compile(pkgName, runtimePath, outpath, target string, printIR, dumpSSA bool if err := c.Verify(); err != nil { return err } - c.Optimize(2, 1) // -O2 -Os + //c.Optimize(2, 1) // -O2 -Os if err := c.Verify(); err != nil { return err }