[all-commits] [llvm/llvm-project] a10587: [InstCombine] Remove some of the complexity-based ...

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Aug 21 03:03:16 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a105877646d68e48cdeeeadd9d1e075dc3c5d68d
      https://github.com/llvm/llvm-project/commit/a105877646d68e48cdeeeadd9d1e075dc3c5d68d
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-08-21 (Wed, 21 Aug 2024)

  Changed paths:
    M clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_ld1-bfloat.c
    M clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_ld1.c
    M clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_ld1sb.c
    M clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_ld1sh.c
    M clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_ld1sw.c
    M clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_ld1ub.c
    M clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_ld1uh.c
    M clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_ld1uw.c
    M clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_st1-bfloat.c
    M clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_st1.c
    M clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_st1b.c
    M clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_st1h.c
    M clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_st1w.c
    M clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_loads.c
    M clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_store.c
    M clang/test/CodeGen/attr-counted-by.c
    M clang/test/CodeGen/fp-reassoc-pragma.cpp
    M clang/test/CodeGen/fp-reciprocal-pragma.cpp
    M clang/test/CodeGen/ms-mixed-ptr-sizes.c
    M clang/test/Headers/wasm.c
    M llvm/include/llvm/Transforms/InstCombine/InstCombiner.h
    M llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
    M llvm/test/Analysis/ValueTracking/known-power-of-two-urem.ll
    M llvm/test/Analysis/ValueTracking/known-power-of-two.ll
    M llvm/test/Analysis/ValueTracking/knownbits-and-or-xor-lowbit.ll
    M llvm/test/Analysis/ValueTracking/knownbits-bmi-pattern.ll
    M llvm/test/Analysis/ValueTracking/phi-known-bits.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-pow-codegen.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-pow.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-pown.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-powr.ll
    M llvm/test/Transforms/IndVarSimplify/rewrite-loop-exit-value.ll
    M llvm/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll
    M llvm/test/Transforms/InstCombine/2010-11-23-Distributed.ll
    M llvm/test/Transforms/InstCombine/abs-1.ll
    M llvm/test/Transforms/InstCombine/add-mask-neg.ll
    M llvm/test/Transforms/InstCombine/add.ll
    M llvm/test/Transforms/InstCombine/add2.ll
    M llvm/test/Transforms/InstCombine/add_or_sub.ll
    M llvm/test/Transforms/InstCombine/and-or-icmp-const-icmp.ll
    M llvm/test/Transforms/InstCombine/and-or-icmps.ll
    M llvm/test/Transforms/InstCombine/and-or-not.ll
    M llvm/test/Transforms/InstCombine/and-or.ll
    M llvm/test/Transforms/InstCombine/and-xor-merge.ll
    M llvm/test/Transforms/InstCombine/and-xor-or.ll
    M llvm/test/Transforms/InstCombine/and.ll
    M llvm/test/Transforms/InstCombine/apint-and-xor-merge.ll
    M llvm/test/Transforms/InstCombine/apint-or.ll
    M llvm/test/Transforms/InstCombine/apint-shift.ll
    M llvm/test/Transforms/InstCombine/apint-sub.ll
    M llvm/test/Transforms/InstCombine/ashr-lshr.ll
    M llvm/test/Transforms/InstCombine/assume-align.ll
    M llvm/test/Transforms/InstCombine/assume-separate_storage.ll
    M llvm/test/Transforms/InstCombine/avg-lsb.ll
    M llvm/test/Transforms/InstCombine/binop-and-shifts.ll
    M llvm/test/Transforms/InstCombine/binop-cast.ll
    M llvm/test/Transforms/InstCombine/bit-checks.ll
    M llvm/test/Transforms/InstCombine/bitcast-inseltpoison.ll
    M llvm/test/Transforms/InstCombine/bitcast.ll
    M llvm/test/Transforms/InstCombine/bitreverse.ll
    M llvm/test/Transforms/InstCombine/bswap-fold.ll
    M llvm/test/Transforms/InstCombine/call-guard.ll
    M llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-eq-to-icmp-ule.ll
    M llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ne-to-icmp-ugt.ll
    M llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-uge-to-icmp-ule.ll
    M llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ult-to-icmp-ugt.ll
    M llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-and-icmp-eq-to-icmp-ule.ll
    M llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-and-icmp-ne-to-icmp-ugt.ll
    M llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-v2-and-icmp-eq-to-icmp-ule.ll
    M llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-v2-and-icmp-ne-to-icmp-ugt.ll
    M llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-v3-and-icmp-eq-to-icmp-ule.ll
    M llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-v3-and-icmp-ne-to-icmp-ugt.ll
    M llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-v4-and-icmp-eq-to-icmp-ule.ll
    M llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-v4-and-icmp-ne-to-icmp-ugt.ll
    M llvm/test/Transforms/InstCombine/cast-mul-select.ll
    M llvm/test/Transforms/InstCombine/cast.ll
    M llvm/test/Transforms/InstCombine/cast_phi.ll
    M llvm/test/Transforms/InstCombine/cast_ptr.ll
    M llvm/test/Transforms/InstCombine/cmp-x-vs-neg-x.ll
    M llvm/test/Transforms/InstCombine/conditional-negation.ll
    M llvm/test/Transforms/InstCombine/ctpop-cttz.ll
    M llvm/test/Transforms/InstCombine/ctpop-pow2.ll
    M llvm/test/Transforms/InstCombine/cttz.ll
    M llvm/test/Transforms/InstCombine/demorgan.ll
    M llvm/test/Transforms/InstCombine/dependent-ivs.ll
    M llvm/test/Transforms/InstCombine/fadd-fsub-factor.ll
    M llvm/test/Transforms/InstCombine/fadd.ll
    M llvm/test/Transforms/InstCombine/fast-basictest.ll
    M llvm/test/Transforms/InstCombine/fast-math.ll
    M llvm/test/Transforms/InstCombine/fcmp.ll
    M llvm/test/Transforms/InstCombine/fdiv-sqrt.ll
    M llvm/test/Transforms/InstCombine/fdiv.ll
    M llvm/test/Transforms/InstCombine/float-shrink-compare.ll
    M llvm/test/Transforms/InstCombine/fmul.ll
    M llvm/test/Transforms/InstCombine/fold-ext-eq-c-with-op.ll
    M llvm/test/Transforms/InstCombine/fold-inc-of-add-of-not-x-and-y-to-sub-x-from-y.ll
    M llvm/test/Transforms/InstCombine/fold-select-fmul-if-zero.ll
    M llvm/test/Transforms/InstCombine/fold-signbit-test-power2.ll
    M llvm/test/Transforms/InstCombine/fpextend.ll
    M llvm/test/Transforms/InstCombine/fptrunc.ll
    M llvm/test/Transforms/InstCombine/free-inversion.ll
    M llvm/test/Transforms/InstCombine/fsh.ll
    M llvm/test/Transforms/InstCombine/fsub.ll
    M llvm/test/Transforms/InstCombine/funnel.ll
    M llvm/test/Transforms/InstCombine/getelementptr.ll
    M llvm/test/Transforms/InstCombine/hoist-negation-out-of-bias-calculation.ll
    M llvm/test/Transforms/InstCombine/hoist-xor-by-constant-from-xor-by-value.ll
    M llvm/test/Transforms/InstCombine/icmp-add.ll
    M llvm/test/Transforms/InstCombine/icmp-and-add-sub-xor-p2.ll
    M llvm/test/Transforms/InstCombine/icmp-and-lowbit-mask.ll
    M llvm/test/Transforms/InstCombine/icmp-and-shift.ll
    M llvm/test/Transforms/InstCombine/icmp-custom-dl.ll
    M llvm/test/Transforms/InstCombine/icmp-equality-rotate.ll
    M llvm/test/Transforms/InstCombine/icmp-equality-xor.ll
    M llvm/test/Transforms/InstCombine/icmp-ext-ext.ll
    M llvm/test/Transforms/InstCombine/icmp-gep.ll
    M llvm/test/Transforms/InstCombine/icmp-mul-zext.ll
    M llvm/test/Transforms/InstCombine/icmp-mul.ll
    M llvm/test/Transforms/InstCombine/icmp-of-and-x.ll
    M llvm/test/Transforms/InstCombine/icmp-of-or-x.ll
    M llvm/test/Transforms/InstCombine/icmp-of-trunc-ext.ll
    M llvm/test/Transforms/InstCombine/icmp-of-xor-x.ll
    M llvm/test/Transforms/InstCombine/icmp-or-of-select-with-zero.ll
    M llvm/test/Transforms/InstCombine/icmp-or.ll
    M llvm/test/Transforms/InstCombine/icmp-range.ll
    M llvm/test/Transforms/InstCombine/icmp-rotate.ll
    M llvm/test/Transforms/InstCombine/icmp-select-implies-common-op.ll
    M llvm/test/Transforms/InstCombine/icmp-select.ll
    M llvm/test/Transforms/InstCombine/icmp-sub.ll
    M llvm/test/Transforms/InstCombine/icmp-uge-of-not-of-shl-allones-by-bits-and-val-to-icmp-eq-of-lshr-val-by-bits-and-0.ll
    M llvm/test/Transforms/InstCombine/icmp-ult-of-not-of-shl-allones-by-bits-and-val-to-icmp-ne-of-lshr-val-by-bits-and-0.ll
    M llvm/test/Transforms/InstCombine/icmp.ll
    M llvm/test/Transforms/InstCombine/implies.ll
    M llvm/test/Transforms/InstCombine/invert-variable-mask-in-masked-merge-scalar.ll
    M llvm/test/Transforms/InstCombine/invert-variable-mask-in-masked-merge-vector.ll
    M llvm/test/Transforms/InstCombine/ispow2.ll
    M llvm/test/Transforms/InstCombine/known-bits.ll
    M llvm/test/Transforms/InstCombine/known-never-nan.ll
    M llvm/test/Transforms/InstCombine/ldexp-ext.ll
    M llvm/test/Transforms/InstCombine/log-pow.ll
    M llvm/test/Transforms/InstCombine/logical-select-inseltpoison.ll
    M llvm/test/Transforms/InstCombine/logical-select.ll
    M llvm/test/Transforms/InstCombine/lshr-and-negC-icmpeq-zero.ll
    M llvm/test/Transforms/InstCombine/lshr.ll
    M llvm/test/Transforms/InstCombine/masked-merge-add.ll
    M llvm/test/Transforms/InstCombine/masked-merge-and-of-ors.ll
    M llvm/test/Transforms/InstCombine/masked-merge-or.ll
    M llvm/test/Transforms/InstCombine/masked-merge-xor.ll
    M llvm/test/Transforms/InstCombine/minmax-fold.ll
    M llvm/test/Transforms/InstCombine/minmax-of-xor-x.ll
    M llvm/test/Transforms/InstCombine/mul-masked-bits.ll
    M llvm/test/Transforms/InstCombine/mul-pow2.ll
    M llvm/test/Transforms/InstCombine/mul.ll
    M llvm/test/Transforms/InstCombine/mul_fold.ll
    M llvm/test/Transforms/InstCombine/mul_full_64.ll
    M llvm/test/Transforms/InstCombine/not-add.ll
    M llvm/test/Transforms/InstCombine/not.ll
    M llvm/test/Transforms/InstCombine/onehot_merge.ll
    M llvm/test/Transforms/InstCombine/or-xor-xor.ll
    M llvm/test/Transforms/InstCombine/or-xor.ll
    M llvm/test/Transforms/InstCombine/or.ll
    M llvm/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-after-truncation-variant-b.ll
    M llvm/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-variant-b.ll
    M llvm/test/Transforms/InstCombine/phi.ll
    M llvm/test/Transforms/InstCombine/pr44242.ll
    M llvm/test/Transforms/InstCombine/pr49688.ll
    M llvm/test/Transforms/InstCombine/pr75369.ll
    M llvm/test/Transforms/InstCombine/ptr-int-ptr-icmp.ll
    M llvm/test/Transforms/InstCombine/ptrmask.ll
    M llvm/test/Transforms/InstCombine/range-check.ll
    M llvm/test/Transforms/InstCombine/reassociate-nuw.ll
    M llvm/test/Transforms/InstCombine/redundant-left-shift-input-masking-after-truncation-variant-b.ll
    M llvm/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-b.ll
    M llvm/test/Transforms/InstCombine/rem.ll
    M llvm/test/Transforms/InstCombine/result-of-add-of-negative-is-non-zero-and-no-underflow.ll
    M llvm/test/Transforms/InstCombine/result-of-add-of-negative-or-zero-is-non-zero-and-no-underflow.ll
    M llvm/test/Transforms/InstCombine/result-of-usub-is-non-zero-and-no-overflow.ll
    M llvm/test/Transforms/InstCombine/saturating-add-sub.ll
    M llvm/test/Transforms/InstCombine/scalarization-inseltpoison.ll
    M llvm/test/Transforms/InstCombine/scalarization.ll
    M llvm/test/Transforms/InstCombine/select-and-or.ll
    M llvm/test/Transforms/InstCombine/select-binop-cmp.ll
    M llvm/test/Transforms/InstCombine/select-binop-foldable-floating-point.ll
    M llvm/test/Transforms/InstCombine/select-cmp-eq-op-fold.ll
    M llvm/test/Transforms/InstCombine/select-cmp.ll
    M llvm/test/Transforms/InstCombine/select-ctlz-to-cttz.ll
    M llvm/test/Transforms/InstCombine/select-divrem.ll
    M llvm/test/Transforms/InstCombine/select-factorize.ll
    M llvm/test/Transforms/InstCombine/select-masked_gather.ll
    M llvm/test/Transforms/InstCombine/select-masked_load.ll
    M llvm/test/Transforms/InstCombine/select-of-bittest.ll
    M llvm/test/Transforms/InstCombine/select-safe-transforms.ll
    M llvm/test/Transforms/InstCombine/select-with-bitwise-ops.ll
    M llvm/test/Transforms/InstCombine/select.ll
    M llvm/test/Transforms/InstCombine/select_meta.ll
    M llvm/test/Transforms/InstCombine/set.ll
    M llvm/test/Transforms/InstCombine/shift-add.ll
    M llvm/test/Transforms/InstCombine/shift-amount-reassociation-in-bittest-with-truncation-lshr.ll
    M llvm/test/Transforms/InstCombine/shift-amount-reassociation-in-bittest-with-truncation-shl.ll
    M llvm/test/Transforms/InstCombine/shift-direction-in-bit-test.ll
    M llvm/test/Transforms/InstCombine/shift-logic.ll
    M llvm/test/Transforms/InstCombine/shift.ll
    M llvm/test/Transforms/InstCombine/shl-bo.ll
    M llvm/test/Transforms/InstCombine/shuffle-binop.ll
    M llvm/test/Transforms/InstCombine/signed-truncation-check.ll
    M llvm/test/Transforms/InstCombine/simplify-demanded-fpclass.ll
    M llvm/test/Transforms/InstCombine/sink-not-into-and.ll
    M llvm/test/Transforms/InstCombine/sink-not-into-or.ll
    M llvm/test/Transforms/InstCombine/smax-icmp.ll
    M llvm/test/Transforms/InstCombine/smin-icmp.ll
    M llvm/test/Transforms/InstCombine/sub-ashr-or-to-icmp-select.ll
    M llvm/test/Transforms/InstCombine/sub-gep.ll
    M llvm/test/Transforms/InstCombine/sub-lshr-or-to-icmp-select.ll
    M llvm/test/Transforms/InstCombine/sub-minmax.ll
    M llvm/test/Transforms/InstCombine/sub-not.ll
    M llvm/test/Transforms/InstCombine/sub-of-negatible-inseltpoison.ll
    M llvm/test/Transforms/InstCombine/sub-of-negatible.ll
    M llvm/test/Transforms/InstCombine/sub-xor-cmp.ll
    M llvm/test/Transforms/InstCombine/sub.ll
    M llvm/test/Transforms/InstCombine/trunc-binop-ext.ll
    M llvm/test/Transforms/InstCombine/uaddo.ll
    M llvm/test/Transforms/InstCombine/umax-icmp.ll
    M llvm/test/Transforms/InstCombine/umin-icmp.ll
    M llvm/test/Transforms/InstCombine/unordered-compare-and-ordered.ll
    M llvm/test/Transforms/InstCombine/unsigned-add-lack-of-overflow-check-via-add.ll
    M llvm/test/Transforms/InstCombine/unsigned-add-lack-of-overflow-check-via-xor.ll
    M llvm/test/Transforms/InstCombine/unsigned-add-lack-of-overflow-check.ll
    M llvm/test/Transforms/InstCombine/unsigned-add-overflow-check-via-add.ll
    M llvm/test/Transforms/InstCombine/unsigned-add-overflow-check-via-xor.ll
    M llvm/test/Transforms/InstCombine/unsigned-add-overflow-check.ll
    M llvm/test/Transforms/InstCombine/unsigned-sub-lack-of-overflow-check.ll
    M llvm/test/Transforms/InstCombine/unsigned-sub-overflow-check.ll
    M llvm/test/Transforms/InstCombine/vec_demanded_elts.ll
    M llvm/test/Transforms/InstCombine/vec_shuffle-inseltpoison.ll
    M llvm/test/Transforms/InstCombine/vec_shuffle.ll
    M llvm/test/Transforms/InstCombine/vector-reverse.ll
    M llvm/test/Transforms/InstCombine/vector-xor.ll
    M llvm/test/Transforms/InstCombine/widenable-conditions.ll
    M llvm/test/Transforms/InstCombine/xor.ll
    M llvm/test/Transforms/InstCombine/xor2.ll
    M llvm/test/Transforms/InstCombine/zext-bool-add-sub.ll
    M llvm/test/Transforms/InstCombine/zext-or-icmp.ll
    M llvm/test/Transforms/InstCombine/zext.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/deterministic-type-shrinkage.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-cond-inv-loads.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-gather-scatter.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-inductions.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-interleaved-accesses.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-vector-reverse.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-widen-phi.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/vector-reverse-mask4.ll
    M llvm/test/Transforms/LoopVectorize/ARM/mve-qabs.ll
    M llvm/test/Transforms/LoopVectorize/ARM/mve-reductions.ll
    M llvm/test/Transforms/LoopVectorize/ARM/mve-selectandorcost.ll
    M llvm/test/Transforms/LoopVectorize/ARM/pointer_iv.ll
    M llvm/test/Transforms/LoopVectorize/ARM/tail-fold-multiple-icmps.ll
    M llvm/test/Transforms/LoopVectorize/X86/invariant-load-gather.ll
    M llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
    M llvm/test/Transforms/LoopVectorize/X86/pr23997.ll
    M llvm/test/Transforms/LoopVectorize/extract-last-veclane.ll
    M llvm/test/Transforms/LoopVectorize/float-induction.ll
    M llvm/test/Transforms/LoopVectorize/if-conversion-nest.ll
    M llvm/test/Transforms/LoopVectorize/induction.ll
    M llvm/test/Transforms/LoopVectorize/interleaved-accesses.ll
    M llvm/test/Transforms/LoopVectorize/invariant-store-vectorization-2.ll
    M llvm/test/Transforms/LoopVectorize/invariant-store-vectorization.ll
    M llvm/test/Transforms/LoopVectorize/reduction-inloop-cond.ll
    M llvm/test/Transforms/LoopVectorize/reduction-inloop.ll
    M llvm/test/Transforms/LoopVectorize/reduction.ll
    M llvm/test/Transforms/LoopVectorize/runtime-check.ll
    M llvm/test/Transforms/LoopVectorize/scalable-inductions.ll
    M llvm/test/Transforms/LoopVectorize/uniform-args-call-variants.ll
    M llvm/test/Transforms/PGOProfile/chr.ll
    M llvm/test/Transforms/PhaseOrdering/AArch64/hoist-runtime-checks.ll
    M llvm/test/Transforms/PhaseOrdering/AArch64/hoisting-sinking-required-for-vectorization.ll
    M llvm/test/Transforms/PhaseOrdering/AArch64/matrix-extract-insert.ll
    M llvm/test/Transforms/PhaseOrdering/AArch64/peel-multiple-unreachable-exits-for-vectorization.ll
    M llvm/test/Transforms/PhaseOrdering/AArch64/quant_4x4.ll
    M llvm/test/Transforms/PhaseOrdering/ARM/arm_mult_q15.ll
    M llvm/test/Transforms/PhaseOrdering/X86/hoist-load-of-baseptr.ll
    M llvm/test/Transforms/PhaseOrdering/X86/speculation-vs-tbaa.ll
    M llvm/test/Transforms/PhaseOrdering/X86/vector-reductions-logical.ll
    M llvm/test/Transforms/PhaseOrdering/fast-basictest.ll
    M llvm/test/Transforms/PhaseOrdering/reassociate-instcombine.ll
    M llvm/test/Transforms/PhaseOrdering/runtime-check-removal.ll
    M llvm/test/Transforms/Reassociate/fast-ArrayOutOfBounds.ll
    M llvm/test/Transforms/Reassociate/fast-SubReassociate.ll
    M llvm/test/Transforms/SLPVectorizer/X86/cmp_commute-inseltpoison.ll
    M llvm/test/Transforms/SLPVectorizer/X86/cmp_commute.ll

  Log Message:
  -----------
  [InstCombine] Remove some of the complexity-based canonicalization (#91185)

The idea behind this canonicalization is that it allows us to handle less
patterns, because we know that some will be canonicalized away. This is
indeed very useful to e.g. know that constants are always on the right.

However, this is only useful if the canonicalization is actually
reliable. This is the case for constants, but not for arguments: Moving
these to the right makes it look like the "more complex" expression is
guaranteed to be on the left, but this is not actually the case in
practice. It fails as soon as you replace the argument with another
instruction.

The end result is that it looks like things correctly work in tests,
while they actually don't. We use the "thwart complexity-based
canonicalization" trick to handle this in tests, but it's often a
challenge for new contributors to get this right, and based on the
regressions this PR originally exposed, we clearly don't get this right
in many cases.

For this reason, I think that it's better to remove this complexity
canonicalization. It will make it much easier to write tests for
commuted cases and make sure that they are handled.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list