[PATCH] D50965: [PowerPC] Fix label address calculation for ppc64
Sean Fertile via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 27 08:23:18 PDT 2018
sfertile accepted this revision.
sfertile added a comment.
LGTM with a few minor comments about the test.
================
Comment at: test/CodeGen/PowerPC/ppc-label2.ll:1
+; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -relocation-model=pic | FileCheck --check-prefix=CHECK-PIC32 %s
+; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -relocation-model=static | FileCheck --check-prefix=CHECK-STATIC32 %s
----------------
Please add `-ppc-asm-full-reg-names` to the run steps.
================
Comment at: test/CodeGen/PowerPC/ppc-label2.ll:3
+; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -relocation-model=static | FileCheck --check-prefix=CHECK-STATIC32 %s
+; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -relocation-model=pic | FileCheck --check-prefix=CHECK-PIC64 %s
+; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -relocation-model=static | FileCheck --check-prefix=CHECK-STATIC64 %s
----------------
Since the codegen is expected to be identical between position-dependent and position-independent we should use the same check-prefix for both.
================
Comment at: test/CodeGen/PowerPC/ppc-label2.ll:19
+; CHECK-STATIC32-NEXT: addis {{[0-9]+}}, {{[0-9]+}}, .Ltmp0 at ha
+; CHECK-PIC64: addis {{[0-9]+}}, {{[0-9]+}}, .LC0 at toc@ha
+; CHECK-PIC64-NEXT: ld 3, .LC0 at toc@l(3)
----------------
The addis will always use the toc-pointer (r2) as the second operand so we should be checking for it directly.
``` addis r3, r2, .LC0 at toc@ha
ld r3, .LC0 at toc@l(r3)```
Repository:
rL LLVM
https://reviews.llvm.org/D50965
More information about the llvm-commits
mailing list