[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
Thu Nov 9 12:27:30 PST 2017


efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.

LGTM.

> I can't quite understand the logic there - certainly it would make more sense to fold the shift into the addressing mode when shift node *has* one use ?

I think that was the intent... but it got mixed up, and nobody caught it because it's not something which would trigger often anyway (since GEPs are lowered with the pointer base on the LHS).  It is possible to show the general missed optimization with C code like the following: "int a(int x, int y) { return *((char*)(x*4)+y); }".  But I'm fine leaving that for a separate patch.


Repository:
  rL LLVM

https://reviews.llvm.org/D39752





More information about the llvm-commits mailing list