[Legup-bugs] [Bug 223] New: Changing inline threshold causes assetion failure in Legup

bugzilla-daemon at legup.org bugzilla-daemon at legup.org
Mon Apr 3 19:12:53 EDT 2017


http://legup.eecg.utoronto.ca/bugs/show_bug.cgi?id=223

           Summary: Changing inline threshold causes assetion failure in
                    Legup
           Product: legup
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: New Bugs
        AssignedTo: andrewcanis at gmail.com
        ReportedBy: danielhn at ece.ubc.ca
                CC: legup-bugs at legup.org
   Estimated Hours: 0.0


Created attachment 120
  --> http://legup.eecg.utoronto.ca/bugs/attachment.cgi?id=120
Makefile.config for the examples folder

Hello,

I'm using the VirtualBox machine image for LegUp 4.0 and trying to disable
clang's inliner in order to evaluate only OPT's inliner. If I set clang's
threshold to it's default value I'm able to change OPT's inline threshold
without any problems. Nevertheless, if I turn off or decrease clang's threshold
to a low value (ex: 8), using a low threshold for OPT (ex:8) causes assertion
failures in Legup. This happens for dfadd, dfdiv, dfmul, dfsin, gsm, motion and
sha. 

To reproduce this issue please use the the VirtualBox machine image for LegUp
4.0 and substitute the makefile.config at the examples folder by the one
attached.

The following command is used for selecting (in this case disabling) clang's
inline threshold in line 45 (note that -mllvm is needed, otherwise clang would
still inline multiple call sites):
CFLAG += -mllvm -inline-threshold=-100

The following command is used for selecting OPT's inline threshold in line 282:
OPT_FLAGS += -inline-threshold=8

