@@ -463,7 +463,7 @@ class OpLowerer {
463463 [[nodiscard]] bool lowerCtpopToCBits (Function &F) {
464464 IRBuilder<> &IRB = OpBuilder.getIRB ();
465465 Type *Int32Ty = IRB.getInt32Ty ();
466-
466+
467467 return replaceFunction (F, [&](CallInst *CI) -> Error {
468468 IRB.SetInsertPoint (CI);
469469 SmallVector<Value *> Args;
@@ -473,48 +473,48 @@ class OpLowerer {
473473 Type *FRT = F.getReturnType ();
474474 if (FRT->isVectorTy ()) {
475475 VectorType *VT = cast<VectorType>(FRT);
476- RetTy = VectorType::get (RetTy, VT);
476+ RetTy = VectorType::get (RetTy, VT);
477477 }
478-
479- Expected<CallInst *> OpCall =
480- OpBuilder. tryCreateOp ( dxil::OpCode::CBits, Args, CI->getName (), RetTy);
478+
479+ Expected<CallInst *> OpCall = OpBuilder. tryCreateOp (
480+ dxil::OpCode::CBits, Args, CI->getName (), RetTy);
481481 if (Error E = OpCall.takeError ())
482- return E;
482+ return E;
483483
484484 // If the result type is 32 bits we can do a direct replacement.
485485 if (FRT->isIntOrIntVectorTy (32 )) {
486486 CI->replaceAllUsesWith (*OpCall);
487- CI->eraseFromParent ();
488- return Error::success ();
487+ CI->eraseFromParent ();
488+ return Error::success ();
489489 }
490490
491491 unsigned CastOp;
492492 if (FRT->isIntOrIntVectorTy (16 ))
493- CastOp = Instruction::ZExt;
493+ CastOp = Instruction::ZExt;
494494 else // must be 64 bits
495- CastOp = Instruction::Trunc;
495+ CastOp = Instruction::Trunc;
496496
497497 // It is correct to replace the ctpop with the dxil op and
498498 // remove an existing cast iff the cast is the only usage of
499499 // the ctpop
500500 // can use hasOneUse instead of hasOneUser, because the user
501501 // we care about should have one operand
502502 if (CI->hasOneUse ()) {
503- User *U = CI->user_back ();
504- Instruction *I;
505- if (isa<Instruction>(U) && (I = cast<Instruction>(U)) &&
506- I->getOpcode () == CastOp && I->getType () == RetTy) {
503+ User *U = CI->user_back ();
504+ Instruction *I;
505+ if (isa<Instruction>(U) && (I = cast<Instruction>(U)) &&
506+ I->getOpcode () == CastOp && I->getType () == RetTy) {
507507 I->replaceAllUsesWith (*OpCall);
508- I->eraseFromParent ();
509- CI->eraseFromParent ();
510- return Error::success ();
511- }
508+ I->eraseFromParent ();
509+ CI->eraseFromParent ();
510+ return Error::success ();
511+ }
512512 }
513513
514514 // It is always correct to replace a ctpop with the dxil op and
515515 // a cast
516- Value *Cast = IRB. CreateZExtOrTrunc (*OpCall, F. getReturnType (),
517- " ctpop.cast" );
516+ Value *Cast =
517+ IRB. CreateZExtOrTrunc (*OpCall, F. getReturnType (), " ctpop.cast" );
518518 CI->replaceAllUsesWith (Cast);
519519 CI->eraseFromParent ();
520520 return Error::success ();
@@ -550,8 +550,8 @@ class OpLowerer {
550550 HasErrors |= lowerTypedBufferStore (F);
551551 break ;
552552 case Intrinsic::ctpop:
553- HasErrors |= lowerCtpopToCBits (F);
554- break ;
553+ HasErrors |= lowerCtpopToCBits (F);
554+ break ;
555555 }
556556 Updated = true ;
557557 }
0 commit comments