We need to append extract instruction when do a bitcast to
a vector. Otherwise, we may trigger an assert as the extract
instruction uses a undefined vector.
After this patch, it becomes safe to do many rounds of scalarize
pass.
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Tested-by: "Song, Ruiling" <ruiling.song@intel.com>
{
if(bt->getOperand(0)->getType()->isVectorTy())
bt->setOperand(0, InsertToVector(bt, bt->getOperand(0)));
- if(bt->getType()->isVectorTy())
+ if(bt->getType()->isVectorTy()) {
+ setAppendPoint(bt);
extractFromVector(bt);
+ }
return false;
}