<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - codegen crash with i256 instructions"
   href="https://llvm.org/bugs/show_bug.cgi?id=25498">25498</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>codegen crash with i256 instructions
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Common Code Generator Code
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>spatel+llvm@rotateright.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>