Bug ID: 41194
           Summary: opt -irce crashing with "Assertion `isa<X>(Val) &&
                    "cast<Ty>() argument of incompatible type!"' failed"
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations

Created attachment 21652

Reproduce with:
 opt -irce bbi-26117.ll -S -o -

which yields:

opt: ../include/llvm/Support/Casting.h:254: typename cast_retty<X, Y
*>::ret_type llvm::cast(Y *) [X = llvm::IntegerType, Y = llvm::Type]: Assertion
`isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
Stack dump:
0.      Program arguments: build-all/bin/opt -irce bbi-26117.ll -S -o - 
1.      Running pass 'Function Pass Manager' on module 'bbi-26117.ll'.
2.      Running pass 'Loop Pass Manager' on function '@test_read_imm_2'
3.      Running pass 'Inductive range check elimination' on basic block
 #0 0x000000000229a344 PrintStackTraceSignalHandler(void*)
 #1 0x0000000002298350 llvm::sys::RunSignalHandlers()
 #2 0x000000000229a6a8 SignalHandler(int) (build-all/bin/opt+0x229a6a8)
 #3 0x00007f6fcc262330 __restore_rt
 #4 0x00007f6fcae51c37 gsignal
 #5 0x00007f6fcae55028 abort
 #6 0x00007f6fcae4abf6 __assert_fail_base
 #7 0x00007f6fcae4aca2 (/lib/x86_64-linux-gnu/
 #8 0x0000000002063ca5 (anonymous
llvm::function_ref<void (llvm::Loop*, bool)>) (build-all/bin/opt+0x2063ca5)
 #9 0x0000000002066341 (anonymous
namespace)::IRCELegacyPass::runOnLoop(llvm::Loop*, llvm::LPPassManager&)
#10 0x00000000016fa4dc llvm::LPPassManager::runOnFunction(llvm::Function&)
#11 0x0000000001ca0d4d llvm::FPPassManager::runOnFunction(llvm::Function&)
#12 0x0000000001ca1008 llvm::FPPassManager::runOnModule(llvm::Module&)
#13 0x0000000001ca146a llvm::legacy::PassManagerImpl::run(llvm::Module&)
#14 0x00000000007a073b main (build-all/bin/opt+0x7a073b)
#15 0x00007f6fcae3cf45 __libc_start_main
#16 0x000000000078618d _start (build-all/bin/opt+0x78618d)

Starts crashing with r351926:

    [IRCE] Support narrow latch condition for wide range checks

    This patch relaxes restrictions on types of latch condition and range
    In current implementation, they should match. This patch allows to handle
    wide range checks against narrow condition. The motivating example is the

      int N = ...
      for (long i = 0; (int) i < N; i++) {
        if (i >= length) deopt;

    In this patch, the option that enables this support is turned off by
    default. We'll wait until it is switched to true.

    Differential Revision:
    Reviewed By: reames


You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to