https://llvm.org/bugs/show_bug.cgi?id=25509
Bug ID: 25509 Summary: [LIR] Misses simple memset case Product: libraries Version: trunk Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: Loop Optimizer Assignee: unassignedb...@nondot.org Reporter: mcros...@codeaurora.org CC: llvm-bugs@lists.llvm.org Classification: Unclassified LLVM is unable to generate a memset from the below test: void test(int *arr) { for (int i = 0; i < 1024; ++i) { arr[i] = 0; arr[i+1024] = 0; } } As of r252817 clang produces: test: // @test // BB#0: // %entry mov x8, xzr movi v0.2d, #0000000000000000 .LBB0_1: // %vector.body // =>This Inner Loop Header: Depth=1 add x9, x0, x8 add x8, x8, #16 // =16 str q0, [x9] str q0, [x9, #4096] cmp x8, #1, lsl #12 // =4096 b.ne .LBB0_1 // BB#2: // %for.cond.cleanup ret GCC is able to generate 2 memsets (one per arr access). If I'm not mistaken this can be transformed into a single memset (i.e., memset(arr, 0, 2048)). -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs