[PATCH] Implement ADRP CSE for global symbols

Quentin Colombet qcolombet at apple.com
Wed May 14 19:30:14 PDT 2014


> I think if I don't explicit set alignment, by default it should be natural alignment for both internal and external global variables, right?

I am not sure. IIRC, no alignment means 1-byte aligned.

> The original code for internal globals doesn't explicitly set alignment either.

This is not a problem because the module will see that as all the globals are locally known. But for external, the problem is different as the modules will not see the new alignment and thus, assume whatever the front-end or ABI tells to the backend.
I fell like there is something wrong here, but I may just be paranoid. I wanted to let you know so you can double check :).

> Now I've got an A57/A53 big-little board, so I did some experiment and the data shows there isn't really performance impact for spec2000 int on both A57 and A53 (I believe you understand I can't post the performance data directly here due to legal issue), although I do see the following adrp instruction reductions for ARM64,

I concur the ADRP reduction for CINT2000, here the numbers for O3:
Benchmark_ID    	Reference	Test    	Expansion 	Percent
-------------------------------------------------------------------------------
./164.gzip/Output/164.g	          655	          632	    0.96	    -4%
./175.vpr/Output/175.vp	         1678	         1678	       1	    +0%
./176.gcc/Output/176.gc	        14838	        14701	    0.99	    -1%
./181.mcf/Output/181.mc	           39	           39	       1	    +0%
./186.crafty/Output/186	         3922	         3896	    0.99	    -1%
./197.parser/Output/197	         1398	         1366	    0.98	    -2%
./252.eon/Output/252.eo	         1162	         1160	       1	    +0%
./253.perlbmk/Output/25	         9446	         9444	       1	    +0%
./254.gap/Output/254.ga	         6058	         5988	    0.99	    -1%
./255.vortex/Output/255	         7811	         7566	    0.97	    -3%
./256.bzip2/Output/256.	          590	          590	       1	    +0%
./300.twolf/Output/300.	         3244	         3244	       1	    +0%
-------------------------------------------------------------------------------
Min (12)               	            -	            -	    0.96	      -
-------------------------------------------------------------------------------
Max (12)               	            -	            -	       1	      -
-------------------------------------------------------------------------------
Sum (12)               	        50841	        50304	    0.99	    +1%
-------------------------------------------------------------------------------
A.Mean (12)            	            -	            -	    0.99	    -1%
-------------------------------------------------------------------------------
G.Mean 2 (12)          	            -	            -	    0.99	    -1%
-------------------------------------------------------------------------------

However, I do see some performance regressions (see my previous post).

> Anyway, I would be extremely appreciative if you can understand the current situation and agree to upstream this patch first.

I am fine with that assuming:
1. This is disabled by default for the arm64-apple-* triple.
2. You have double check the alignment stuff :).

Thanks,
-Quentin

http://reviews.llvm.org/D3432






More information about the llvm-commits mailing list