mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-26 14:16:12 +00:00
Cosmetical changne in order to conform to coding std.
Thank Eric Christopher for figuring out these problems! llvm-svn: 171805
This commit is contained in:
parent
4b9394acd5
commit
1c3b5e4f89
@ -297,9 +297,8 @@ static void detectLog2OfHalf(Value *&Op, Value *&Y, IntrinsicInst *&Log2) {
|
|||||||
static bool isFMulOrFDivWithConstant(Value *V) {
|
static bool isFMulOrFDivWithConstant(Value *V) {
|
||||||
Instruction *I = dyn_cast<Instruction>(V);
|
Instruction *I = dyn_cast<Instruction>(V);
|
||||||
if (!I || (I->getOpcode() != Instruction::FMul &&
|
if (!I || (I->getOpcode() != Instruction::FMul &&
|
||||||
I->getOpcode() != Instruction::FDiv)) {
|
I->getOpcode() != Instruction::FDiv))
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
ConstantFP *C0 = dyn_cast<ConstantFP>(I->getOperand(0));
|
ConstantFP *C0 = dyn_cast<ConstantFP>(I->getOperand(0));
|
||||||
ConstantFP *C1 = dyn_cast<ConstantFP>(I->getOperand(1));
|
ConstantFP *C1 = dyn_cast<ConstantFP>(I->getOperand(1));
|
||||||
@ -323,8 +322,8 @@ static bool isNormalFp(const ConstantFP *C) {
|
|||||||
/// resulting expression. Note that this function could return NULL in
|
/// resulting expression. Note that this function could return NULL in
|
||||||
/// case the constants cannot be folded into a normal floating-point.
|
/// case the constants cannot be folded into a normal floating-point.
|
||||||
///
|
///
|
||||||
Value *InstCombiner::foldFMulConst
|
Value *InstCombiner::foldFMulConst(Instruction *FMulOrDiv, ConstantFP *C,
|
||||||
(Instruction *FMulOrDiv, ConstantFP *C, Instruction *InsertBefore) {
|
Instruction *InsertBefore) {
|
||||||
assert(isFMulOrFDivWithConstant(FMulOrDiv) && "V is invalid");
|
assert(isFMulOrFDivWithConstant(FMulOrDiv) && "V is invalid");
|
||||||
|
|
||||||
Value *Opnd0 = FMulOrDiv->getOperand(0);
|
Value *Opnd0 = FMulOrDiv->getOperand(0);
|
||||||
@ -412,7 +411,9 @@ Instruction *InstCombiner::visitFMul(BinaryOperator &I) {
|
|||||||
ConstantFP *C1 = dyn_cast<ConstantFP>(Opnd1);
|
ConstantFP *C1 = dyn_cast<ConstantFP>(Opnd1);
|
||||||
bool Swap = false;
|
bool Swap = false;
|
||||||
if (C0) {
|
if (C0) {
|
||||||
std::swap(C0, C1); std::swap(Opnd0, Opnd1); Swap = true;
|
std::swap(C0, C1);
|
||||||
|
std::swap(Opnd0, Opnd1);
|
||||||
|
Swap = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (C1 && C1->getValueAPF().isNormal() &&
|
if (C1 && C1->getValueAPF().isNormal() &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user