forked from OSchip/llvm-project
transform fabs/fabsf calls into FABS nodes.
llvm-svn: 21014
This commit is contained in:
parent
a0c72cf289
commit
0c14000760
|
@ -652,8 +652,19 @@ void SelectionDAGLowering::visitStore(StoreInst &I) {
|
|||
void SelectionDAGLowering::visitCall(CallInst &I) {
|
||||
const char *RenameFn = 0;
|
||||
if (Function *F = I.getCalledFunction())
|
||||
if (F->isExternal())
|
||||
switch (F->getIntrinsicID()) {
|
||||
case 0: break; // Not an intrinsic.
|
||||
case 0: // Not an LLVM intrinsic.
|
||||
if (F->getName() == "fabs" || F->getName() == "fabsf") {
|
||||
if (I.getNumOperands() == 2 && // Basic sanity checks.
|
||||
I.getOperand(1)->getType()->isFloatingPoint() &&
|
||||
I.getType() == I.getOperand(1)->getType()) {
|
||||
SDOperand Tmp = getValue(I.getOperand(1));
|
||||
setValue(&I, DAG.getNode(ISD::FABS, Tmp.getValueType(), Tmp));
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Intrinsic::vastart: visitVAStart(I); return;
|
||||
case Intrinsic::vaend: visitVAEnd(I); return;
|
||||
case Intrinsic::vacopy: visitVACopy(I); return;
|
||||
|
@ -679,7 +690,6 @@ void SelectionDAGLowering::visitCall(CallInst &I) {
|
|||
DAG.setRoot(DAG.getNode(ISD::PCMARKER, MVT::Other, getRoot(), Num));
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SDOperand Callee;
|
||||
|
|
Loading…
Reference in New Issue