[PATCH] D24129: GVN-hoist: disable hoisting stores (PR30216)

Sebastian Pop via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 12:39:41 PDT 2016


On Wed, Sep 7, 2016 at 10:39 AM, Vasileios Kalintiris
<Vasileios.Kalintiris at imgtec.com> wrote:
>> Does it mean that you successfully bootstraped the compiler with this
> patch applied?
>
> Unfortunately, no:
>
> https://dmz-portal.mips.com/bb/builders/LLVM%20recurse%20the%20compiler/builds/384/steps/Compare%20object%20files%20from%20cross%20and%20recurse%20builds/logs/stdio
>
> There's a hash mismatch between phase2 & phase3 for the
> /tools/clang/lib/Sema/CMakeFiles/clangSema.dir/SemaExprObjC.cpp.o
> object. There's a new hash mismatch for ARMBaseRegisterInfo.cpp.o
> too, but I'm not sure that GVN-hoist is responsible for that.

Let's suppose it is a fault in GVN-hoist: you can make sure it is
GVN-hoist's fault if bootstrap succeeds with CXXFLAGS+="-mllvm
-enable-gvn-hoist=false".

Here is how I would bisect the miscompile:
Build a good clang with CXXFLAGS+="-mllvm -enable-gvn-hoist=false" and
keep around all the .o files in good/
Build a bad clang and keep all the .o files in bad/

Bisection step:
Link together half of good/*.o and half of bad/*.o files and use that
compiler to build without other options a stage3 clang.
Check whether there are binary differences between your old stage2
from the failed bootstrap and the new stage3.
If there are changes, that means that one of the files linked from
bad/*.o is bad, and so for the next step you can pull half of the
remaining good/*.o.
If there are no changes, in the next step you can get half of the
remaining bad/*.o.

Iterate the "Bisection step" halving at each iteration the number of
.o files that may contain the miscompilation.

Once you have a .o file that is miscompiled, bisect the number of GVN
expressions hoisted: compile that .cpp file with the same options and
adding "-mllvm -gvn-max-hoisted=10000 and then bisect again that
number until finding N for which binary diff passes and N+1 fails.

Finally get the output of "-mllvm -print-after-all -mllvm
-print-before-all" for both N and N+1.

Thanks,
Sebastian


More information about the llvm-commits mailing list