[llvm-commits] [PATCH] Emit andl instructions instead of andq instructions if possible

Evan Cheng evan.cheng at apple.com
Tue Dec 18 20:00:41 PST 2012


Hi David,

LGTM. Please add comments above the "let AddedComplexity = 1 in" to explain why those patterns are preferred.

Thanks,

Evan
On Dec 9, 2012, at 1:06 AM, David Majnemer <david.majnemer at gmail.com> wrote:

> There are cases where LLVM chooses to emit andq instructions where an andl instruction would suffice. The latter instruction is advantageous because it is a single byte smaller.
> 
> LLVM already had entries in X86InstrCompiler.td to perform this optimization, however another pattern was being preferred. The attached patch increases the priorities of two patterns so that they will be preferred is they match.
> 
> The attached patch passes all regressions and includes a test to verify that the fix is working.
> <smaller-and.ll>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list