Assertion failure for dfsin (same happens with dfadd, dfdiv, dfmul and gsm):
# iterative modulo scheduling
../../../llvm/Release+Asserts/bin/opt
-load=../../../llvm/Release+Asserts/lib/LLVMLegUp.so
-legup-config=../../legup.tcl -legup-config=config.tcl -inline-threshold=8
-basicaa -loop-simplify -indvars2  -loop-pipeline dfsin.postlto.bc -o
dfsin.1.bc
../../../llvm/Release+Asserts/bin/opt
-load=../../../llvm/Release+Asserts/lib/LLVMLegUp.so
-legup-config=../../legup.tcl -legup-config=config.tcl -inline-threshold=8
-instcombine dfsin.1.bc -o dfsin.bc 
# produces textual bitcodes: dfsin.prelto.1.ll dfsin.prelto.ll dfsin.ll
../../../llvm/Release+Asserts/bin/llvm-dis dfsin.prelto.linked.bc
../../../llvm/Release+Asserts/bin/llvm-dis dfsin.prelto.6.bc
../../../llvm/Release+Asserts/bin/llvm-dis dfsin.prelto.bc
../../../llvm/Release+Asserts/bin/llvm-dis dfsin.postlto.bc
../../../llvm/Release+Asserts/bin/llvm-dis dfsin.postlto.6.bc
../../../llvm/Release+Asserts/bin/llvm-dis dfsin.postlto.8.bc
../../../llvm/Release+Asserts/bin/llvm-dis dfsin.1.bc
../../../llvm/Release+Asserts/bin/llvm-dis dfsin.bc
# produces verilog: dfsin.v
../../../llvm/Release+Asserts/bin/llc -legup-config=../../legup.tcl
-legup-config=config.tcl -march=v dfsin.bc -o dfsin.v
signal: memory_controller_out_a
llc: RTL.cpp:340: legup::RTLSignal* legup::RTLModule::find(std::string):
Assertion `r && "Couldn't find signal"' failed.
0  llc             0x000000000156eb42 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  llc             0x000000000156e764
2  libpthread.so.0 0x00002aca1b89d330
3  libc.so.6       0x00002aca1ca3ec37 gsignal + 55
4  libc.so.6       0x00002aca1ca42028 abort + 328
5  libc.so.6       0x00002aca1ca37bf6
6  libc.so.6       0x00002aca1ca37ca2
7  llc             0x0000000000720ac9 legup::RTLModule::find(std::string) + 185
8  llc             0x00000000006c0203
legup::GenerateRTL::connectFunctionMemorySignals(legup::State*,
llvm::CallInst*, std::string, std::string, int, std::string, int) + 1987
9  llc             0x00000000006c067e
legup::GenerateRTL::createFunctionMemorySignals(legup::State*, llvm::CallInst*,
std::string, std::string, int, std::string) + 334
10 llc             0x00000000006d1d51
legup::GenerateRTL::createFunction(llvm::CallInst&) + 1505
11 llc             0x00000000006d2868
legup::GenerateRTL::generateAllCallInsts() + 328
12 llc             0x00000000006dbfec
legup::GenerateRTL::generateRTL(legup::MinimizeBitwidth*) + 1196
13 llc             0x00000000006e2121
legup::LegupPass::runOnModule(llvm::Module&) + 2577
14 llc             0x0000000001489c9d
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 797
15 llc             0x0000000000625d39
16 llc             0x0000000000603a78 main + 376
17 libc.so.6       0x00002aca1ca29f45 __libc_start_main + 245
18 llc             0x000000000061f0da
Stack dump:
0.    Program arguments: ../../../llvm/Release+Asserts/bin/llc
-legup-config=../../legup.tcl -legup-config=config.tcl -march=v dfsin.bc -o
dfsin.v 
1.    Running pass 'LegupPass backend' on module 'dfsin.bc'.
make: *** [all] Aborted (core dumped)

Assertion failure for motion (same happens with sha):
# iterative modulo scheduling
../../../llvm/Release+Asserts/bin/opt
-load=../../../llvm/Release+Asserts/lib/LLVMLegUp.so
-legup-config=../../legup.tcl -legup-config=config.tcl -inline-threshold=8
-basicaa -loop-simplify -indvars2  -loop-pipeline mpeg2.postlto.bc -o
mpeg2.1.bc
../../../llvm/Release+Asserts/bin/opt
-load=../../../llvm/Release+Asserts/lib/LLVMLegUp.so
-legup-config=../../legup.tcl -legup-config=config.tcl -inline-threshold=8
-instcombine mpeg2.1.bc -o mpeg2.bc 
# produces textual bitcodes: mpeg2.prelto.1.ll mpeg2.prelto.ll mpeg2.ll
../../../llvm/Release+Asserts/bin/llvm-dis mpeg2.prelto.linked.bc
../../../llvm/Release+Asserts/bin/llvm-dis mpeg2.prelto.6.bc
../../../llvm/Release+Asserts/bin/llvm-dis mpeg2.prelto.bc
../../../llvm/Release+Asserts/bin/llvm-dis mpeg2.postlto.bc
../../../llvm/Release+Asserts/bin/llvm-dis mpeg2.postlto.6.bc
../../../llvm/Release+Asserts/bin/llvm-dis mpeg2.postlto.8.bc
../../../llvm/Release+Asserts/bin/llvm-dis mpeg2.1.bc
../../../llvm/Release+Asserts/bin/llvm-dis mpeg2.bc
# produces verilog: mpeg2.v
../../../llvm/Release+Asserts/bin/llc -legup-config=../../legup.tcl
-legup-config=config.tcl -march=v mpeg2.bc -o mpeg2.v
llc: Ram.h:60: std::string legup::RAM::getTagAddrName() const: Assertion
`getScope() == GLOBAL' failed.
0  llc             0x000000000156eb42 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  llc             0x000000000156e764
2  libpthread.so.0 0x00002b249390d330
3  libc.so.6       0x00002b2494aaec37 gsignal + 55
4  libc.so.6       0x00002b2494ab2028 abort + 328
5  libc.so.6       0x00002b2494aa7bf6
6  libc.so.6       0x00002b2494aa7ca2
7  llc             0x00000000006ca4e3 legup::GenerateRTL::getOp(legup::State*,
llvm::Value*, int&) + 1219
8  llc             0x00000000006cadee legup::GenerateRTL::getGEP(legup::State*,
llvm::User*, int&) + 62
9  llc             0x00000000006ca0a8 legup::GenerateRTL::getOp(legup::State*,
llvm::Value*, int&) + 136
10 llc             0x00000000006cb633 legup::GenerateRTL::getOp(legup::State*,
llvm::Value*) + 19
11 llc             0x00000000006d03a8
legup::GenerateRTL::visitStoreInst(llvm::StoreInst&) + 520
12 llc             0x00000000006d4286 legup::GenerateRTL::generateDatapath() +
342
13 llc             0x00000000006dc3b5
legup::GenerateRTL::generateRTL(legup::MinimizeBitwidth*) + 2165
14 llc             0x00000000006e2121
legup::LegupPass::runOnModule(llvm::Module&) + 2577
15 llc             0x0000000001489c9d
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 797
16 llc             0x0000000000625d39
17 llc             0x0000000000603a78 main + 376
18 libc.so.6       0x00002b2494a99f45 __libc_start_main + 245
19 llc             0x000000000061f0da
Stack dump:
0.    Program arguments: ../../../llvm/Release+Asserts/bin/llc
-legup-config=../../legup.tcl -legup-config=config.tcl -march=v mpeg2.bc -o
mpeg2.v 
1.    Running pass 'LegupPass backend' on module 'mpeg2.bc'.
make: *** [all] Aborted (core dumped)

Let me know if you need anything else.

Thank you,

Daniel Holanda

-- 
Configure bugmail: http://legup.eecg.utoronto.ca/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the Legup-bugs mailing list