GaloisInc / cclyzerpp

cclyzer++ is a precise and scalable pointer analysis for LLVM code.
https://galoisinc.github.io/cclyzerpp/
BSD 3-Clause "New" or "Revised" License
137 stars 14 forks source link

shufflevector only has 2 operands #162

Closed StarGazerM closed 1 year ago

StarGazerM commented 1 year ago

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).

langston-barrett commented 1 year ago

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.

adrianherrera commented 1 year ago

@StarGazerM this should be fixed by https://github.com/GaloisInc/cclyzerpp/pull/165

langston-barrett commented 1 year ago

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