mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
It's not safe to fold (fptrunc (sqrt (fpext x))) to (sqrtf x) if there is another use of sqrt. rdar://9763193
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135058 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1216,7 +1216,8 @@ Instruction *InstCombiner::visitFPTrunc(FPTruncInst &CI) {
|
||||
CallInst *Call = dyn_cast<CallInst>(CI.getOperand(0));
|
||||
if (Call && Call->getCalledFunction() &&
|
||||
Call->getCalledFunction()->getName() == "sqrt" &&
|
||||
Call->getNumArgOperands() == 1) {
|
||||
Call->getNumArgOperands() == 1 &&
|
||||
Call->hasOneUse()) {
|
||||
CastInst *Arg = dyn_cast<CastInst>(Call->getArgOperand(0));
|
||||
if (Arg && Arg->getOpcode() == Instruction::FPExt &&
|
||||
CI.getType()->isFloatTy() &&
|
||||
|
Reference in New Issue
Block a user