Open Quuxplusone opened 6 years ago
Looks like SCEVExpander creates the additional cast because it does not ignore
debug intrinsics when looking for the insertion point. Proposed fix
https://reviews.llvm.org/D47874
In the process of chasing that down, I found a bunch of instances where it
looks like dbg info is not ignored in LoopVectorize. Have you been seeing any
other loop-vectorize related problems?
Thanks for taking a look Florian!
I haven’t seen any loop-vectorize specific problems yet, but will file them as blockers of PR37728 if I do.
Also, I wrote the wrong reproduced instructions in the problem description, sorry about that. It should be “$OPT -loop-vectorize”, not “$OPT -O1” or “$OPT -instcombine”.
I haven’t seen any loop-vectorize specific problems yet, but will file them as blockers of PR37728 if I do.
Ok great. I'll try to get some tests together for the other issues in loop vectorize, to see if they are actual issues. Not sure when I will get around to that though.
Running
opt -loop-vectorize
on test/Transforms/InstCombine/assume-redundant.ll produces different output with/without debug info present. To reproduce the issue, do:Baseline
$ $OPT -instcombine test/Transforms/InstCombine/assume-redundant.ll -S -o -
With debug info
$ $OPT -O1 test/Transforms/InstCombine/assume-redundant.ll -o - -debugify-each -debugify-quiet | $OPT -strip -S
Here's the diff I see. The divergence appears to start with a failure to eliminate a ptrtoint-of-undef:
Comparing: -loop-vectorize test/Transforms/InstCombine/assume-redundant.ll Baseline: /var/folders/j8/t4w0bp8j6x1g6fpghkcb4sjm0000gp/T/tmp.G6IDKish With DI : /var/folders/j8/t4w0bp8j6x1g6fpghkcb4sjm0000gp/T/tmp.BR4dAaBb 13,109c13,110 < %5 = and i64 %4, 31 < %6 = icmp eq i64 %5, 0 < br i1 false, label %59, label %7 < < ;