[PATCH] D12072: [FIX] Restrict the AST build with the assumed context
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 17 01:54:54 PDT 2015
jdoerfert updated this revision to Diff 32273.
jdoerfert added a comment.
Use the correct fix for the code generation problem at hand.
http://reviews.llvm.org/D12072
Files:
lib/CodeGen/BlockGenerators.cpp
test/Isl/CodeGen/assumed_context_empty_domain_restriction.ll
Index: test/Isl/CodeGen/assumed_context_empty_domain_restriction.ll
===================================================================
--- test/Isl/CodeGen/assumed_context_empty_domain_restriction.ll
+++ test/Isl/CodeGen/assumed_context_empty_domain_restriction.ll
@@ -1,35 +1,9 @@
-; RUN: opt %loadPolly -S -polly-opt-isl -polly-codegen < %s
+; RUN: opt %loadPolly -S -polly-opt-isl -polly-codegen < %s | FileCheck %s
;
-; TODO: This test will crash the scalar code generation. The problem step by step:
-; 1) The assumed context is empty because of the out-of-bounds array access.
-; 2) The dependence analysis will use the assumed context and determine
-; that there are not iterations executed, hence no dependences.
-; 3) The scheduler will transform the program somehow according to
-; the orginal domains and empty dependences but not the assumed context.
-; The new ast is shown below.
-; 4) The code generation will look for the new value of %0 when the
-; for_body_328_lr_ph statement is copied, however it has not yet seen %0
-; as the for_end_310 statement has been moved after for_body_328_lr_ph.
-; 5) Crash as no new value of %0 can be found.
-;
-; AST:
-;
-; if (0)
-; {
-; for (int c0 = 0; c0 <= 32; c0 += 1)
-; Stmt_for_body_328(c0);
-; Stmt_for_body_328_lr_ph();
-; Stmt_for_end_310();
-; }
-; else
-; { /* original code */ }
+; This test used to crash the scalar code generation.
;
; CHECK: polly.start
;
-; TODO: This test should not crash Polly.
-;
-; XFAIL: *
-;
@endposition = external global i32, align 4
@Bit = external global [0 x i32], align 4
@Init = external global [0 x i32], align 4
Index: lib/CodeGen/BlockGenerators.cpp
===================================================================
--- lib/CodeGen/BlockGenerators.cpp
+++ lib/CodeGen/BlockGenerators.cpp
@@ -474,9 +474,7 @@
return /* Case (3a) */ ScalarValueCopy;
// Case (3b)
- assert(ReloadMap.count(ScalarValueInst) &&
- "ScalarInst not mapped in the block and not in the given reload map!");
- Value *ReloadAddr = ReloadMap[ScalarValueInst];
+ Value *ReloadAddr = getOrCreateAlloca(ScalarValueInst, ReloadMap, ".s2a");
ScalarValue =
Builder.CreateLoad(ReloadAddr, ReloadAddr->getName() + ".reload");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12072.32273.patch
Type: text/x-patch
Size: 2387 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150817/06a7051d/attachment.bin>
More information about the llvm-commits
mailing list