llvm-project
llvm-project copied to clipboard
Function replaceCongruentIVs can crash if incoming phi value is a global variable
| Bugzilla Link | 26574 |
| Version | trunk |
| OS | Linux |
| Attachments | Reduced input file with crash in indvars |
Extended Description
I found this crash in one of our internal test suites and reduced it to the attached repr.ll.
opt -S -indvars repr.ll
crashes like this:
opt: ../include/llvm/Support/Casting.h:237: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = llvm::Instruction, Y = llvm::Value]: Assertion `isa
Called from this line in ScalarEvolutionExpander.cpp:
Instruction *OrigInc =
cast
(gdb) p OrigPhiRef->dump() %_tmp19 = phi i16** [ @pglob, %bb_lslct36 ], [ %_tmp196, %bb2 ]
pglob is a "external global i16*" here.