https://llvm.org/bugs/show_bug.cgi?id=28966
Bug ID: 28966 Summary: [AArch64] orr wzr vs. mov Product: libraries Version: trunk Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: Backend: AArch64 Assignee: unassignedb...@nondot.org Reporter: spatel+l...@rotateright.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Forking this off bug 28965. I can't imagine this would make any perf difference in practice, but it suggests that there's some missing analysis/fold/pattern-matching because functionally equivalent IR is producing different code: $ cat cmpsel.ll define i32 @goo(i32 %x) { %cmp = icmp eq i32 %x, 1 %sel = select i1 %cmp, i32 1, i32 -1 ret i32 %sel } define i32 @hoo(i32 %x) { %cmp = icmp ne i32 %x, 1 <--- inverse condition %sel = select i1 %cmp, i32 -1, i32 1 <--- swap select operands ret i32 %sel } $ ./llc -o - cmpsel.ll -mtriple=aarch64 goo: // @goo cmp w0, #1 // =1 orr w8, wzr, #0x1 cneg w0, w8, ne ret hoo: // @hoo cmp w0, #1 // =1 mov w8, #-1 cneg w0, w8, eq 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 http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs