[PATCH] D19985: [Kryo] Use immediate #0 to zero a register
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 6 16:42:19 PDT 2016
MatzeB added a comment.
Looks good to me, but I believe the test can be simplified:
================
Comment at: test/CodeGen/AArch64/kryo_zeroing.ll:26-45
@@ +25,22 @@
+
+define i64 @test_int64(i64* nocapture readonly %p) {
+; CHECK-LABEL: test_int64:
+; CHECK: mov x9, #0
+; CHECK: mov x8, #0
+entry:
+ br label %for.body
+
+for.cond.cleanup: ; preds = %for.body
+ ret i64 %add
+
+for.body: ; preds = %for.body, %entry
+ %i.07 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
+ %sum.06 = phi i64 [ 0, %entry ], [ %add, %for.body ]
+ %arrayidx = getelementptr inbounds i64, i64* %p, i64 %i.07
+ %0 = load i64, i64* %arrayidx, align 8
+ %add = add nsw i64 %0, %sum.06
+ %inc = add nuw nsw i64 %i.07, 1
+ %exitcond = icmp eq i64 %inc, 10
+ br i1 %exitcond, label %for.cond.cleanup, label %for.body
+}
+
----------------
These tests appear to have a lot more instructions than necessary just to produce mov x9, #0; mov x8, #0. Also wouldn't it be better to merge this with arm64-zero-cycle-zeroing.ll, maybe you can just addnother run line there?
Repository:
rL LLVM
http://reviews.llvm.org/D19985
More information about the llvm-commits
mailing list