This is a fix for https://llvm.org/bugs/show_bug.cgi?id=29010
Root cause of the bug is that the register class of the machine instruction operand does not fully reflect if this registers that can be allocated.
Both for i386 and x86_64 the operand's register class is VR128RegClass and thus contains xmm0-xmm15, though in i386 we can only use xmm0-xmm8.
In order to get the actual allocable registers of the class we need to use RegisterClassInfo.
Details
Details
- Reviewers
mkuper - Commits
- rG53ce3f9d023e: Fix for PR29010
rL278954: Fix for PR29010
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGTM, except for a nit in the test.
test/CodeGen/X86/pr29010.ll | ||
---|---|---|
1 | Why do you need -mcpu? Shouldn't -mattr be enough? |
test/CodeGen/X86/pr29010.ll | ||
---|---|---|
1 | Copy paste from another test :) I'll remove it |
Comment Actions
Wouldn't it be easier to test MachineRegisterInfo::isAllocatable() instead of constructing a whole RegisterClassInfo object just for this one place?
Why do you need -mcpu? Shouldn't -mattr be enough?