diff options
author | Manman Ren <manman.ren@gmail.com> | 2014-11-18 00:33:22 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2014-11-18 00:33:22 +0000 |
commit | a64bd44fd8269bdd246fb21a7ca645e957bc9501 (patch) | |
tree | 00c83d035889b7c85cb661dbe04f31e37f93fd62 /llvm/lib/Transforms | |
parent | b072c3673a39dfd6c954e2cbd4344e93478451de (diff) | |
download | bcm5719-llvm-a64bd44fd8269bdd246fb21a7ca645e957bc9501.tar.gz bcm5719-llvm-a64bd44fd8269bdd246fb21a7ca645e957bc9501.zip |
Revert r222040 because of bot failure.
http://lab.llvm.org:8080/green/job/clang-Rlto_master/298/
Hopefully, bot will be green.
llvm-svn: 222203
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp index a0570f7ebd4..b41cdc65202 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp @@ -1269,17 +1269,14 @@ Instruction *InstCombiner::visitFPTrunc(FPTruncInst &CI) { // type of OpI doesn't enter into things at all. We simply evaluate // in whichever source type is larger, then convert to the // destination type. - Value *NewLHS = LHSOrig, *NewRHS = RHSOrig; if (LHSWidth < SrcWidth) - NewLHS = Builder->CreateFPExt(NewLHS, RHSOrig->getType()); + LHSOrig = Builder->CreateFPExt(LHSOrig, RHSOrig->getType()); else if (RHSWidth <= SrcWidth) - NewRHS = Builder->CreateFPExt(NewRHS, LHSOrig->getType()); - if (NewLHS != LHSOrig || NewRHS != RHSOrig) { - Value *ExactResult = Builder->CreateFRem(NewLHS, NewRHS); - if (Instruction *RI = dyn_cast<Instruction>(ExactResult)) - RI->copyFastMathFlags(OpI); - return CastInst::CreateFPCast(ExactResult, CI.getType()); - } + RHSOrig = Builder->CreateFPExt(RHSOrig, LHSOrig->getType()); + Value *ExactResult = Builder->CreateFRem(LHSOrig, RHSOrig); + if (Instruction *RI = dyn_cast<Instruction>(ExactResult)) + RI->copyFastMathFlags(OpI); + return CastInst::CreateFPCast(ExactResult, CI.getType()); } // (fptrunc (fneg x)) -> (fneg (fptrunc x)) |