[LLVMbugs] [Bug 21283] New: Can't always pass i1 as stackmap args

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Oct 15 04:09:44 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=21283

            Bug ID: 21283
           Summary: Can't always pass i1 as stackmap args
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: kmod at dropbox.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13205
  --> http://llvm.org/bugs/attachment.cgi?id=13205&action=edit
"llc legalize.ll"

I don't really understand all the legalization and custom lowering, but it
looks like stackmaps have trouble getting passed an i1 (or other illegal
integer type) argument if we don't have a legalized representation already
available.  So it works to pass a function argument or a constant, but we can't
pass a phi, for example.

Here's what I end up seeing:

$ gdb --args llc legalize.ll
[snip]
Should not custom lower this!
UNREACHABLE executed at
/mnt/kmod/pyston_deps/llvm-test/lib/Target/X86/X86ISelLowering.cpp:18663!

Program received signal SIGABRT, Aborted.
0x00007ffff69c8bb9 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007ffff69c8bb9 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff69cbfc8 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x000000000147d45a in llvm::llvm_unreachable_internal (msg=0x156d093
"Should not custom lower this!", 
    file=0x1567d08
"/mnt/kmod/pyston_deps/llvm-test/lib/Target/X86/X86ISelLowering.cpp",
line=18663)
    at /mnt/kmod/pyston_deps/llvm-test/lib/Support/ErrorHandling.cpp:117
#3  0x0000000000a62fef in llvm::X86TargetLowering::LowerOperation
(this=0x202d9e0, Op=..., DAG=...)
    at /mnt/kmod/pyston_deps/llvm-test/lib/Target/X86/X86ISelLowering.cpp:18663
#4  0x0000000000c395ab in llvm::TargetLowering::LowerOperationWrapper
(this=0x202d9e0, N=0x208e098, Results=..., DAG=...)
    at
/mnt/kmod/pyston_deps/llvm-test/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:7377
#5  0x0000000000c96c9c in llvm::DAGTypeLegalizer::CustomLowerNode
(this=0x7fffffffba50, N=0x208e098, VT=..., LegalizeResult=false)
    at
/mnt/kmod/pyston_deps/llvm-test/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:918
#6  0x0000000000cd2a80 in llvm::DAGTypeLegalizer::PromoteIntegerOperand
(this=0x7fffffffba50, N=0x208e098, OpNo=5)
    at
/mnt/kmod/pyston_deps/llvm-test/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:792
#7  0x0000000000c93ad8 in llvm::DAGTypeLegalizer::run (this=0x7fffffffba50)
    at
/mnt/kmod/pyston_deps/llvm-test/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:284
#8  0x0000000000c9856b in llvm::SelectionDAG::LegalizeTypes (this=0x2056400)
    at
/mnt/kmod/pyston_deps/llvm-test/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:1113
#9  0x0000000000c5a780 in llvm::SelectionDAGISel::CodeGenAndEmitDAG
(this=0x2056090)
    at
/mnt/kmod/pyston_deps/llvm-test/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:685
#10 0x0000000000c59fc9 in llvm::SelectionDAGISel::SelectBasicBlock
(this=0x2056090, Begin=..., End=..., HadTailCall=@0x7fffffffcc9f: false)
    at
/mnt/kmod/pyston_deps/llvm-test/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:602
#11 0x0000000000c5ccfe in llvm::SelectionDAGISel::SelectAllBasicBlocks
(this=0x2056090, Fn=...)
    at
/mnt/kmod/pyston_deps/llvm-test/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1236
#12 0x0000000000c591f5 in llvm::SelectionDAGISel::runOnMachineFunction
(this=0x2056090, mf=...)
    at
/mnt/kmod/pyston_deps/llvm-test/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:451
#13 0x00000000009b44d8 in (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction (this=0x2056090, MF=...)
    at /mnt/kmod/pyston_deps/llvm-test/lib/Target/X86/X86ISelDAGToDAG.cpp:170
#14 0x0000000000e4cfab in llvm::MachineFunctionPass::runOnFunction
(this=0x2056090, F=...)
    at /mnt/kmod/pyston_deps/llvm-test/lib/CodeGen/MachineFunctionPass.cpp:33
#15 0x0000000001409050 in llvm::FPPassManager::runOnFunction (this=0x20542e0,
F=...)
    at /mnt/kmod/pyston_deps/llvm-test/lib/IR/LegacyPassManager.cpp:1544
#16 0x00000000014091c0 in llvm::FPPassManager::runOnModule (this=0x20542e0,
M=...)
    at /mnt/kmod/pyston_deps/llvm-test/lib/IR/LegacyPassManager.cpp:1564
#17 0x0000000001409514 in (anonymous namespace)::MPPassManager::runOnModule
(this=0x202b4d0, M=...)
    at /mnt/kmod/pyston_deps/llvm-test/lib/IR/LegacyPassManager.cpp:1622
#18 0x0000000001409bbe in llvm::legacy::PassManagerImpl::run (this=0x202b160,
M=...)
    at /mnt/kmod/pyston_deps/llvm-test/lib/IR/LegacyPassManager.cpp:1729
#19 0x0000000001409ddd in llvm::legacy::PassManager::run (this=0x7fffffffd590,
M=...)
    at /mnt/kmod/pyston_deps/llvm-test/lib/IR/LegacyPassManager.cpp:1766
#20 0x0000000000903172 in compileModule (argv=0x7fffffffd9a8, Context=...) at
/mnt/kmod/pyston_deps/llvm-test/tools/llc/llc.cpp:351
#21 0x00000000009023f6 in main (argc=2, argv=0x7fffffffd9a8) at
/mnt/kmod/pyston_deps/llvm-test/tools/llc/llc.cpp:199



I'd be happy to take a crack at this but I'm not sure how to move forward.  It
seems like we shouldn't generate any code to promote the integer arguments and
instead should emit whatever subregister they are in, though I don't think the
stackmap binary format can specify that.  Though I guess in theory the frontend
should know the size of the arguments that it passed?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141015/9c274654/attachment.html>


More information about the llvm-bugs mailing list