[PATCH] D70374: [PowerPC] combine rlwinm + rlwinm to rlwinm

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 27 00:51:22 PST 2019


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

This patch caused failure in http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/21918

Narrow down case:

  #define rlwinm( output, input, sh, mb, me ) \
     __asm__( "rlwinm %0, %1, %2, %3, %4" \
            : "=r"(output) \
            : "r"(input), "i"(sh), "i"(mb), "i"(me) \
            : )
  
  int main()
  {
     long x = 0x1122334455667788L ;
     long y ;
     long z;
  
     rlwinm( y, x, 1, 0, 30) ;
     rlwinm( z, y, 31, 1, 0) ;
  
     printf("0x%016lX -> 0x%016lX -> 0x%016lX\n", x, y, z) ;
  
     return 0 ;
  }

We should get result:

  0x1122334455667788 -> 0x00000000AACCEF10 -> 0x5566778855667788

But with this patch,

  y = RLWINM x, 1, 0, 30
  z = RLWINM y, 31, 1, 0

We will convert z to `z = LI 0`, this is not right.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70374





More information about the llvm-commits mailing list