1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

[FastISel] Move the helper function isCommutativeIntrinsic into FastISel base class.

Move the helper function isCommutativeIntrinsic into the FastISel base class,
so it can be used by more than just one backend.

llvm-svn: 214347
This commit is contained in:
Juergen Ributzka 2014-07-30 22:04:28 +00:00
parent f12a2ac4ea
commit 30bf8840d7
2 changed files with 13 additions and 13 deletions

View File

@ -20,6 +20,7 @@
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/IntrinsicInst.h"
namespace llvm {
@ -30,7 +31,6 @@ class CallInst;
class DataLayout;
class FunctionLoweringInfo;
class Instruction;
class IntrinsicInst;
class LoadInst;
class MVT;
class MachineConstantPool;
@ -533,6 +533,18 @@ protected:
bool LowerCallTo(const CallInst *CI, const char *SymName, unsigned NumArgs);
bool LowerCallTo(CallLoweringInfo &CLI);
bool isCommutativeIntrinsic(IntrinsicInst const *II) {
switch (II->getIntrinsicID()) {
case Intrinsic::sadd_with_overflow:
case Intrinsic::uadd_with_overflow:
case Intrinsic::smul_with_overflow:
case Intrinsic::umul_with_overflow:
return true;
default:
return false;
}
}
private:
bool SelectBinaryOp(const User *I, unsigned ISDOpcode);

View File

@ -2163,18 +2163,6 @@ bool X86FastISel::TryEmitSmallMemcpy(X86AddressMode DestAM,
return true;
}
static bool isCommutativeIntrinsic(IntrinsicInst const *II) {
switch (II->getIntrinsicID()) {
case Intrinsic::sadd_with_overflow:
case Intrinsic::uadd_with_overflow:
case Intrinsic::smul_with_overflow:
case Intrinsic::umul_with_overflow:
return true;
default:
return false;
}
}
bool X86FastISel::FastLowerIntrinsicCall(const IntrinsicInst *II) {
// FIXME: Handle more intrinsics.
switch (II->getIntrinsicID()) {