[llvm] r307179 - [DAGCombiner] visitRotate patch to optimize pair of ROTR/ROTL instructions into one with combined shift operand.

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 13:54:36 PDT 2017


On Wed, Jul 05, 2017 at 05:55:43PM -0000, Andrew Zhogin via llvm-commits wrote:
> Author: andrew.zhogin
> Date: Wed Jul  5 10:55:42 2017
> New Revision: 307179
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=307179&view=rev
> Log:
> [DAGCombiner] visitRotate patch to optimize pair of ROTR/ROTL instructions into one with combined shift operand.
> 
> For two ROTR operations with shifts C1, C2; combined shift operand will be (C1 + C2) % bitsize.

This crashes during the Qt build. Reproducer is attached, try -O2.

Joerg
-------------- next part --------------
short a, b;
unsigned short d;
void QMessageLogger(char *, int, char *);
void qSafeFromBigEndian(unsigned short *p1) {
  b = __builtin_bswap16(a);
  *p1 = b;
}
void getTrueTypeGlyphIndex() {
  qSafeFromBigEndian(&d);
  if (d == 0)
    ;
  else if (d == 4)
    ;
  else if (d == 6)
    ;
  else if (d == 12)
    ;
  else
    QMessageLogger(nullptr, 0, nullptr);
}


More information about the llvm-commits mailing list