[llvm-bugs] [Bug 45650] New: Inefficient codegen for postincrement of _ExtInt(256)

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 23 12:23:53 PDT 2020


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

            Bug ID: 45650
           Summary: Inefficient codegen for postincrement of _ExtInt(256)
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: arthur.j.odwyer at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

The following source code:

// https://wide.godbolt.org/z/t6j6Z-
using uint256 = unsigned _ExtInt(256);
extern auto inc2(uint256& a)
{
    return a++;
}

produces the following x86-64 assembly at -O3:

inc2(unsigned int _ExtInt<256>&): # @inc2(unsigned int _ExtInt<256>&)
  pushq %rbx
  movq %rdi, %rax
  movq 24(%rsi), %r8
  movq 16(%rsi), %r11
  movq (%rsi), %r9
  movq 8(%rsi), %r10
  movq %r9, %rdi
  addq $1, %rdi
  movq %r10, %rcx
  adcq $0, %rcx
  movq %r11, %rdx
  adcq $0, %rdx
  movq %r8, %rbx
  adcq $0, %rbx
  movq %rdi, (%rsi)
  movq %rcx, 8(%rsi)
  movq %rdx, 16(%rsi)
  movq %rbx, 24(%rsi)
  movq %r11, 16(%rax)
  movq %r8, 24(%rax)
  movq %r9, (%rax)
  movq %r10, 8(%rax)
  popq %rbx
  retq

Also, completely tangential, I notice that the demangler thinks the spelling is
`ExtInt<256>`, but the real syntax is supposed to be `_ExtInt(256)`.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200423/0c5389e8/attachment.html>


More information about the llvm-bugs mailing list