[PATCH] D99284: [RegAllocFast] properly handle STATEPOINT instruction.
Serguei Katkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 1 23:01:08 PDT 2021
skatkov accepted this revision.
skatkov added a comment.
lgtm. Please wait for @arsenm feedback.
================
Comment at: llvm/lib/CodeGen/RegAllocFast.cpp:1141
+ // Set of registers allocated to tied defs.
+ SmallSet<Register, 16> AssignedTiedDefs;
+
----------------
you do not need to collect all tied-defs assigned. As soon as it is under an assert, you can just iterate over defs of MI and check that if it is def it is not assigned to clobbered register.
Moreover you can move an assert to end of an allocation and also check that tied-use is allocated to the same register.
If you decide to leave it in this way - please ensure that this declaration and inserting in the set is not used in product mode.
================
Comment at: llvm/lib/CodeGen/RegAllocFast.cpp:1279
+#ifndef NDEBUG
+ for (auto R : AssignedTiedDefs) {
+ assert(!MachineOperand::clobbersPhysReg(RegMask, R) &&
----------------
consider usage of all_of instead. So you will not need #ifdef then.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99284/new/
https://reviews.llvm.org/D99284
More information about the llvm-commits
mailing list