GaloisInc/cclyzerpp

shufflevector only has 2 operands

StarGazerM opened this issue · 3 comments

Hi:
I found in factgen-exe instruction visitor line 687, its trying to fetch third op as Mask, but actually in LLVM Impl, mask is not a operand but a special attribute. This will cause all bitcode use shufflevector throw a

factgen-exe: /usr/include/llvm/IR/Instructions.h:2402: llvm::Value *llvm::ShuffleVectorInst::getOperand(unsigned int) const: Assertion `i_nocapture < OperandTraits<ShuffleVectorInst>::operands(this) && "getOperand() out of range!"' failed.

LLVM version 15.0.7
Example test program https://drive.google.com/file/d/1FlqqjZUQrITlAjpmFi4roefH3UCHTmI9/view?usp=share_link
Test program is redis-server build with gclang(with clang-15).

Thanks for the report @StarGazerM! This does indeed look like a bug. You may be able to work around it by compiling with -fno-vectorize -fno-slp-vectorize and/or at lower optimization levels.

Here's the relevant part of the language reference.

@StarGazerM this should be fixed by #165

Closing unless we hear otherwise, thanks for the catch @adrianherrera!