[PATCH] D153197: [AVR] Expand shifts during AVRISelLowering

Patryk Wychowaniec via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 18 04:25:34 PDT 2023


Patryk27 added inline comments.


================
Comment at: llvm/lib/Target/AVR/AVRISelLowering.cpp:2207
+  MF->push_back(LoopBB);
+  MachineBasicBlock *ExitBB = EntryBB->splitAt(MI, false);
+
----------------
Alright, this is wrong, after all - I've just tested it on a more elaborate code in rustc and `EntryBB->removeSuccessor(ExitBB);` triggers an LLVM panic (presumably because EntryBB == ExitBB).

I kinda don't understand why doing something like this:

```
MachineBasicBlock *ExitBB = EntryBB->splitAt(MI, false);

if (EntryBB == ExitBB) {
  assert(EntryBB->canFallThrough() && "Expected a fallthrough block!");
  ExitBB = EntryBB->getFallThrough();
}
```

... is not sufficient, though 👀


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153197/new/

https://reviews.llvm.org/D153197



More information about the cfe-commits mailing list