[PATCH] D43283: Variable register class using HwMode
Aleksandar Beserminji via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 14 04:52:18 PST 2018
abeserminji created this revision.
abeserminji added reviewers: petarj, sdardis, kparzysz.
This patch introduces RegClassByHwMode which allows choosing the certain register class in run-time, depending on activated features.
def HwModeA : HwMode<"+fp64", "RegClass">;
def VarRegClass : RegisterClassByHwMode<[DefaultMode, HwModeA], [DefaultRegClass, FP64RegClass]>, RegisterClass<"Target", [f64], 64, (add D0)>;
When +fp64 feature is present, HwModeA is active and VarRegClass behaves like FP64RegClass. Otherwise it becomes DefaultRegClass.
Concern that I have here is that VarRegClass has to inherit RegisterClass in order to use it for instruction definitions. RegisterClass as defined in this case is not used later, because it's substituted with DefaultRegClass/FP64RegClass in tables like MCRegisterClasses, RegisterClasses etc. I'd be glad to hear some comments on that/suggestions on how to fix it.
Depends on https://reviews.llvm.org/D43238. This is second in a series of three patches.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 11027 bytes
Desc: not available
More information about the llvm-commits