https://llvm.org/bugs/show_bug.cgi?id=26083
Bug ID: 26083 Summary: [Combine] !((A > 0) && (B > 0)) -> (A <= 0 || B <= 0) missed when A has multiple users Product: libraries Version: trunk Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: Scalar Optimizations Assignee: unassignedb...@nondot.org Reporter: mcros...@codeaurora.org CC: bma...@codeaurora.org, llvm-bugs@lists.llvm.org Classification: Unclassified Test case: void foo(int A, int B); void test(int A, int B, int C) { foo(!(A > 0 && B > 0), !(A > 0 && C > 0)); } When targeting AArch64 at -O3 I get the following assembly: test1: // @test1 cmp w0, #0 // =0 cset w8, gt cmp w1, #0 // =0 cset w9, gt cmp w2, #0 // =0 cset w10, gt and w9, w8, w9 and w8, w8, w10 eor w0, w9, #0x1 eor w1, w8, #0x1 b foo However, we should be able to generate something like this assembly: cmp w0, #1 // =1 cset w8, lt cmp w1, #1 // =1 cset w9, lt cmp w2, #1 // =1 orr w0, w8, w9 cset w9, lt orr w1, w8, w9 b foo which would replace 2 ANDs and 2 EORs with 2 ORs. My example is for AArch64, but I can't imagine this is a target-specific combine. -- 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