Issue 244549
Summary [X86] Avoid repeated Chain user scans in combineLoad
Labels new issue
Assignees
Reporter Michael-Chen-NJU
    `X86TargetLowering::combineLoad` scans `Chain->users()` for each eligible vector load to find a matching `X86ISD::SUBV_BROADCAST_LOAD.` When no matching broadcast load exists for a pointer, the scan cannot succeed, but the shared chain is still traversed.

This was observed while compiling the SDXL UNet CPU test from [IREE](https://github.com/iree-org/iree-test-suites/blob/615de7ee4c2190145e641fb809ffcfb801659eb6/torch_models/examples/modules/scheduled_unet_cpu.json).

The attached IR was reduced from the captured attention function using llvm-reduce. It triggers over 1M Chain-user visits with no successful matches under diagnostic instrumentation, while compiling successfully with llc.

[reproducer.ll](https://gist.github.com/Michael-Chen-NJU/d2e2c80b82c57fba81ed6ef0e5a57c53)

`llc -O3 -mcpu=znver4 -filetype=obj reproducer.ll -o /tmp/reproducer.o`

On the full LLVM IR generated from the IREE SDXL UNet compilation, this reduced llc -O3 compilation time from 13.11s to 10.59s (**19.5%**) across seven alternating A/B pairs.This is an exploratory prototype, not a fully validated fix.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to