[polly] r310466 - [CodeGen] Use isLatestArrayKind().
Michael Kruse via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 9 05:27:51 PDT 2017
Author: meinersbur
Date: Wed Aug 9 05:27:51 2017
New Revision: 310466
URL: http://llvm.org/viewvc/llvm-project?rev=310466&view=rev
Log:
[CodeGen] Use isLatestArrayKind().
Codegen with -polly-parallel queried the unmapped MemoryAccess, but only
the MemoryKind after mapping is relevant for codegen.
This should fix various fails of the
perf-x86_64-penryn-O3-polly-parallel-fast buildbot.
Added:
polly/trunk/test/Isl/CodeGen/OpenMP/mapped-phi-access.ll
Modified:
polly/trunk/lib/CodeGen/IslNodeBuilder.cpp
Modified: polly/trunk/lib/CodeGen/IslNodeBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/IslNodeBuilder.cpp?rev=310466&r1=310465&r2=310466&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/IslNodeBuilder.cpp (original)
+++ polly/trunk/lib/CodeGen/IslNodeBuilder.cpp Wed Aug 9 05:27:51 2017
@@ -223,7 +223,7 @@ isl_stat addReferencesFromStmt(const Sco
}
for (auto &Access : *Stmt) {
- if (Access->isArrayKind()) {
+ if (Access->isLatestArrayKind()) {
auto *BasePtr = Access->getScopArrayInfo()->getBasePtr();
if (Instruction *OpInst = dyn_cast<Instruction>(BasePtr))
if (Stmt->getParent()->contains(OpInst))
Added: polly/trunk/test/Isl/CodeGen/OpenMP/mapped-phi-access.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/OpenMP/mapped-phi-access.ll?rev=310466&view=auto
==============================================================================
--- polly/trunk/test/Isl/CodeGen/OpenMP/mapped-phi-access.ll (added)
+++ polly/trunk/test/Isl/CodeGen/OpenMP/mapped-phi-access.ll Wed Aug 9 05:27:51 2017
@@ -0,0 +1,58 @@
+; RUN: opt %loadPolly -polly-parallel -polly-delicm -polly-codegen -S < %s | FileCheck %s
+;
+; Verify that -polly-parallel can handle mapped scalar MemoryAccesses.
+;
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+; Function Attrs: nounwind uwtable
+define void @main() local_unnamed_addr #0 {
+entry:
+ %0 = load i8*, i8** undef, align 8, !tbaa !1
+ %1 = load i8*, i8** undef, align 8, !tbaa !1
+ %arraydecay16 = bitcast i8* %1 to double*
+ %arraydecay20 = bitcast i8* %0 to [4000 x double]*
+ br label %for.body65.i226
+
+for.body65.i226: ; preds = %for.inc85.i238, %entry
+ %indvars.iv8.i223 = phi i64 [ 0, %entry ], [ %indvars.iv.next9.i236, %for.inc85.i238 ]
+ %arrayidx70.i224 = getelementptr inbounds double, double* %arraydecay16, i64 %indvars.iv8.i223
+ br label %for.body68.i235
+
+for.body68.i235: ; preds = %for.body68.i235, %for.body65.i226
+ %2 = phi double [ undef, %for.body65.i226 ], [ undef, %for.body68.i235 ]
+ %indvars.iv.i227 = phi i64 [ 0, %for.body65.i226 ], [ %indvars.iv.next.i233, %for.body68.i235 ]
+ %arrayidx74.i228 = getelementptr inbounds [4000 x double], [4000 x double]* %arraydecay20, i64 %indvars.iv8.i223, i64 %indvars.iv.i227
+ %3 = load double, double* %arrayidx74.i228, align 8, !tbaa !5
+ store double undef, double* %arrayidx70.i224, align 8, !tbaa !5
+ %indvars.iv.next.i233 = add nuw nsw i64 %indvars.iv.i227, 1
+ %exitcond.i234 = icmp eq i64 %indvars.iv.next.i233, 4000
+ br i1 %exitcond.i234, label %for.inc85.i238, label %for.body68.i235
+
+for.inc85.i238: ; preds = %for.body68.i235
+ %indvars.iv.next9.i236 = add nuw nsw i64 %indvars.iv8.i223, 1
+ %exitcond10.i237 = icmp eq i64 %indvars.iv.next9.i236, 4000
+ br i1 %exitcond10.i237, label %kernel_gemver_StrictFP.exit, label %for.body65.i226
+
+kernel_gemver_StrictFP.exit: ; preds = %for.inc85.i238
+ ret void
+}
+
+attributes #0 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+
+!llvm.ident = !{!0}
+
+!0 = !{!"clang version 6.0.0 "}
+!1 = !{!2, !2, i64 0}
+!2 = !{!"any pointer", !3, i64 0}
+!3 = !{!"omnipotent char", !4, i64 0}
+!4 = !{!"Simple C/C++ TBAA"}
+!5 = !{!6, !6, i64 0}
+!6 = !{!"double", !3, i64 0}
+
+
+; CHECK-LABEL: define internal void @main_polly_subfn(i8* %polly.par.userContext)
+;
+; CHECK: polly.stmt.for.body65.i226:
+; CHECK-NEXT: %polly.access.cast.polly.subfunc.arg.2 = bitcast i8* %polly.subfunc.arg.2 to double*
+; CHECK-NEXT: %polly.access.polly.subfunc.arg.2 = getelementptr double, double* %polly.access.cast.polly.subfunc.arg.2, i64 %polly.indvar
+; CHECK-NEXT: store double undef, double* %polly.access.polly.subfunc.arg.2
More information about the llvm-commits
mailing list