}
// ffs(x) -> x != 0 ? (i32)llvm.cttz(x)+1 : 0
- const Type *ArgType = Op->getType();
+ Type *ArgType = Op->getType();
Value *F = Intrinsic::getDeclaration(Callee->getParent(),
Intrinsic::cttz, &ArgType, 1);
Value *V = B.CreateCall(F, Op, "cttz");
return V;
}
- // sprintf(str, format, ...) -> iprintf(str, format, ...) if no floating
+ // sprintf(str, format, ...) -> siprintf(str, format, ...) if no floating
// point arguments.
if (TLI->has(LibFunc::siprintf) && !CallHasFloatingPointArgument(CI)) {
Module *M = B.GetInsertBlock()->getParent()->getParent();
// Set the builder to the instruction after the call.
Builder.SetInsertPoint(BB, I);
+ // Use debug location of CI for all new instructions.
+ Builder.SetCurrentDebugLocation(CI->getDebugLoc());
+
// Try to optimize this call.
Value *Result = LCO->OptimizeCall(CI, TD, TLI, Builder);
if (Result == 0) continue;