[llvm] r367133 - [PowerPC][AIX]Add lowering of MCSymbol MachineOperand.
Sean Fertile via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 26 10:25:27 PDT 2019
Author: sfertile
Date: Fri Jul 26 10:25:27 2019
New Revision: 367133
URL: http://llvm.org/viewvc/llvm-project?rev=367133&view=rev
Log:
[PowerPC][AIX]Add lowering of MCSymbol MachineOperand.
Adds machine operand lowering for MCSymbolSDNodes to the PowerPC
backend. This is needed to produce call instructions in assembly for AIX
because the callee operand is a MCSymbolSDNode. The test is XFAIL'ed for
asserts due to a (valid) assertion in PEI that the AIX ABI isn't supported yet.
Differential Revision: https://reviews.llvm.org/D63738
Modified:
llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
llvm/trunk/lib/Target/PowerPC/PPCMCInstLower.cpp
llvm/trunk/test/CodeGen/PowerPC/test_call_aix.ll
Modified: llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp (original)
+++ llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp Fri Jul 26 10:25:27 2019
@@ -1843,6 +1843,9 @@ MCSection *TargetLoweringObjectFileXCOFF
Kind, /* BeginSymbolName */ nullptr);
}
+ if (Kind.isText())
+ return TextSection;
+
report_fatal_error("XCOFF other section types not yet implemented.");
}
Modified: llvm/trunk/lib/Target/PowerPC/PPCMCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCMCInstLower.cpp?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCMCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCMCInstLower.cpp Fri Jul 26 10:25:27 2019
@@ -193,6 +193,9 @@ bool llvm::LowerPPCMachineOperandToMCOpe
OutMO = GetSymbolRef(MO, AP.GetBlockAddressSymbol(MO.getBlockAddress()), AP,
isDarwin);
return true;
+ case MachineOperand::MO_MCSymbol:
+ OutMO = GetSymbolRef(MO, MO.getMCSymbol(), AP, isDarwin);
+ return true;
case MachineOperand::MO_RegisterMask:
return false;
}
Modified: llvm/trunk/test/CodeGen/PowerPC/test_call_aix.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/test_call_aix.ll?rev=367133&r1=367132&r2=367133&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/test_call_aix.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/test_call_aix.ll Fri Jul 26 10:25:27 2019
@@ -1,9 +1,14 @@
+; XFAIL: asserts
+
; RUN: llc -mtriple powerpc-ibm-aix-xcoff -stop-after=machine-cp < %s | \
; RUN: FileCheck --check-prefix=32BIT %s
; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -stop-after=machine-cp < %s | \
; RUN: FileCheck --check-prefix=64BIT %s
+; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck %s
+; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck %s
+
declare void @foo(...)
define void @test_call() {
@@ -16,6 +21,10 @@ entry:
; 64BIT: BL8_NOP <mcsymbol .foo>, csr_aix64, implicit-def dead $lr8, implicit $rm, implicit $x2, implicit-def $r1
; 64BIT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1
+; CHECK-LABEL: test_call
+; CHECK: bl .foo
+; CHECK-NEXT: nop
+
call void bitcast (void (...)* @foo to void ()*)()
ret void
}
@@ -35,6 +44,10 @@ entry:
; 64BIT: BL8 <mcsymbol .foo_local>, csr_aix64, implicit-def dead $lr8, implicit $rm, implicit $x2, implicit-def $r1
; 64BIT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1
+; CHECK-LABEL: test_local_call
+; CHECK: bl .foo_local
+; CHECK-NOT: nop
+
call void @foo_local()
ret void
}
More information about the llvm-commits
mailing list