For now isImpliedByDomCondition only check single predecessor to check if exist dominate condition. For example:
if (x ==y) if (z > 0) return x ^ y;
We can't detect the pattern x ^y is 0.
This patch invovle DomConditionInfo to maintain a list for every basic block to record all dominate conditions for this basic block.
Even though this patch increase some CPU overhead:
http://llvm-compile-time-tracker.com/compare.php?from=c508e933270d457166c3226b53d8c81619c3e350&to=d4b071718aae1f9f9a8fee31cd2fbee55b5e5d60&stat=instructions%3Au
It help to detect a lot of patterns in SPEC2017 and llvm-test-suite:
MultiSourc.../Benchmarks/nbench/nbench.test 45460.00 45508.00 0.1% Bitcode/Be...an/halide_local_laplacian.test 199880.00 199976.00 0.0% MultiSourc...nsumer-jpeg/consumer-jpeg.test 161822.00 161886.00 0.0% MultiSourc...abench/jpeg/jpeg-6a/cjpeg.test 164107.00 164171.00 0.0% MultiSourc...lications/SIBsim4/SIBsim4.test 46139.00 46155.00 0.0% MultiSource/Benchmarks/PAQ8p/paq8p.test 95843.00 95875.00 0.0% MultiSourc...pplications/oggenc/oggenc.test 257042.00 257074.00 0.0% MultiSourc...marks/7zip/7zip-benchmark.test 907698.00 907794.00 0.0% External/S...rlbench_r/500.perlbench_r.test 1697416.00 1697544.00 0.0% External/S...rlbench_s/600.perlbench_s.test 1697416.00 1697544.00 0.0% External/S...0.omnetpp_s/620.omnetpp_s.test 1236181.00 1236229.00 0.0% External/S...0.omnetpp_r/520.omnetpp_r.test 1236181.00 1236229.00 0.0% MultiSourc...ProxyApps-C++/CLAMR/CLAMR.test 705856.00 705872.00 0.0% External/S...8.imagick_r/538.imagick_r.test 1718889.00 1718921.00 0.0% External/S...8.imagick_s/638.imagick_s.test 1718889.00 1718921.00 0.0% External/S...7rate/502.gcc_r/502.gcc_r.test 6969643.00 6969771.00 0.0% External/S...speed/602.gcc_s/602.gcc_s.test 6969643.00 6969771.00 0.0% External/S...511.povray_r/511.povray_r.test 905099.00 905115.00 0.0% External/S...510.parest_r/510.parest_r.test 8515521.00 8515649.00 0.0% External/S...6.blender_r/526.blender_r.test 8704919.00 8705047.00 0.0% External/S...lancbmk_s/623.xalancbmk_s.test 2959781.00 2959813.00 0.0% External/S...lancbmk_r/523.xalancbmk_r.test 2959781.00 2959813.00 0.0%
Is the BreadFirstIterator used?