The issues was found during D40524.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/X86/X86FixupBWInsts.cpp | ||
---|---|---|
256 ↗ | (On Diff #131427) | Wouldn't TRI->isSuperOrSubRegisterEq() have the same effect as TRI->checkRegistersAlias()? It isn't clear to me why the new function is needed. Also, a comment here saying more verbosely what this is meant to be looking for would be helpful. I'm thinking something like this: // If MO is a use of any part of the destination register but is not equal to OrigDestReg // or one of its subregisters, we cannot use SuperDestReg. For example, if OrigDestReg // is %al then an implicit use of %ah, %ax, %eax, or %rax will prevent us from using // the %eax register. |
Indeed, on X86 checkRegistersAlias is just isSuperOrSubRegisterEq (although the former would be the right choice if that was not so :)).
Comment was added - thanks for the exact text!
lib/Target/X86/X86FixupBWInsts.cpp | ||
---|---|---|
256 ↗ | (On Diff #131427) | There is also TargetRegisterInfo::regsOverlap() which should be slightly more efficient (this is implemented in CodeGen because we have access to register units theres, which the MC layer doesn't know about) |
test/CodeGen/X86/fixup-bw-inst.mir | ||
204–246 ↗ | (On Diff #131474) |
Use regsOverlap instead of isSuperOrSubRegisterEq.
test/CodeGen/X86/fixup-bw-inst.mir | ||
---|---|---|
204–246 ↗ | (On Diff #131474) | Thanks for the pointer. However, the whole file would benefit from this so I'd like to do the change in a subsequent commit. It should not require a review and can be directly committed, right? |
test/CodeGen/X86/fixup-bw-inst.mir | ||
---|---|---|
204–246 ↗ | (On Diff #131474) | Yes a change simplifying .mir like this is so obvious that it can be directly committed (aka post-commit review). |