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

            Bug ID: 30437
           Summary: [AArch64] Unnecessary mask instruction on AArch64
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangb...@nondot.org
          Reporter: yyc1...@gmail.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

When compiling the following C program.

```c
typedef struct {
    char a;
    char b;
} ntuple2_t;

ntuple2_t g(void);

ntuple2_t f(void)
{
    return g();
}
```

The LLVM IR generated on AArch64 is
```llvm
define i64 @f() local_unnamed_addr #0 {
  %1 = tail call i64 @g() #2
  %2 = and i64 %1, 65535
  ret i64 %2
}
```

Here the `and` instruction is not really necessary since `g` and `f` follows
the same calling convention.

-- 
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

Reply via email to