https://llvm.org/bugs/show_bug.cgi?id=23744

            Bug ID: 23744
           Summary: Less efficient encoding of and using direct object
                    emission
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: MC
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

"and" has a less efficient encoding when using direct object emission, compared
to outputting assembly (-O1/2/3).

Found with running check_cfc.py dash_s_no_change on the llvm-test-suite
(r238815).

Reduced from function_try_block.cpp

$ cat test.cpp
static int a;
void fn1() {
  if (a)
    a = 0;
  a = 1;
}
$ clang++ -O1 -c test.cpp && objdump -d test.o
test.o:     file format elf64-x86-64
...
0000000000000000 <_Z3fn1v>:
   0:   0f b6 05 00 00 00 00    movzbl 0x0(%rip),%eax        # 7 <_Z3fn1v+0x7>
   7:   25 01 00 00 00          and    $0x1,%eax
...

$ clang++ -O1 -c test.cpp -via-file-asm && objdump -d test.o
test.o:     file format elf64-x86-64
...
0000000000000000 <_Z3fn1v>:
   0:   0f b6 05 00 00 00 00    movzbl 0x0(%rip),%eax        # 7 <_Z3fn1v+0x7>
   7:   83 e0 01                and    $0x1,%eax
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to