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
    Classification: Unclassified

When compiling the following C program.

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

Reply via email to