diff options
author | Tobias Grosser <tobias@grosser.es> | 2014-03-05 13:36:04 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2014-03-05 13:36:04 +0000 |
commit | 4c16a16505c6f065a2bfd4eda6662d5294627b52 (patch) | |
tree | 3369bbe32e9cdabce98a4d5f4f687ef2e1d1d3df /docs | |
parent | 7c09fb6af23decbf669c9a79473c25183c26cb4e (diff) | |
download | llvm-4c16a16505c6f065a2bfd4eda6662d5294627b52.tar.gz llvm-4c16a16505c6f065a2bfd4eda6662d5294627b52.tar.bz2 llvm-4c16a16505c6f065a2bfd4eda6662d5294627b52.tar.xz |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202973 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/LangRef.rst | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/docs/LangRef.rst b/docs/LangRef.rst index 9820fd8a57..2d3b9d5b6f 100644 --- a/docs/LangRef.rst +++ b/docs/LangRef.rst @@ -2792,9 +2792,9 @@ metadata types that refer to the same loop identifier metadata. 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 directly: .. 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 |