[PATCH] D14477: Remove unnecessary call to getAllocatableRegClass

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 9 09:20:43 PST 2015


qcolombet added a comment.

> I'm not sure why you would ever define an instruction that produces an unallocatable register class.


That’s not exactly the semantic here. The register class is not unallocatable per say, only a subset is. By calling getAllocatableClass, we get the subset of the class that is allocatable.
This may happen if say, your instruction can encode GPR + SP but you can only allocate GPR.

In other words, what you’re saying in the next sentence is perfectly legal:

>   it seems like it should be a verifier error to define such an instruction.


I have to admit I have some troubles figuring why this is a problem in your case. May be worth spending more time to understand what is going on (i.e., probably spending more time to explain to me :)).
That being said, I believe the reason why you don’t have any test failing because of that change, is simply because when we create virtual register we restrict them on allocatable class. I honestly don’t see how we could be an example where this is needed.

The bottom line is okay, to remove this additional check, but two things:

- I’d like to understand why this is a problem in your case. (Could you post the MI representation exposing the problem.)
- Please add a test case for your problem. (Could be done as a follow-up commit if you want to track the changes separately.)

Thanks,
-Quentin


http://reviews.llvm.org/D14477





More information about the llvm-commits mailing list