[PATCH] D48417: Fix global variable addressing code generation issue in PIC medium code model

Chen Jianping via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 24 22:38:52 PDT 2018


Jianping accepted this revision.
Jianping added a comment.
This revision is now accepted and ready to land.



In https://reviews.llvm.org/D48417#1140801, @rnk wrote:

> I have this change as part of https://reviews.llvm.org/D47211, which I'll try to reland soon.


I re-check again with the latest LLVM codes, this one is the minimal modification to fix the compilation error exposed here. 
Once your codes check-in, I think I can abandon this revision.
Thanks



================
Comment at: test/CodeGen/X86/x86-64-codemodel-medium-internal.ll:21-22
+; CHECK-MEDIUM:   movabsq $global_arr+28,
+; CHECK-MEDIUM-PIC-LABEL:  foo:
+; CHECK-MEDIUM-PIC:  addl global_arr+28(%rip),
+  %0 = load i32, i32* getelementptr inbounds ([100 x i32], [100 x i32]* bitcast (<{ i32, i32, [98 x i32] }>* @global_arr to [100 x i32]*), i64 0, i64 7), align 4
----------------
rnk wrote:
> This doesn't seem correct. `global_arr` might be too far away, right?
current LLVM codes will generate the code like this. Because you have enhanced the medium and large code model implementation, this test case need to be removed to reflect more correct result. Thanks


Repository:
  rL LLVM

https://reviews.llvm.org/D48417





More information about the llvm-commits mailing list