[DAG] reduce code duplication; NFCI

llvm-svn: 332133
This commit is contained in:
Sanjay Patel 2018-05-11 20:08:23 +00:00
parent f6651d4d94
commit 0ddf09a36c
1 changed files with 7 additions and 8 deletions

View File

@ -6778,14 +6778,13 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) {
const char *RenameFn = nullptr;
if (Function *F = I.getCalledFunction()) {
if (F->isDeclaration()) {
if (const TargetIntrinsicInfo *II = TM.getIntrinsicInfo()) {
if (unsigned IID = II->getIntrinsicID(F)) {
RenameFn = visitIntrinsicCall(I, IID);
if (!RenameFn)
return;
}
}
if (Intrinsic::ID IID = F->getIntrinsicID()) {
// Is this an LLVM intrinsic or a target-specific intrinsic?
unsigned IID = F->getIntrinsicID();
if (!IID)
if (const TargetIntrinsicInfo *II = TM.getIntrinsicInfo())
IID = II->getIntrinsicID(F);
if (IID) {
RenameFn = visitIntrinsicCall(I, IID);
if (!RenameFn)
return;