[LLVMdev] load widening no more?

Kostya Serebryany kcc at google.com
Thu Nov 22 20:44:24 PST 2012


Hi,

Here is a simple test on which (I swear!) clang used to perform load
widening.
Not any more. What's happened?

% cat lw.cc
struct S {
  int a;
  unsigned char x, y, z, w;
};

int foo(S *s) {
  if (s->x == 0 && s->y == 0) return 0;
  return 1;
}

% clang -O2 -S -o -  lw.cc | grep '(%'
        cmpb    $0, 4(%rdi)
        cmpb    $0, 5(%rdi)
% gcc -O2 -S -o -  lw.cc | grep '(%'
        cmpw    $0, 4(%rdi)
%

--kcc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121123/ec7ea7a4/attachment.html>


More information about the llvm-dev mailing list