[PATCH] D39752: [ARM] Place jump table as the first operand in additions
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 8 12:21:29 PST 2017
efriedma added a comment.
> I prefer to have any kind of IR generated or transformed into some (more or less) canonicalised form, to reduce the number of cases that need to be matched. For such indexed loads it's fairly typical and natural to shift/multiply the index, instead of the base address.
Sure... but we definitely have code in ARMDAGToDAGISel::SelectAddrMode2Worker which tries to commute the base and offset. I'd like to understand why it isn't triggering. It's not a big deal to explicitly commute the operands here, but the same issue could affect other cases where the addition comes out of user code.
Just took a quick look with a debugger; it looks like the code never triggers because of the hasOneUse() check?
Repository:
rL LLVM
https://reviews.llvm.org/D39752
More information about the llvm-commits
mailing list