[PATCH] D93857: Revert "[InstCombine] Hoist xor-by-constant from xor-by-value"

Bogdan Graur via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 28 07:44:52 PST 2020


bgraur added a comment.

Here's a small repro:

#include <cstdint>

static int v;

void foo(unsigned char x[2]) {

  x[0] = static_cast<unsigned char>(reinterpret_cast<uintptr_t>(&v));
  x[1] = ~static_cast<unsigned char>(0);
  
  for (int i = 0; i < 2; i++) {
    unsigned char s0 = x[0];
    unsigned char s1 = x[1];
    s1 ^= s0;
    x[0] = s1 ^ (s1 << 1);
    x[1] = (s1 << 4) | (s1 >> 4);
  }

}


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93857



More information about the llvm-commits mailing list