mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 12:43:36 +01:00
function names start with a lower case letter ; NFC
llvm-svn: 257496
This commit is contained in:
parent
772d13fff8
commit
eb6cf93f57
@ -178,10 +178,10 @@ public:
|
|||||||
void clearFastMathFlags() { FMF.clear(); }
|
void clearFastMathFlags() { FMF.clear(); }
|
||||||
|
|
||||||
/// \brief Set the floating point math metadata to be used.
|
/// \brief Set the floating point math metadata to be used.
|
||||||
void SetDefaultFPMathTag(MDNode *FPMathTag) { DefaultFPMathTag = FPMathTag; }
|
void setDefaultFPMathTag(MDNode *FPMathTag) { DefaultFPMathTag = FPMathTag; }
|
||||||
|
|
||||||
/// \brief Set the fast-math flags to be used with generated fp-math operators
|
/// \brief Set the fast-math flags to be used with generated fp-math operators
|
||||||
void SetFastMathFlags(FastMathFlags NewFMF) { FMF = NewFMF; }
|
void setFastMathFlags(FastMathFlags NewFMF) { FMF = NewFMF; }
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
// RAII helpers.
|
// RAII helpers.
|
||||||
|
@ -636,7 +636,7 @@ Instruction *InstCombiner::visitFMul(BinaryOperator &I) {
|
|||||||
// if pattern detected emit alternate sequence
|
// if pattern detected emit alternate sequence
|
||||||
if (OpX && OpY) {
|
if (OpX && OpY) {
|
||||||
BuilderTy::FastMathFlagGuard Guard(*Builder);
|
BuilderTy::FastMathFlagGuard Guard(*Builder);
|
||||||
Builder->SetFastMathFlags(Log2->getFastMathFlags());
|
Builder->setFastMathFlags(Log2->getFastMathFlags());
|
||||||
Log2->setArgOperand(0, OpY);
|
Log2->setArgOperand(0, OpY);
|
||||||
Value *FMulVal = Builder->CreateFMul(OpX, Log2);
|
Value *FMulVal = Builder->CreateFMul(OpX, Log2);
|
||||||
Value *FSub = Builder->CreateFSub(FMulVal, OpX);
|
Value *FSub = Builder->CreateFSub(FMulVal, OpX);
|
||||||
@ -652,7 +652,7 @@ Instruction *InstCombiner::visitFMul(BinaryOperator &I) {
|
|||||||
bool IgnoreZeroSign = I.hasNoSignedZeros();
|
bool IgnoreZeroSign = I.hasNoSignedZeros();
|
||||||
if (BinaryOperator::isFNeg(Opnd0, IgnoreZeroSign)) {
|
if (BinaryOperator::isFNeg(Opnd0, IgnoreZeroSign)) {
|
||||||
BuilderTy::FastMathFlagGuard Guard(*Builder);
|
BuilderTy::FastMathFlagGuard Guard(*Builder);
|
||||||
Builder->SetFastMathFlags(I.getFastMathFlags());
|
Builder->setFastMathFlags(I.getFastMathFlags());
|
||||||
|
|
||||||
Value *N0 = dyn_castFNegVal(Opnd0, IgnoreZeroSign);
|
Value *N0 = dyn_castFNegVal(Opnd0, IgnoreZeroSign);
|
||||||
Value *N1 = dyn_castFNegVal(Opnd1, IgnoreZeroSign);
|
Value *N1 = dyn_castFNegVal(Opnd1, IgnoreZeroSign);
|
||||||
@ -693,7 +693,7 @@ Instruction *InstCombiner::visitFMul(BinaryOperator &I) {
|
|||||||
|
|
||||||
if (Y) {
|
if (Y) {
|
||||||
BuilderTy::FastMathFlagGuard Guard(*Builder);
|
BuilderTy::FastMathFlagGuard Guard(*Builder);
|
||||||
Builder->SetFastMathFlags(I.getFastMathFlags());
|
Builder->setFastMathFlags(I.getFastMathFlags());
|
||||||
Value *T = Builder->CreateFMul(Opnd1, Opnd1);
|
Value *T = Builder->CreateFMul(Opnd1, Opnd1);
|
||||||
|
|
||||||
Value *R = Builder->CreateFMul(T, Y);
|
Value *R = Builder->CreateFMul(T, Y);
|
||||||
|
@ -930,7 +930,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
|
|||||||
if (FCI->hasOneUse() && FCmpInst::isUnordered(FCI->getPredicate())) {
|
if (FCI->hasOneUse() && FCmpInst::isUnordered(FCI->getPredicate())) {
|
||||||
FCmpInst::Predicate InvPred = FCI->getInversePredicate();
|
FCmpInst::Predicate InvPred = FCI->getInversePredicate();
|
||||||
IRBuilder<>::FastMathFlagGuard FMFG(*Builder);
|
IRBuilder<>::FastMathFlagGuard FMFG(*Builder);
|
||||||
Builder->SetFastMathFlags(FCI->getFastMathFlags());
|
Builder->setFastMathFlags(FCI->getFastMathFlags());
|
||||||
Value *NewCond = Builder->CreateFCmp(InvPred, TrueVal, FalseVal,
|
Value *NewCond = Builder->CreateFCmp(InvPred, TrueVal, FalseVal,
|
||||||
FCI->getName() + ".inv");
|
FCI->getName() + ".inv");
|
||||||
|
|
||||||
@ -973,7 +973,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
|
|||||||
if (FCI->hasOneUse() && FCmpInst::isUnordered(FCI->getPredicate())) {
|
if (FCI->hasOneUse() && FCmpInst::isUnordered(FCI->getPredicate())) {
|
||||||
FCmpInst::Predicate InvPred = FCI->getInversePredicate();
|
FCmpInst::Predicate InvPred = FCI->getInversePredicate();
|
||||||
IRBuilder<>::FastMathFlagGuard FMFG(*Builder);
|
IRBuilder<>::FastMathFlagGuard FMFG(*Builder);
|
||||||
Builder->SetFastMathFlags(FCI->getFastMathFlags());
|
Builder->setFastMathFlags(FCI->getFastMathFlags());
|
||||||
Value *NewCond = Builder->CreateFCmp(InvPred, FalseVal, TrueVal,
|
Value *NewCond = Builder->CreateFCmp(InvPred, FalseVal, TrueVal,
|
||||||
FCI->getName() + ".inv");
|
FCI->getName() + ".inv");
|
||||||
|
|
||||||
@ -1082,7 +1082,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
|
|||||||
} else {
|
} else {
|
||||||
IRBuilder<>::FastMathFlagGuard FMFG(*Builder);
|
IRBuilder<>::FastMathFlagGuard FMFG(*Builder);
|
||||||
auto FMF = cast<FPMathOperator>(SI.getCondition())->getFastMathFlags();
|
auto FMF = cast<FPMathOperator>(SI.getCondition())->getFastMathFlags();
|
||||||
Builder->SetFastMathFlags(FMF);
|
Builder->setFastMathFlags(FMF);
|
||||||
Cmp = Builder->CreateFCmp(Pred, LHS, RHS);
|
Cmp = Builder->CreateFCmp(Pred, LHS, RHS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -599,7 +599,7 @@ Value *RecurrenceDescriptor::createMinMaxOp(IRBuilder<> &Builder,
|
|||||||
IRBuilder<>::FastMathFlagGuard FMFG(Builder);
|
IRBuilder<>::FastMathFlagGuard FMFG(Builder);
|
||||||
FastMathFlags FMF;
|
FastMathFlags FMF;
|
||||||
FMF.setUnsafeAlgebra();
|
FMF.setUnsafeAlgebra();
|
||||||
Builder.SetFastMathFlags(FMF);
|
Builder.setFastMathFlags(FMF);
|
||||||
|
|
||||||
Value *Cmp;
|
Value *Cmp;
|
||||||
if (RK == MRK_FloatMin || RK == MRK_FloatMax)
|
if (RK == MRK_FloatMin || RK == MRK_FloatMax)
|
||||||
|
@ -997,7 +997,7 @@ Value *LibCallSimplifier::optimizeUnaryDoubleFP(CallInst *CI, IRBuilder<> &B,
|
|||||||
|
|
||||||
// Propagate fast-math flags from the existing call to the new call.
|
// Propagate fast-math flags from the existing call to the new call.
|
||||||
IRBuilder<>::FastMathFlagGuard Guard(B);
|
IRBuilder<>::FastMathFlagGuard Guard(B);
|
||||||
B.SetFastMathFlags(CI->getFastMathFlags());
|
B.setFastMathFlags(CI->getFastMathFlags());
|
||||||
|
|
||||||
// floor((double)floatval) -> (double)floorf(floatval)
|
// floor((double)floatval) -> (double)floorf(floatval)
|
||||||
if (Callee->isIntrinsic()) {
|
if (Callee->isIntrinsic()) {
|
||||||
@ -1035,7 +1035,7 @@ Value *LibCallSimplifier::optimizeBinaryDoubleFP(CallInst *CI, IRBuilder<> &B) {
|
|||||||
|
|
||||||
// Propagate fast-math flags from the existing call to the new call.
|
// Propagate fast-math flags from the existing call to the new call.
|
||||||
IRBuilder<>::FastMathFlagGuard Guard(B);
|
IRBuilder<>::FastMathFlagGuard Guard(B);
|
||||||
B.SetFastMathFlags(CI->getFastMathFlags());
|
B.setFastMathFlags(CI->getFastMathFlags());
|
||||||
|
|
||||||
// fmin((double)floatval1, (double)floatval2)
|
// fmin((double)floatval1, (double)floatval2)
|
||||||
// -> (double)fminf(floatval1, floatval2)
|
// -> (double)fminf(floatval1, floatval2)
|
||||||
@ -1143,7 +1143,7 @@ Value *LibCallSimplifier::optimizePow(CallInst *CI, IRBuilder<> &B) {
|
|||||||
if (OpCCallee && TLI->getLibFunc(OpCCallee->getName(), Func) &&
|
if (OpCCallee && TLI->getLibFunc(OpCCallee->getName(), Func) &&
|
||||||
TLI->has(Func) && (Func == LibFunc::exp || Func == LibFunc::exp2)) {
|
TLI->has(Func) && (Func == LibFunc::exp || Func == LibFunc::exp2)) {
|
||||||
IRBuilder<>::FastMathFlagGuard Guard(B);
|
IRBuilder<>::FastMathFlagGuard Guard(B);
|
||||||
B.SetFastMathFlags(CI->getFastMathFlags());
|
B.setFastMathFlags(CI->getFastMathFlags());
|
||||||
Value *FMul = B.CreateFMul(OpC->getArgOperand(0), Op2, "mul");
|
Value *FMul = B.CreateFMul(OpC->getArgOperand(0), Op2, "mul");
|
||||||
return EmitUnaryFloatFnCall(FMul, OpCCallee->getName(), B,
|
return EmitUnaryFloatFnCall(FMul, OpCCallee->getName(), B,
|
||||||
OpCCallee->getAttributes());
|
OpCCallee->getAttributes());
|
||||||
@ -1325,7 +1325,7 @@ Value *LibCallSimplifier::optimizeFMinFMax(CallInst *CI, IRBuilder<> &B) {
|
|||||||
FMF.setNoSignedZeros();
|
FMF.setNoSignedZeros();
|
||||||
FMF.setNoNaNs();
|
FMF.setNoNaNs();
|
||||||
}
|
}
|
||||||
B.SetFastMathFlags(FMF);
|
B.setFastMathFlags(FMF);
|
||||||
|
|
||||||
// We have a relaxed floating-point environment. We can ignore NaN-handling
|
// We have a relaxed floating-point environment. We can ignore NaN-handling
|
||||||
// and transform to a compare and select. We do not have to consider errno or
|
// and transform to a compare and select. We do not have to consider errno or
|
||||||
@ -1368,7 +1368,7 @@ Value *LibCallSimplifier::optimizeLog(CallInst *CI, IRBuilder<> &B) {
|
|||||||
IRBuilder<>::FastMathFlagGuard Guard(B);
|
IRBuilder<>::FastMathFlagGuard Guard(B);
|
||||||
FastMathFlags FMF;
|
FastMathFlags FMF;
|
||||||
FMF.setUnsafeAlgebra();
|
FMF.setUnsafeAlgebra();
|
||||||
B.SetFastMathFlags(FMF);
|
B.setFastMathFlags(FMF);
|
||||||
|
|
||||||
LibFunc::Func Func;
|
LibFunc::Func Func;
|
||||||
Function *F = OpC->getCalledFunction();
|
Function *F = OpC->getCalledFunction();
|
||||||
@ -1437,7 +1437,7 @@ Value *LibCallSimplifier::optimizeSqrt(CallInst *CI, IRBuilder<> &B) {
|
|||||||
// Fast math flags for any created instructions should match the sqrt
|
// Fast math flags for any created instructions should match the sqrt
|
||||||
// and multiply.
|
// and multiply.
|
||||||
IRBuilder<>::FastMathFlagGuard Guard(B);
|
IRBuilder<>::FastMathFlagGuard Guard(B);
|
||||||
B.SetFastMathFlags(I->getFastMathFlags());
|
B.setFastMathFlags(I->getFastMathFlags());
|
||||||
|
|
||||||
// If we found a repeated factor, hoist it out of the square root and
|
// If we found a repeated factor, hoist it out of the square root and
|
||||||
// replace it with the fabs of that factor.
|
// replace it with the fabs of that factor.
|
||||||
|
@ -3775,7 +3775,7 @@ public:
|
|||||||
IRBuilder<> Builder(ReductionRoot);
|
IRBuilder<> Builder(ReductionRoot);
|
||||||
FastMathFlags Unsafe;
|
FastMathFlags Unsafe;
|
||||||
Unsafe.setUnsafeAlgebra();
|
Unsafe.setUnsafeAlgebra();
|
||||||
Builder.SetFastMathFlags(Unsafe);
|
Builder.setFastMathFlags(Unsafe);
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
|
|
||||||
for (; i < NumReducedVals - ReduxWidth + 1; i += ReduxWidth) {
|
for (; i < NumReducedVals - ReduxWidth + 1; i += ReduxWidth) {
|
||||||
|
@ -142,13 +142,13 @@ TEST_F(IRBuilderTest, FastMathFlags) {
|
|||||||
EXPECT_FALSE(FAdd->hasNoNaNs());
|
EXPECT_FALSE(FAdd->hasNoNaNs());
|
||||||
|
|
||||||
FastMathFlags FMF;
|
FastMathFlags FMF;
|
||||||
Builder.SetFastMathFlags(FMF);
|
Builder.setFastMathFlags(FMF);
|
||||||
|
|
||||||
F = Builder.CreateFAdd(F, F);
|
F = Builder.CreateFAdd(F, F);
|
||||||
EXPECT_FALSE(Builder.getFastMathFlags().any());
|
EXPECT_FALSE(Builder.getFastMathFlags().any());
|
||||||
|
|
||||||
FMF.setUnsafeAlgebra();
|
FMF.setUnsafeAlgebra();
|
||||||
Builder.SetFastMathFlags(FMF);
|
Builder.setFastMathFlags(FMF);
|
||||||
|
|
||||||
F = Builder.CreateFAdd(F, F);
|
F = Builder.CreateFAdd(F, F);
|
||||||
EXPECT_TRUE(Builder.getFastMathFlags().any());
|
EXPECT_TRUE(Builder.getFastMathFlags().any());
|
||||||
@ -179,7 +179,7 @@ TEST_F(IRBuilderTest, FastMathFlags) {
|
|||||||
|
|
||||||
FMF.clear();
|
FMF.clear();
|
||||||
FMF.setAllowReciprocal();
|
FMF.setAllowReciprocal();
|
||||||
Builder.SetFastMathFlags(FMF);
|
Builder.setFastMathFlags(FMF);
|
||||||
|
|
||||||
F = Builder.CreateFDiv(F, F);
|
F = Builder.CreateFDiv(F, F);
|
||||||
EXPECT_TRUE(Builder.getFastMathFlags().any());
|
EXPECT_TRUE(Builder.getFastMathFlags().any());
|
||||||
@ -197,7 +197,7 @@ TEST_F(IRBuilderTest, FastMathFlags) {
|
|||||||
|
|
||||||
FMF.clear();
|
FMF.clear();
|
||||||
FMF.setAllowReciprocal();
|
FMF.setAllowReciprocal();
|
||||||
Builder.SetFastMathFlags(FMF);
|
Builder.setFastMathFlags(FMF);
|
||||||
|
|
||||||
FC = Builder.CreateFCmpOEQ(F, F);
|
FC = Builder.CreateFCmpOEQ(F, F);
|
||||||
EXPECT_TRUE(Builder.getFastMathFlags().any());
|
EXPECT_TRUE(Builder.getFastMathFlags().any());
|
||||||
@ -224,7 +224,7 @@ TEST_F(IRBuilderTest, FastMathFlags) {
|
|||||||
|
|
||||||
FMF.clear();
|
FMF.clear();
|
||||||
FMF.setNoNaNs();
|
FMF.setNoNaNs();
|
||||||
Builder.SetFastMathFlags(FMF);
|
Builder.setFastMathFlags(FMF);
|
||||||
|
|
||||||
FCall = Builder.CreateCall(Callee, None);
|
FCall = Builder.CreateCall(Callee, None);
|
||||||
EXPECT_TRUE(Builder.getFastMathFlags().any());
|
EXPECT_TRUE(Builder.getFastMathFlags().any());
|
||||||
@ -309,14 +309,14 @@ TEST_F(IRBuilderTest, RAIIHelpersTest) {
|
|||||||
MDNode *FPMathA = MDB.createFPMath(0.01f);
|
MDNode *FPMathA = MDB.createFPMath(0.01f);
|
||||||
MDNode *FPMathB = MDB.createFPMath(0.1f);
|
MDNode *FPMathB = MDB.createFPMath(0.1f);
|
||||||
|
|
||||||
Builder.SetDefaultFPMathTag(FPMathA);
|
Builder.setDefaultFPMathTag(FPMathA);
|
||||||
|
|
||||||
{
|
{
|
||||||
IRBuilder<>::FastMathFlagGuard Guard(Builder);
|
IRBuilder<>::FastMathFlagGuard Guard(Builder);
|
||||||
FastMathFlags FMF;
|
FastMathFlags FMF;
|
||||||
FMF.setAllowReciprocal();
|
FMF.setAllowReciprocal();
|
||||||
Builder.SetFastMathFlags(FMF);
|
Builder.setFastMathFlags(FMF);
|
||||||
Builder.SetDefaultFPMathTag(FPMathB);
|
Builder.setDefaultFPMathTag(FPMathB);
|
||||||
EXPECT_TRUE(Builder.getFastMathFlags().allowReciprocal());
|
EXPECT_TRUE(Builder.getFastMathFlags().allowReciprocal());
|
||||||
EXPECT_EQ(FPMathB, Builder.getDefaultFPMathTag());
|
EXPECT_EQ(FPMathB, Builder.getDefaultFPMathTag());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user