[PATCH] D95649: [GlobalISel] Implement regbankselect for G_ASSERT_ZEXT
Amara Emerson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 28 16:40:22 PST 2021
aemerson accepted this revision.
aemerson added inline comments.
This revision is now accepted and ready to land.
================
Comment at: llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp:627
+ if (isPreISelGenericOptimizationHint(MI.getOpcode())) {
+ // The only correct mapping for these is to always use the source register
+ // bank.
----------------
I think we should assert here that we expect G_ASSERT_ZEXT, because I suppose in future more hint instructions may not have the same form as copies (the doc didn't specify that hints in general can always be treated as copies).
================
Comment at: llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp:633
+ assert(RB && "Expected source register to have a register bank?");
+ LLVM_DEBUG(dbgs() << "... Hint always uses source's register bank.\n");
+ MRI->setRegBank(MI.getOperand(0).getReg(), *RB);
----------------
s/Hint/ASSERT_ZEXT
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95649/new/
https://reviews.llvm.org/D95649
More information about the llvm-commits
mailing list