[PowerPC] Don't convert Loop to CTR Loop for fp128 BinaryOperator

Summary:
For PPC BinaryOperator of fp128 will become libcall, we shouldn't
convert loop to CTR loop if the loop contain libCall.

But currently, in the PPCTTIImpl::mightUseCTR() function, we only deal
with BinaryOperator for ppc_fp128, don't deal with the fp128.

Reviewed By: shchenz

Differential Revision: https://reviews.llvm.org/D81353
This commit is contained in:
Kang Zhang 2020-06-18 02:54:19 +00:00
parent 1f391afbf4
commit 58e19d465a
2 changed files with 5 additions and 4 deletions

View File

@ -429,8 +429,9 @@ bool PPCTTIImpl::mightUseCTR(BasicBlock *BB, TargetLibraryInfo *LibInfo,
return true;
} else if (isa<BinaryOperator>(J) &&
J->getType()->getScalarType()->isPPC_FP128Ty()) {
// Most operations on ppc_f128 values become calls.
(J->getType()->getScalarType()->isFP128Ty() ||
J->getType()->getScalarType()->isPPC_FP128Ty())) {
// Most operations on f128 or ppc_f128 values become calls.
return true;
} else if (isa<UIToFPInst>(J) || isa<SIToFPInst>(J) ||
isa<FPToUIInst>(J) || isa<FPToSIInst>(J)) {

View File

@ -25,8 +25,8 @@ for.end: ; preds = %for.body
ret void
; CHECK-LABEL: fmul_ctrloop_fp128
; CHECK: call void @llvm.set.loop.iterations.i64(i64 4)
; CHECK: call i1 @llvm.loop.decrement.i64(i64 1)
; CHECK-NOT: call void @llvm.set.loop.iterations.i64(i64 4)
; CHECK-NOT: call i1 @llvm.loop.decrement.i64(i64 1)
}
declare void @obfuscate(i8*, ...) local_unnamed_addr #2