Comments (3)
When you've loops you've to manually specify the unrolling factor. Since these loops iterate exactly 8 times, you need to pass the following options: -src-unroll=8 -tgt-unroll=8
Doing that, Alive2 can detect the problem: https://alive2.llvm.org/ce/z/qArern
We will implement automatic unroll factor detection in the future, but there's no ETA.
from alive2.
Reduced case:
define i32 @src() {
entry:
br label %for.header
for.header:
%ind1 = phi i64 [ %ind1.i, %for.latch ], [ 0, %entry ]
%ind2 = phi i64 [ %ind2.i, %for.latch ], [ 5, %entry ]
%rem = srem i64 %ind2, 4
%cmp6 = icmp eq i64 %ind1, %rem
br i1 %cmp6, label %exit1, label %for.latch
for.latch:
%ind2.i = add i64 %ind2, 1
%ind1.i = add i64 %ind1, 1
%cond = icmp eq i64 %ind1.i, 8
br i1 %cond, label %exit2, label %for.header
exit2:
%cmp = icmp eq i64 %rem, 0
%ret = zext i1 %cmp to i32
ret i32 %ret
exit1:
ret i32 0
}
define i32 @tgt() {
entry:
br label %for.header
for.header: ; preds = %for.latch, %entry
%ind1 = phi i64 [ %ind1.i, %for.latch ], [ 0, %entry ]
%ind2 = phi i64 [ %ind2.i, %for.latch ], [ 5, %entry ]
%rem = srem i64 %ind2, 4
%cmp6 = icmp eq i64 %ind1, %rem
br i1 %cmp6, label %exit1, label %for.latch
for.latch: ; preds = %for.header
%ind2.i = add i64 %ind2, 1
%ind1.i = add i64 %ind1, 1
%cond = icmp eq i64 %ind1.i, 8
br i1 %cond, label %exit2, label %for.header
exit2: ; preds = %for.latch
%ret = zext i1 false to i32
ret i32 %ret
exit1: ; preds = %for.header
ret i32 0
}
Alive2: https://alive2.llvm.org/ce/z/7FhVgy
from alive2.
Thank you for explaining this!
from alive2.
Related Issues (20)
- confusing CEX HOT 1
- make undef inputs default to off
- Incorrect bit layout for vectors of overaligned elements
- optimize indirect fn calls
- possible false alarm HOT 3
- load widening not working? HOT 1
- False positive when devirtualizing call with memory attributes
- unexpected memcmp() behavior HOT 3
- Inconsistent phi value after select based on undef value HOT 7
- Source and Target Example Values Diverge Before Source Code Does HOT 3
- unexpected result when tgt is asm
- Implicit conversion and static analysis warnings HOT 1
- arm-tv bug that won't repro in alive-tv HOT 2
- issue with returned arguments in asm memory mode HOT 4
- issue with aligned pointers
- Source function always being UB warning may be missing HOT 3
- undesirable poison in return value HOT 1
- target-side padding for non-byte-sized loads/stores HOT 1
- missed alarm? HOT 2
- add support for range attribute in args and ret val
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alive2.