[PATCH] D95426: [GlobalISel] Extract a narrowScalarAddSub method. NFC
Amara Emerson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 27 23:45:17 PST 2021
aemerson added inline comments.
================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:4460
+ unsigned OpO, OpE;
+ switch (MI.getOpcode()) {
+ case TargetOpcode::G_ADD:
----------------
porglezomp wrote:
> paquette wrote:
> > Since there are only two cases, an `if`/`else` is sufficient here.
> I'm planning to expand this to support the overflowing ops later, so it will be 10 cases eventually. Should I just change it to a switch when I start adding those other cases?
In that case stick with the switch.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95426/new/
https://reviews.llvm.org/D95426
More information about the llvm-commits
mailing list