message: Fixed base pointer and offset in lGetBasePtrAndOffsets
diff: @@ -769,17 +769,31 @@ LLVMFlattenInsertChain(llvm::Value *inst, int vectorWidth,
  // %broadcast_init.0 = insertelement <4 x i32> undef, i32 %val, i32 0
  // %broadcast.1 = shufflevector <4 x i32> %smear.0, <4 x i32> undef,
  // <4 x i32> zeroinitializer
  + // Or:
  + // %gep_ptr2int_broadcast_init = insertelement <8 x i64> undef, i64 %gep_ptr2int, i32 0
  + // %0 = add <8 x i64> %gep_ptr2int_broadcast_init, <i64 4, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef, i64 undef>
  + // %gep_offset = shufflevector <8 x i64> %0, <8 x i64> undef, <8 x i32> zeroinitializer
  else if (llvm::ShuffleVectorInst *shuf =
  llvm::dyn_cast<llvm::ShuffleVectorInst>(inst)) {
  llvm::Value *indices = shuf->getOperand(2);
  if (llvm::isa<llvm::ConstantAggregateZero>(indices)) {
  llvm::Value *op = shuf->getOperand(0);
  llvm::InsertElementInst *ie = llvm::dyn_cast<llvm::InsertElementInst>(op);
  + if (ie == NULL) {
  + // Trying to recognize 2nd pattern
  + llvm::Value *indices = shuf->getOperand(2);
  + if (!llvm::isa<llvm::ConstantAggregateZero>(indices)) {
  + return NULL;
  + }
  + llvm::BinaryOperator * bop = llvm::dyn_cast<llvm::BinaryOperator>(op);
  + if (bop != NULL && bop->getOpcode() == llvm::Instruction::Add) {
  + ie = llvm::dyn_cast<llvm::InsertElementInst>(bop->getOperand(0));
  + }
  + }
  if (ie != NULL &&
  llvm::isa<llvm::UndefValue>(ie->getOperand(0))) {
  llvm::ConstantInt *ci =
  llvm::dyn_cast<llvm::ConstantInt>(ie->getOperand(2));
  -
  if (ci->isZero()) {
  return ie->getOperand(1);
  }
  @@ -790,6 +804,7 @@ LLVMFlattenInsertChain(llvm::Value *inst, int vectorWidth,
  }
  +
  bool
  LLVMExtractVectorInts(llvm::Value *v, int64_t ret[], int *nElts) {
  // Make sure we do in fact have a vector of integer values here
  