Change Function::getIntrinsicID() to return an Intrinsic::ID. NFC.

Now that Intrinsic::ID is a typed enum, we can forward declare it and so return it from this method.

This updates all users which were either using an unsigned to store it, or had a now unnecessary cast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237810 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Pete Cooper
2015-05-20 17:16:39 +00:00
parent 1563a4a416
commit 9584e07a9c
17 changed files with 23 additions and 24 deletions

View File

@@ -662,7 +662,7 @@ namespace {
Function *F = I->getCalledFunction();
if (!F) return false;
Intrinsic::ID IID = (Intrinsic::ID) F->getIntrinsicID();
Intrinsic::ID IID = F->getIntrinsicID();
if (!IID) return false;
switch(IID) {
@@ -1098,7 +1098,7 @@ namespace {
CallInst *CI = dyn_cast<CallInst>(I);
Function *FI;
if (CI && (FI = CI->getCalledFunction())) {
Intrinsic::ID IID = (Intrinsic::ID) FI->getIntrinsicID();
Intrinsic::ID IID = FI->getIntrinsicID();
if (IID == Intrinsic::powi || IID == Intrinsic::ctlz ||
IID == Intrinsic::cttz) {
Value *A1I = CI->getArgOperand(1),
@@ -2770,7 +2770,7 @@ namespace {
continue;
} else if (isa<CallInst>(I)) {
Function *F = cast<CallInst>(I)->getCalledFunction();
Intrinsic::ID IID = (Intrinsic::ID) F->getIntrinsicID();
Intrinsic::ID IID = F->getIntrinsicID();
if (o == NumOperands-1) {
BasicBlock &BB = *I->getParent();

View File

@@ -2382,7 +2382,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
Intrinsic::ID IID = Intrinsic::not_intrinsic;
Value *ScalarArg = nullptr;
if (CI && (FI = CI->getCalledFunction())) {
IID = (Intrinsic::ID) FI->getIntrinsicID();
IID = FI->getIntrinsicID();
}
std::vector<Value *> OpVecs;
for (int j = 0, e = CI->getNumArgOperands(); j < e; ++j) {