[PATCH] D14670: Fix bug 25440: GVN assertion after coercing loads

Weiming Zhao via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 18:00:09 PST 2015


weimingz updated this revision to Diff 40465.
weimingz added a comment.

(this patch is mainly for discussion)

Hi Berlin,

Very appreciate for the explanation. 
My previous order about NextNum was indeed wrong, and thus addToLeaderTable was never executed, which masked the another problem:  
the newly created inst (%0) will get the VN before %sub.ptr.rhs.cast25. The NextNum check won’t prevent this.

Looks like we should only assign numbers for new instrs that would have been visited (we only do make ups). For new instrs inserted in future points, we just leave it and wait for it to be processed naturally.
But I can't find such support from existing GVN framework. I have an approximated solution in the patch.

Any suggestions?


http://reviews.llvm.org/D14670

Files:
  lib/Transforms/Scalar/GVN.cpp
  test/Transforms/GVN/pr25440.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14670.40465.patch
Type: text/x-patch
Size: 13396 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151118/d42c43bb/attachment.bin>


More information about the llvm-commits mailing list