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

            Bug ID: 50421
           Summary: clang does not optimize alignment checks
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangb...@nondot.org
          Reporter: gonzalo.gades...@gmail.com
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@metafoo.co.uk

Example: https://godbolt.org/z/G8j6dbG6T

    #include <cstdint>
    bool copy(int* out, int* in) {
        *out = *in;
        return (std::uintptr_t)in % 4 == 0;
    }

does not optimize the alignment check away:

copy(int*, int*):                            # @copy(int*, int*)
        mov     eax, dword ptr [rsi]
        mov     dword ptr [rdi], eax
        test    sil, 3
        sete    al
        ret

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to