Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

LoopVectorize: different IR generation when debug info is present #36700

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR37727
Status NEW
Importance P normal
Reported by Vedant Kumar (vsk@apple.com)
Reported on 2018-06-07 00:28:15 -0700
Last modified on 2018-06-07 09:26:05 -0700
Version trunk
Hardware PC All
CC dblaikie@gmail.com, ditaliano@apple.com, florian_hahn@apple.com, hfinkel@anl.gov, hideki.saito@intel.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk
Fixed by commit(s)
Attachments
Blocks PR37728
Blocked by
See also

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 < < ;

%5 = ptrtoint double* undef to i64 %6 = and i64 %4, 31 %7 = icmp eq i64 %6, 0 br i1 false, label %60, label %8

;

;

;

;

;

;

;

Quuxplusone commented 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?
Quuxplusone commented 6 years ago

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”.

Quuxplusone commented 6 years ago

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.