[llvm-bugs] [Bug 51694] New: [missed optimization opportunity] clang still generates code for empty std::map iteration

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 31 15:47:34 PDT 2021


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

            Bug ID: 51694
           Summary: [missed optimization opportunity] clang still
                    generates code for empty std::map iteration
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yuri at tsoft.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 25208
  --> https://bugs.llvm.org/attachment.cgi?id=25208&action=edit
testcase.cpp

The attached testcase iterates through the std::map object with empty for-body.

clang-14 still generates some code in this function when it should be empty.

Replacing the type of the argument with std::vector correctly leads to an empty
function.

-- 
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/20210831/b998fde0/attachment.html>


More information about the llvm-bugs mailing list