[PATCH] D23174: GVN-hoist: fix early exit logic

Sebastian Pop via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 4 13:12:13 PDT 2016


sebpop created this revision.
sebpop added a reviewer: dberlin.
sebpop added subscribers: llvm-commits, hiraditya.

The patch splits a complex && if condition into easier to read and understand logic.
That wrong early exit condition was letting some instructions with not all operands available pass through when HoistingGeps was true.

The patch also adds an extra early exit for TerminatorInst that should not be added to the analysis in the first place: these are branch instructions, invoke, etc.
I found it strange that we were looking at this kind of instructions when running gdb on the testcase.

I'm testing this patch with 3stage bootstrap and test-suite.
I will commit after it passes, and reenable the pass by default.

https://reviews.llvm.org/D23174

Files:
  lib/Transforms/Scalar/GVNHoist.cpp
  test/Transforms/GVN/hoist-call.ll
  test/Transforms/GVN/hoist-recursive-geps.ll
  test/Transforms/GVN/hoist.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23174.66845.patch
Type: text/x-patch
Size: 3562 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160804/0668943c/attachment.bin>


More information about the llvm-commits mailing list