[llvm-bugs] [Bug 25498] New: codegen crash with i256 instructions

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 11 15:30:35 PST 2015


https://llvm.org/bugs/show_bug.cgi?id=25498

            Bug ID: 25498
           Summary: codegen crash with i256 instructions
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: spatel+llvm at rotateright.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Using llc built from r252817:

$ cat scheduler-backtracking.ll 
define i256 @foo(i256 %a) {
  %b = sub i256 0, %a
  %cmpz = icmp eq i256 %b, 0
  br i1 %cmpz, label %cond.end, label %cond.false

cond.false:
  %d = call i256 @llvm.ctlz.i256(i256 %b, i1 true)
  br label %cond.end

cond.end:
  %ctz = phi i256 [ 256, %0 ], [ %d, %cond.false ]
  ret i256 %ctz
}
declare i256 @llvm.ctlz.i256(i256, i1) nounwind readnone

$ ./llc -o - scheduler-backtracking.ll -pre-RA-sched=linearize -march=x86-64   
.section    __TEXT,__text,regular,pure_instructions
    .macosx_version_min 15, 0
    .syntax unified
Assertion failed: (isImm() && "Wrong MachineOperand accessor"), function
getImm, file /Users/spatel/myllvm/llvm/include/llvm/CodeGen/MachineOperand.h,
line 411.
0  llc                      0x000000010381c51e
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 46
1  llc                      0x000000010381c969
PrintStackTraceSignalHandler(void*) + 25
2  llc                      0x0000000103819109 llvm::sys::RunSignalHandlers() +
425
3  llc                      0x000000010381cca9 SignalHandler(int) + 345
4  libsystem_platform.dylib 0x00007fff9924352a _sigtramp + 26
5  libsystem_platform.dylib 0x00007fff6453c8d5 _sigtramp + 3408892869
6  llc                      0x000000010381c98b raise + 27
7  llc                      0x000000010381ca42 abort + 18
8  llc                      0x000000010381ca21 __assert_rtn + 129
9  llc                      0x00000001014cd428 llvm::MachineOperand::getImm()
const + 104
10 llc                      0x0000000101938908
llvm::ARMBaseInstrInfo::optimizeCompareInstr(llvm::MachineInstr*, unsigned int,
unsigned int, int, int, llvm::MachineRegisterInfo const*) const + 2584
11 llc                      0x0000000102c259c6 (anonymous
namespace)::PeepholeOptimizer::optimizeCmpInstr(llvm::MachineInstr*,
llvm::MachineBasicBlock*) + 230
12 llc                      0x0000000102c24bd0 (anonymous
namespace)::PeepholeOptimizer::runOnMachineFunction(llvm::MachineFunction&) +
1152
13 llc                      0x0000000102b42fee
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 110
14 llc                      0x000000010308bb3d
llvm::FPPassManager::runOnFunction(llvm::Function&) + 413
15 llc                      0x000000010308be75
llvm::FPPassManager::runOnModule(llvm::Module&) + 117
16 llc                      0x000000010308cbca (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&) + 2010
17 llc                      0x000000010308c15b
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 347
18 llc                      0x000000010308d811
llvm::legacy::PassManager::run(llvm::Module&) + 33
19 llc                      0x00000001014813f7 compileModule(char**,
llvm::LLVMContext&) + 19239
20 llc                      0x000000010147c866 main + 230
21 libdyld.dylib            0x00007fff84ef65ad start + 1
Stack dump:
0.    Program arguments: ./llc -o - scheduler-backtracking.ll
-pre-RA-sched=linearize -march=arm 
1.    Running pass 'Function Pass Manager' on module
'scheduler-backtracking.ll'.
2.    Running pass 'Peephole Optimizations' on function '@foo'
Illegal instruction: 4

-- 
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/20151111/2b8b501d/attachment.html>


More information about the llvm-bugs mailing list