reference, declaration → definition definition → references, declarations, derived classes, virtual overrides reference to multiple definitions → definitions unreferenced |
284 assert(needsPromotionToI32(I.getType()) && 287 if (I.getOpcode() == Instruction::SDiv || 288 I.getOpcode() == Instruction::UDiv || 289 I.getOpcode() == Instruction::SRem || 290 I.getOpcode() == Instruction::URem) 293 IRBuilder<> Builder(&I); 294 Builder.SetCurrentDebugLocation(I.getDebugLoc()); 296 Type *I32Ty = getI32Ty(Builder, I.getType()); 302 if (isSigned(I)) { 303 ExtOp0 = Builder.CreateSExt(I.getOperand(0), I32Ty); 304 ExtOp1 = Builder.CreateSExt(I.getOperand(1), I32Ty); 306 ExtOp0 = Builder.CreateZExt(I.getOperand(0), I32Ty); 307 ExtOp1 = Builder.CreateZExt(I.getOperand(1), I32Ty); 310 ExtRes = Builder.CreateBinOp(I.getOpcode(), ExtOp0, ExtOp1); 312 if (promotedOpIsNSW(cast<Instruction>(I))) 315 if (promotedOpIsNUW(cast<Instruction>(I))) 318 if (const auto *ExactOp = dyn_cast<PossiblyExactOperator>(&I)) 322 TruncRes = Builder.CreateTrunc(ExtRes, I.getType()); 324 I.replaceAllUsesWith(TruncRes); 325 I.eraseFromParent();