[llvm] c3f5cee - [NFC][PowerPC] Add a new case to test ctrloop for fp128
Kang Zhang via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 7 09:35:47 PDT 2020
Author: Kang Zhang
Date: 2020-06-07T16:35:32Z
New Revision: c3f5ceefb8d1e6f7041a1af87e110ad4185c894a
URL: https://github.com/llvm/llvm-project/commit/c3f5ceefb8d1e6f7041a1af87e110ad4185c894a
DIFF: https://github.com/llvm/llvm-project/commit/c3f5ceefb8d1e6f7041a1af87e110ad4185c894a.diff
LOG: [NFC][PowerPC] Add a new case to test ctrloop for fp128
Added:
llvm/test/CodeGen/PowerPC/ctrloop-fp128.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/PowerPC/ctrloop-fp128.ll b/llvm/test/CodeGen/PowerPC/ctrloop-fp128.ll
new file mode 100644
index 000000000000..0a62cb18ca88
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/ctrloop-fp128.ll
@@ -0,0 +1,32 @@
+; RUN: llc -verify-machineinstrs -stop-after=hardware-loops -mcpu=pwr9 \
+; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s
+
+ at a = internal global fp128 0xL00000000000000000000000000000000, align 16
+ at x = internal global [4 x fp128] zeroinitializer, align 16
+ at y = internal global [4 x fp128] zeroinitializer, align 16
+
+define void @fmul_ctrloop_fp128() {
+entry:
+ %0 = load fp128, fp128* @a, align 16
+ br label %for.body
+
+for.body: ; preds = %for.body, %entry
+ %i.06 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
+ %arrayidx = getelementptr inbounds [4 x fp128], [4 x fp128]* @x, i64 0, i64 %i.06
+ %1 = load fp128, fp128* %arrayidx, align 16
+ %mul = fmul fp128 %0, %1
+ %arrayidx1 = getelementptr inbounds [4 x fp128], [4 x fp128]* @y, i64 0, i64 %i.06
+ store fp128 %mul, fp128* %arrayidx1, align 16
+ %inc = add nuw nsw i64 %i.06, 1
+ %exitcond = icmp eq i64 %inc, 4
+ br i1 %exitcond, label %for.end, label %for.body
+
+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)
+}
+
+declare void @obfuscate(i8*, ...) local_unnamed_addr #2
More information about the llvm-commits
mailing list