[llvm] 58e19d4 - [PowerPC] Don't convert Loop to CTR Loop for fp128 BinaryOperator
Kang Zhang via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 17 19:55:09 PDT 2020
Author: Kang Zhang
Date: 2020-06-18T02:54:19Z
New Revision: 58e19d465a13b4ada2f7f3ea0252601dc700b777
URL: https://github.com/llvm/llvm-project/commit/58e19d465a13b4ada2f7f3ea0252601dc700b777
DIFF: https://github.com/llvm/llvm-project/commit/58e19d465a13b4ada2f7f3ea0252601dc700b777.diff
LOG: [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
Added:
Modified:
llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
llvm/test/CodeGen/PowerPC/ctrloop-fp128.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
index bd0bc0eacee1..a13050ec1151 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
+++ b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
@@ -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)) {
diff --git a/llvm/test/CodeGen/PowerPC/ctrloop-fp128.ll b/llvm/test/CodeGen/PowerPC/ctrloop-fp128.ll
index 0a62cb18ca88..57095413cdb2 100644
--- a/llvm/test/CodeGen/PowerPC/ctrloop-fp128.ll
+++ b/llvm/test/CodeGen/PowerPC/ctrloop-fp128.ll
@@ -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
More information about the llvm-commits
mailing list