[llvm] r202973 - [LangRef] Improve llvm.mem.parallel_loop_access example

Tobias Grosser tobias at grosser.es
Wed Mar 5 05:36:05 PST 2014


Author: grosser
Date: Wed Mar  5 07:36:04 2014
New Revision: 202973

URL: http://llvm.org/viewvc/llvm-project?rev=202973&view=rev
Log:
[LangRef] Improve llvm.mem.parallel_loop_access example

The following changes have been applied:

  - Removed 'align 4'. We can simplify this away, as it does not provide useful
    information in the example.
  - Use named instructions instead of '%0'. This is nicer, but more importantly
    this makes the IR valid. Before we had two assignments to %0 in a single
    example.
  - Add a missing branch instruction to make the loop structure clear.
  - Move one access into outer.for.body to make it not look that empty.
  - The statments that are only in the outer loop body should not reference the
    inner loop metadata, but only the outer loop. Only statements in both loops
    should reference both surrounding loops.
  - Rename the array indexes to make them all independent. Before there were
    identical array indexes in the inner and the outer loop. We want to
    avoid this special case as it may lead to confusion.

Modified:
    llvm/trunk/docs/LangRef.rst

Modified: llvm/trunk/docs/LangRef.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.rst?rev=202973&r1=202972&r2=202973&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.rst (original)
+++ llvm/trunk/docs/LangRef.rst Wed Mar  5 07:36:04 2014
@@ -2792,9 +2792,9 @@ metadata types that refer to the same lo
 
    for.body:
      ...
-     %0 = load i32* %arrayidx, align 4, !llvm.mem.parallel_loop_access !0
+     %val0 = load i32* %arrayidx, !llvm.mem.parallel_loop_access !0
      ...
-     store i32 %0, i32* %arrayidx4, align 4, !llvm.mem.parallel_loop_access !0
+     store i32 %val0, i32* %arrayidx1, !llvm.mem.parallel_loop_access !0
      ...
      br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !0
 
@@ -2809,21 +2809,22 @@ the loop identifier metadata node direct
 .. code-block:: llvm
 
    outer.for.body:
-   ...
+     ...
+     %val1 = load i32* %arrayidx3, !llvm.mem.parallel_loop_access !2
+     ...
+     br label %inner.for.body
 
    inner.for.body:
      ...
-     %0 = load i32* %arrayidx, align 4, !llvm.mem.parallel_loop_access !0
+     %val0 = load i32* %arrayidx1, !llvm.mem.parallel_loop_access !0
      ...
-     store i32 %0, i32* %arrayidx4, align 4, !llvm.mem.parallel_loop_access !0
+     store i32 %val0, i32* %arrayidx2, !llvm.mem.parallel_loop_access !0
      ...
      br i1 %exitcond, label %inner.for.end, label %inner.for.body, !llvm.loop !1
 
    inner.for.end:
      ...
-     %0 = load i32* %arrayidx, align 4, !llvm.mem.parallel_loop_access !0
-     ...
-     store i32 %0, i32* %arrayidx4, align 4, !llvm.mem.parallel_loop_access !0
+     store i32 %val1, i32* %arrayidx4, !llvm.mem.parallel_loop_access !2
      ...
      br i1 %exitcond, label %outer.for.end, label %outer.for.body, !llvm.loop !2
 





More information about the llvm-commits mailing list