[llvm] r274570 - ARM: fix `-mlong-calls` for WoA
Saleem Abdulrasool via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 5 11:30:53 PDT 2016
Author: compnerd
Date: Tue Jul 5 13:30:52 2016
New Revision: 274570
URL: http://llvm.org/viewvc/llvm-project?rev=274570&view=rev
Log:
ARM: fix `-mlong-calls` for WoA
Not all code-paths set the relocation model to static for Windows. This
currently breaks on Windows ARM with `-mlong-calls` when built with clang.
Loosen the assertion to what it was previously. We would ideally ensure that
all the configuration sets Windows to static relocation model.
Modified:
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
llvm/trunk/test/CodeGen/ARM/Windows/long-calls.ll
Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=274570&r1=274569&r2=274570&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Jul 5 13:30:52 2016
@@ -1814,7 +1814,7 @@ ARMTargetLowering::LowerCall(TargetLower
auto PtrVt = getPointerTy(DAG.getDataLayout());
if (Subtarget->genLongCalls()) {
- assert(!isPositionIndependent() &&
+ assert((!isPositionIndependent() || Subtarget->isTargetWindows()) &&
"long-calls codegen is not position independent!");
// Handle a global address or an external symbol. If it's not one of
// those, the target's already in a register, so we don't need to do
Modified: llvm/trunk/test/CodeGen/ARM/Windows/long-calls.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/Windows/long-calls.ll?rev=274570&r1=274569&r2=274570&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/Windows/long-calls.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/Windows/long-calls.ll Tue Jul 5 13:30:52 2016
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=thumbv7-windows -mcpu=cortex-a9 -mattr=+long-calls -o - %s \
+; RUN: llc -mtriple=thumbv7-windows -mcpu=cortex-a9 -relocation-model pic -mattr=+long-calls -o - %s \
; RUN: | FileCheck %s
declare arm_aapcs_vfpcc void @callee()
More information about the llvm-commits
mailing list