llc: Unknown command line argument '-debug-only=isel'

Hi LLVM developers,

llc -march=mips -debug-only=isel was able to work in Nov 8 2017 https://reviews.llvm.org/D39723

But it doesn't work now:

$ clang --version
LLVM China clang version 6.0.0 (git@github.com:llvm-mirror/clang.git 9b7b03045ee9b5622028537266aafeb9ea218ac1) (git@github.com:llvm-mirror/llvm.git 3a26601a88394c02603b8756527c55df9ab94d78) (based on LLVM 6.0.0svn)
Target: x86_64-redhat-linux
Thread model: posix
InstalledDir: /data/project/xiangzhai/llvm/build/./bin
$ llc --version
LLVM (http://llvm.org/):
LLVM version 6.0.0svn
Optimized build.
Default target: x86_64-redhat-linux
Host CPU: broadwell

llc: Unknown command line argument '-debug-only=isel'. Try: '/data/project/xiangzhai/llvm/build/bin/llc -help'
llc: Did you mean '-debug-pass=isel'?

I couldn't grep debug-only command flags or options via git log, please give me some hint, thanks a lot!

Hi Leslie,

Hi Leslie,

Hi LLVM developers,

llc -march=mips -debug-only=isel was able to work in Nov 8 2017 https://reviews.llvm.org/D39723

But it doesn't work now:

$ clang --version
LLVM China clang version 6.0.0 (git@github.com:llvm-mirror/clang.git 9b7b03045ee9b5622028537266aafeb9ea218ac1) (git@github.com:llvm-mirror/llvm.git 3a26601a88394c02603b8756527c55df9ab94d78) (based on LLVM 6.0.0svn)
Target: x86_64-redhat-linux
Thread model: posix
InstalledDir: /data/project/xiangzhai/llvm/build/./bin
$ llc --version
LLVM (http://llvm.org/):
   LLVM version 6.0.0svn
   Optimized build.

I see you’re running an optimized build.

You need a debug build to use "-debug-only”. I suggest you take a look at include/llvm/Support/Debug.h and the `DEBUG` macro.

-DCMAKE_BUILD_TYPE=Debug will eat up all my memory when linking... I experienced it.

I have good success with -DBUILD_SHARED_LIBS=True
-DLLVM_USE_SPLIT_DWARF=True. You'll also have better results if gold
is your system linker. If you have a recent LLD installed, you can set
-DLLVM_ENABLE_LLD=True.

Best,

Alex

Hi Leslie,

Hi LLVM developers,

llc -march=mips -debug-only=isel was able to work in Nov 8 2017
https://reviews.llvm.org/D39723

But it doesn't work now:

$ clang --version
LLVM China clang version 6.0.0 (git@github.com:llvm-mirror/clang.git
9b7b03045ee9b5622028537266aafeb9ea218ac1)
(git@github.com:llvm-mirror/llvm.git
3a26601a88394c02603b8756527c55df9ab94d78) (based on LLVM 6.0.0svn)
Target: x86_64-redhat-linux
Thread model: posix
InstalledDir: /data/project/xiangzhai/llvm/build/./bin
$ llc --version
LLVM (http://llvm.org/):
    LLVM version 6.0.0svn
    Optimized build.

I see you’re running an optimized build.

You need a debug build to use "-debug-only”. I suggest you take a look at
include/llvm/Support/Debug.h and the `DEBUG` macro.

-DCMAKE_BUILD_TYPE=Debug will eat up all my memory when linking... I
experienced it.

I have good success with -DBUILD_SHARED_LIBS=True
-DLLVM_USE_SPLIT_DWARF=True. You'll also have better results if gold
is your system linker. If you have a recent LLD installed, you can set
-DLLVM_ENABLE_LLD=True.

I will try those build options. I installed LLD to `/opt/llvm-svn/bin/ld.lld`
$ ld.lld --version
LLD 6.0.0 (trunk 317966) (compatible with GNU linkers)
And I use Fedora now, but I doesn't use Gentoo (10+ years) or ArchLinux (4+ years) any more, Ah! how do I act like an old man ...
Fedora 25 use GCC 6.4.1 and LLVM 3.9.1 by default, so my migration for DragonEgg is based on GCC 6.x and LLVM 3.9 firstly :slight_smile:

Hi Leslie,

Hi LLVM developers,

llc -march=mips -debug-only=isel was able to work in Nov 8 2017 https://reviews.llvm.org/D39723

But it doesn't work now:

$ clang --version
LLVM China clang version 6.0.0 (git@github.com:llvm-mirror/clang.git 9b7b03045ee9b5622028537266aafeb9ea218ac1) (git@github.com:llvm-mirror/llvm.git 3a26601a88394c02603b8756527c55df9ab94d78) (based on LLVM 6.0.0svn)
Target: x86_64-redhat-linux
Thread model: posix
InstalledDir: /data/project/xiangzhai/llvm/build/./bin
$ llc --version
LLVM (http://llvm.org/):
LLVM version 6.0.0svn
Optimized build.

I see you’re running an optimized build.

You need a debug build to use "-debug-only”. I suggest you take a look at include/llvm/Support/Debug.h and the `DEBUG` macro.

You don't need a debug build for this to work, enabling assertions should be enough. Try ReleaseAssert or RelWithDebInfoAssert.

-- adrian

Hi Leslie,

Hi LLVM developers,

llc -march=mips -debug-only=isel was able to work in Nov 8 2017 https://reviews.llvm.org/D39723

But it doesn't work now:

$ clang --version
LLVM China clang version 6.0.0 (git@github.com:llvm-mirror/clang.git 9b7b03045ee9b5622028537266aafeb9ea218ac1) (git@github.com:llvm-mirror/llvm.git 3a26601a88394c02603b8756527c55df9ab94d78) (based on LLVM 6.0.0svn)
Target: x86_64-redhat-linux
Thread model: posix
InstalledDir: /data/project/xiangzhai/llvm/build/./bin
$ llc --version
LLVM (http://llvm.org/):
  LLVM version 6.0.0svn
  Optimized build.

I see you’re running an optimized build.

You need a debug build to use "-debug-only”. I suggest you take a look at include/llvm/Support/Debug.h and the `DEBUG` macro.

You don't need a debug build for this to work, enabling assertions should be enough. Try ReleaseAssert or RelWithDebInfoAssert.

Works -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_ENABLE_ASSERTIONS=ON
$ llc -march=riscv32 -debug-only=isel test/CodeGen/RISCV/calling-conv.ll

...
ISEL: Match complete!
===== Instruction selection ends:
Selected selection DAG: %bb.0 'caller_large_struct_ret:'
SelectionDAG has 20 nodes:
t0: ch = EntryToken
t4: ch,glue = ADJCALLSTACKDOWN TargetConstant:i32<0>, TargetConstant:i32<0>, t0
t25: i32 = ADDI TargetFrameIndex:i32<0>, TargetConstant:i32<0>
t6: ch,glue = CopyToReg t4, Register:i32 %x10, t25
t9: i32 = LUI TargetGlobalAddress:i32<void (%struct.large*)* @callee_large_struct_ret> 0 [TF=2]
t10: i32 = ADDI t9, TargetGlobalAddress:i32<void (%struct.large*)* @callee_large_struct_ret> 0 [TF=1]
t12: ch,glue = PseudoCALL t10, Register:i32 %x10, RegisterMask:Untyped, t6, t6:1
t13: ch,glue = ADJCALLSTACKUP TargetConstant:i32<0>, TargetConstant:i32<0>, t12, t12:1
t16: i32,ch = LW<Mem:LD4[%2](align=8)(dereferenceable)> TargetFrameIndex:i32<0>, TargetConstant:i32<0>, t13
t19: i32,ch = LW<Mem:LD4[%4](dereferenceable)> TargetFrameIndex:i32<0>, TargetConstant:i32<12>, t13
t20: i32 = ADD t16, t19
t21: ch,glue = CopyToReg t13, Register:i32 %x10, t20
t22: ch = PseudoRET Register:i32 %x10, t21, t21:1

Total amount of phi nodes to update: 0
*** MachineFunction at end of ISel ***
# Machine code for function caller_large_struct_ret: IsSSA, TracksLiveness
Frame Objects:
fi#0: size=16, align=8, at location [SP]

%bb.0: derived from LLVM BB %0
ADJCALLSTACKDOWN 0, 0, implicit-def dead %x2, implicit %x2
%0:gpr = LUI target-flags(<unknown>) @callee_large_struct_ret; GPR:%0
%1:gpr = ADDI killed %0, target-flags(<unknown>) @callee_large_struct_ret; GPR:%1,%0
%2:gpr = ADDI %stack.0, 0; GPR:%2
%x10 = COPY %2; GPR:%2
PseudoCALL killed %1, <regmask %x1 %x3 %x4 %x8 %x9 %x18 %x19 %x20 %x21 %x22 %x23 %x24 %x25 %x26 %x27>, implicit-def dead %x1, implicit %x10, implicit-def %x2; GPR:%1
ADJCALLSTACKUP 0, 0, implicit-def dead %x2, implicit %x2
%3:gpr = LW %stack.0, 12; mem:LD4[%4](dereferenceable) GPR:%3
%4:gpr = LW %stack.0, 0; mem:LD4[%2](align=8)(dereferenceable) GPR:%4
%5:gpr = ADD killed %4, killed %3; GPR:%5,%4,%3
%x10 = COPY %5; GPR:%5
PseudoRET implicit %x10

# End machine code for function caller_large_struct_ret.

Thanks for your hint!