LLVM bug report reductions

1. Scalar x86 high-half multiply

File: mulhi32_scalar_x86.ll

Issue:

  • Portable IR for “high 32 bits of a 32x32 product” is not lowered to the natural x86 scalar multiply idiom using %edx:%eax.
  • Current llc emits imulq plus shrq $32.

Expected x86_64 shape:

movl  %edi, %eax
mull  %esi
movl  %edx, %eax
retq

and similarly with imull for the signed case.

Suggested bug report title:

  • llc x86_64 misses scalar mulhu/mulhs idiom for zext/sext i32 -> i64 multiply followed by >> 32

2. Complex multiply algebraic reduction

File: complex_mul4_to_mul3.ll

Issue:

  • opt -O2 does not reduce the naive complex multiply (ac - bd, ad + bc) from 4 multiplies to a 3-multiply equivalent.
  • This is not a codegen peephole; it would need a middle-end algebraic combine.

Suggested bug report title:

  • InstCombine/GVN do not reduce naive complex multiply to 3-multiply form

Caveat:

  • This second issue is much less likely to be accepted as a straightforward bug.
  • It may be considered a missed optimization or out-of-scope transform unless there is a profitability proof and clear overflow semantics story.