llvm-project/llvm/test/Transforms/PGOProfile
Roman Lebedev c3b8bd1eea
[InstCombine] Always try to invert non-canonical predicate of an icmp
Summary:
The actual transform i was going after was:
https://rise4fun.com/Alive/Tp9H
```
Name: zz
Pre: isPowerOf2(C0) && isPowerOf2(C1) && C1 == C0
%t0 = and i8 %x, C0
%r = icmp eq i8 %t0, C1
  =>
%t = icmp eq i8 %t0, 0
%r = xor i1 %t, -1

Name: zz
Pre: isPowerOf2(C0)
%t0 = and i8 %x, C0
%r = icmp ne i8 %t0, 0
  =>
%t = icmp eq i8 %t0, 0
%r = xor i1 %t, -1
```
but as it can be seen from the current tests, we already canonicalize most of it,
and we are only missing handling multi-use non-canonical icmp predicates.

If we have both `!=0` and `==0`, even though we can CSE them,
we end up being stuck with them. We should canonicalize to the `==0`.

I believe this is one of the cleanup steps i'll need after `-scalarizer`
if i end up proceeding with my WIP alloca promotion helper pass.

Reviewers: spatel, jdoerfert, nikic

Reviewed By: nikic

Subscribers: zzheng, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83139
2020-07-04 18:12:04 +03:00
..
Inputs [PGO] Add memcmp/bcmp size value profiling. 2020-05-26 10:28:04 -07:00
X86 Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
PR28219.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
PR41279.ll [PGO] Handle cases of non-instrument BBs 2019-06-10 22:36:27 +00:00
PR41279_2.ll [PGO] Handle cases of non-instrument BBs 2019-06-10 22:36:27 +00:00
branch1.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
branch2.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
callbr.ll [CallSite Removal] a CallBase is never an IndirectCall for isInlineAsm 2020-04-06 16:14:46 -07:00
chr.ll [InstCombine] Always try to invert non-canonical predicate of an icmp 2020-07-04 18:12:04 +03:00
comdat_internal.ll [PGO] Don't group COMDAT variables for compiler generated profile variables in ELF 2019-09-30 18:11:22 +00:00
comdat_rename.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
counter_promo.ll Revert "[InstrProfiling] Use !associated metadata for counters, data and values" 2020-06-10 02:32:50 -07:00
counter_promo_exit_catchswitch.ll [PGO] Early detection regarding whether pgo counter promotion is possible 2020-01-24 09:55:41 -08:00
counter_promo_exit_merge.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
counter_promo_mexits.ll Revert "[InstrProfiling] Use !associated metadata for counters, data and values" 2020-06-10 02:32:50 -07:00
counter_promo_nest.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
criticaledge.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
cspgo_profile_summary.ll [PGOProfile] make test less brittle; NFC 2020-05-19 15:56:29 -04:00
diag_FE_profile.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
diag_mismatch.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
diag_no_funcprofdata.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
diag_no_profile.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
diag_no_value_sites.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
do-not-instrument.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
func_entry.ll [PGO] Change hardcoded thresholds for cold/inlinehint to use summary 2019-09-17 23:12:13 +00:00
icp_covariant_call_return.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
icp_covariant_invoke_return.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
icp_invoke.ll [llvm] Fix missing FileCheck directive colons 2020-04-06 09:59:08 -06:00
icp_invoke_nouse.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
icp_mismatch_msg.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
icp_sample.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
icp_vararg.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
icp_vararg_sret.ll [PGO] CallPromotion: Don't try to pass sret args to varargs functions 2020-06-08 21:10:27 +02:00
indirect_call_annotation.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
indirect_call_profile.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
indirect_call_profile_funclet.ll [PGO] Attach appropriate funclet operand bundles to value profiling instrumentation calls 2020-01-24 11:20:53 -08:00
indirect_call_promotion.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
indirect_call_promotion_byval.ll [PGO] Update ICP pass for recent byval type changes 2019-07-01 22:43:39 +00:00
indirect_call_promotion_musttail.ll [ICP] Handling must tail calls in indirect call promotion 2020-05-03 10:42:22 -07:00
indirect_call_promotion_vla.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
indirectbr.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
infinite_loop.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
infinite_loop_gen.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
instr_entry_bb.ll [PGO] Add a functionality to always instrument the func entry BB 2020-06-26 10:43:23 -07:00
irreducible.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
landingpad.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
large_count_remarks.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
loop1.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
loop2.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
memcpy.ll Revert "[PGO] Extend the value profile buckets for mem op sizes." 2020-06-25 11:13:49 -07:00
memop_clone.ll [llvm] Fix missing FileCheck directive colons 2020-04-06 09:59:08 -06:00
memop_profile_funclet.ll Revert "[PGO] Extend the value profile buckets for mem op sizes." 2020-06-25 11:13:49 -07:00
memop_size_annotation.ll [PGO] Guard the memcmp/bcmp size value profiling instrumentation behind flag. 2020-05-28 10:07:04 -07:00
memop_size_from_strlen.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
memop_size_opt.ll [PGO] Add memcmp/bcmp size value profiling. 2020-05-26 10:28:04 -07:00
memop_size_opt_zero.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
misexpect-branch-correct.ll Reland "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM" 2019-09-11 16:19:50 +00:00
misexpect-branch-stripped.ll Reland "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM" 2019-09-11 16:19:50 +00:00
misexpect-branch-unpredictable.ll Reland "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM" 2019-09-11 16:19:50 +00:00
misexpect-branch.ll Reland "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM" 2019-09-11 16:19:50 +00:00
misexpect-switch-default.ll Reland "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM" 2019-09-11 16:19:50 +00:00
misexpect-switch.ll Reland "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM" 2019-09-11 16:19:50 +00:00
multiple_hash_profile.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
noreturncall.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
preinline.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
remap.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
select1.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
select2.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
select_hash_conflict.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
single_bb.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
split-indirectbr-critical-edges.ll Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
statics_counter_naming.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
switch.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
thinlto_cspgo_gen.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
thinlto_cspgo_use.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
thinlto_indirect_call_promotion.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
thinlto_samplepgo_icp.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
thinlto_samplepgo_icp2.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
thinlto_samplepgo_icp3.ll [ThinLTO] Don't rely on debug output for thinlto_samplepgo_icp3 test 2020-03-25 14:38:20 -04:00
thinlto_samplepgo_icp_droppeddead.ll Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
unreachable_bb.ll [ProfileSummary] Add the PartialProfileRatio field in ProfileSummary metadata. 2020-05-21 09:12:23 -07:00