This is a workaround for a coalescer bug where coalescing
SUBREG_TO_REG ends up losing the liveness of the high bits of the
source register. The result is an incorrect undef subregister def
instead of preserving the high values. Work around the observed
failure after the resulting mov is eliminated during allocation until
a proper fix is ready. I believe the proper fix is to make
SUBREG_TO_REG use a tied operand.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Thanks you!
LGTM, but I am not expert on CodeGen, please look for more reviews if needed.
Would you like to add one of reproducers as a test?
- check-all is green for me
- original issue is gone
- Perf is not changed on one of our large server benchmarks
Comment Actions
I think the real fix is to make SUBREG_TO_REG use a tied operand with a subregister but that will be a much larger patch
llvm/lib/Target/X86/X86InstrInfo.cpp | ||
---|---|---|
3657 | I should have a more general fix ready tomorrow which adds an implicit-def during coalescing. The handling here then needs to guard against implicit-defs (and report the full def super register intsead of the physical subreg undef def) |
I should have a more general fix ready tomorrow which adds an implicit-def during coalescing. The handling here then needs to guard against implicit-defs (and report the full def super register intsead of the physical subreg undef def)