[PATCH] D19659: [X86] Enable RRL part of the LEA optimization pass for -O2

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 09:36:12 PDT 2016


qcolombet added inline comments.

================
Comment at: test/CodeGen/X86/lea-opt.ll:1-2
@@ -1,2 +1,3 @@
 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
+; RUN: llc --disable-x86-lea-opt < %s -mtriple=x86_64-linux | FileCheck %s -check-prefix=DISABLED
 
----------------
aturetsk wrote:
> Done.
Could you factor out the common pattern under a CHECK file and move the rest in two different patterns ENABLED/DISABLED.
That way it would be easier to see the effects of the pass.
(I also suspect that DISABLED will be a superset of CHECK and ENABLED will be empty.)

(Note: you can use several check prefix on the command line with additional —check-prefix options.)

================
Comment at: test/CodeGen/X86/lea-opt.ll:137
@@ -113,1 +136,3 @@
+  %cvt = ptrtoint i32* %b to i32
+  store i32 %cvt, i32* %b, align 4
   br label %sw.epilog
----------------
aturetsk wrote:
> There are two LEA instructions in this test.
> 
> Before this patch, RRL part of the pass was disabled for 'optsize', so both LEAs were preserved and RemoveRedundantAddressCalculation part of the pass had to choose a LEA for substitution in load instructions. And it should choose not the closest one, but the one which would make a resulting displacement fit 1 byte (that's exactly what the test checks).
> 
> After this patch, RRL part of the pass is enabled for 'optsize'. And without the changes in the test I made it would remove one of the LEAs and thus RRAC part of the pass wouldn't need to choose a LEA for substitution (because only one remained). So the test would become useless.
Thanks for the clarification.


http://reviews.llvm.org/D19659





More information about the llvm-commits mailing list