Lines Matching defs:Orig

73 static Value *expandVecReduceAdd(CallInst *Orig, Intrinsic::ID IntrinsicId) {
77 IRBuilder<> Builder(Orig);
80 Value *X = Orig->getOperand(IsFAdd ? 1 : 0);
88 Constant *StartValue = dyn_cast<Constant>(Orig->getOperand(0));
105 static Value *expandAbs(CallInst *Orig) {
106 Value *X = Orig->getOperand(0);
107 IRBuilder<> Builder(Orig);
121 static Value *expandCrossIntrinsic(CallInst *Orig) {
123 VectorType *VT = cast<VectorType>(Orig->getType());
128 Value *op0 = Orig->getOperand(0);
129 Value *op1 = Orig->getOperand(1);
130 IRBuilder<> Builder(Orig);
143 return Builder.CreateFSub(xy, yx, Orig->getName());
159 // The dot product is placed in the position indicated by Orig
160 static Value *expandFloatDotIntrinsic(CallInst *Orig, Value *A, Value *B) {
165 IRBuilder<> Builder(Orig);
192 // Create the appropriate DXIL float dot intrinsic for the operands of Orig
194 // The dot product is placed in the position indicated by Orig
195 static Value *expandFloatDotIntrinsic(CallInst *Orig) {
196 return expandFloatDotIntrinsic(Orig, Orig->getOperand(0),
197 Orig->getOperand(1));
201 static Value *expandIntegerDotIntrinsic(CallInst *Orig,
205 Value *A = Orig->getOperand(0);
206 Value *B = Orig->getOperand(1);
211 IRBuilder<> Builder(Orig);
234 static Value *expandExpIntrinsic(CallInst *Orig) {
235 Value *X = Orig->getOperand(0);
236 IRBuilder<> Builder(Orig);
248 Exp2Call->setTailCall(Orig->isTailCall());
249 Exp2Call->setAttributes(Orig->getAttributes());
253 static Value *expandAnyOrAllIntrinsic(CallInst *Orig,
255 Value *X = Orig->getOperand(0);
256 IRBuilder<> Builder(Orig);
294 static Value *expandLerpIntrinsic(CallInst *Orig) {
295 Value *X = Orig->getOperand(0);
296 Value *Y = Orig->getOperand(1);
297 Value *S = Orig->getOperand(2);
298 IRBuilder<> Builder(Orig);
304 static Value *expandLogIntrinsic(CallInst *Orig,
306 Value *X = Orig->getOperand(0);
307 IRBuilder<> Builder(Orig);
318 Log2Call->setTailCall(Orig->isTailCall());
319 Log2Call->setAttributes(Orig->getAttributes());
322 static Value *expandLog10Intrinsic(CallInst *Orig) {
323 return expandLogIntrinsic(Orig, numbers::ln2f / numbers::ln10f);
328 static Value *expandNormalizeIntrinsic(CallInst *Orig) {
329 Value *X = Orig->getOperand(0);
330 Type *Ty = Orig->getType();
332 IRBuilder<> Builder(Orig);
345 Value *DotProduct = expandFloatDotIntrinsic(Orig, X, X);
365 static Value *expandAtan2Intrinsic(CallInst *Orig) {
366 Value *Y = Orig->getOperand(0);
367 Value *X = Orig->getOperand(1);
369 IRBuilder<> Builder(Orig);
370 Builder.setFastMathFlags(Orig->getFastMathFlags());
376 Atan->setTailCall(Orig->isTailCall());
377 Atan->setAttributes(Orig->getAttributes());
413 static Value *expandPowIntrinsic(CallInst *Orig) {
415 Value *X = Orig->getOperand(0);
416 Value *Y = Orig->getOperand(1);
418 IRBuilder<> Builder(Orig);
425 Exp2Call->setTailCall(Orig->isTailCall());
426 Exp2Call->setAttributes(Orig->getAttributes());
430 static Value *expandStepIntrinsic(CallInst *Orig) {
432 Value *X = Orig->getOperand(0);
433 Value *Y = Orig->getOperand(1);
435 IRBuilder<> Builder(Orig);
452 static Value *expandRadiansIntrinsic(CallInst *Orig) {
453 Value *X = Orig->getOperand(0);
455 IRBuilder<> Builder(Orig);
478 static Value *expandClampIntrinsic(CallInst *Orig,
480 Value *X = Orig->getOperand(0);
481 Value *Min = Orig->getOperand(1);
482 Value *Max = Orig->getOperand(2);
484 IRBuilder<> Builder(Orig);
491 static Value *expandDegreesIntrinsic(CallInst *Orig) {
492 Value *X = Orig->getOperand(0);
494 IRBuilder<> Builder(Orig);
499 static Value *expandSignIntrinsic(CallInst *Orig) {
500 Value *X = Orig->getOperand(0);
503 Type *RetTy = Orig->getType();
506 IRBuilder<> Builder(Orig);
525 static bool expandIntrinsic(Function &F, CallInst *Orig) {
530 Result = expandAbs(Orig);
533 Result = expandAtan2Intrinsic(Orig);
536 Result = expandExpIntrinsic(Orig);
539 Result = expandLogIntrinsic(Orig);
542 Result = expandLog10Intrinsic(Orig);
545 Result = expandPowIntrinsic(Orig);
549 Result = expandAnyOrAllIntrinsic(Orig, IntrinsicId);
552 Result = expandCrossIntrinsic(Orig);
557 Result = expandClampIntrinsic(Orig, IntrinsicId);
560 Result = expandDegreesIntrinsic(Orig);
563 Result = expandLerpIntrinsic(Orig);
566 Result = expandNormalizeIntrinsic(Orig);
569 Result = expandFloatDotIntrinsic(Orig);
573 Result = expandIntegerDotIntrinsic(Orig, IntrinsicId);
576 Result = expandSignIntrinsic(Orig);
579 Result = expandStepIntrinsic(Orig);
582 Result = expandRadiansIntrinsic(Orig);
586 Result = expandVecReduceAdd(Orig, IntrinsicId);
590 Orig->replaceAllUsesWith(Result);
591 Orig->eraseFromParent();