[llvm] 5b18b6e - [PowerPC][Future] Fix for 6c4b40def77622a5cf62a219ef4af63dc876e144

Stefan Pintilie via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 18:19:59 PDT 2020


Author: Stefan Pintilie
Date: 2020-04-10T01:12:11Z
New Revision: 5b18b6e9a84d985c0a907009fb71de7c1943bc88

URL: https://github.com/llvm/llvm-project/commit/5b18b6e9a84d985c0a907009fb71de7c1943bc88
DIFF: https://github.com/llvm/llvm-project/commit/5b18b6e9a84d985c0a907009fb71de7c1943bc88.diff

LOG: [PowerPC][Future] Fix for 6c4b40def77622a5cf62a219ef4af63dc876e144

This is a fix for the previous patch 6c4b40def77622a5cf62a219ef4af63dc876e144.
In some cases it may be possible to have the compiler produce st_other=1 without
the compiler using mcpu=future which should not be the case. This patch adds a
guard to make sure that if we are using st_other=1 then we are also compiling
for future CPU.

Added: 
    

Modified: 
    llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index e0bbb8f8dd3e..54fb4d52ccd3 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -1521,7 +1521,7 @@ void PPCLinuxAsmPrinter::emitFunctionBodyStart() {
 
     if (TS)
       TS->emitLocalEntry(cast<MCSymbolELF>(CurrentFnSym), LocalOffsetExp);
-  } else if (Subtarget->isELFv2ABI()) {
+  } else if (Subtarget->isELFv2ABI() && Subtarget->isUsingPCRelativeCalls()) {
     // When generating the entry point for a function we have a few scenarios
     // based on whether or not that function uses R2 and whether or not that
     // function makes calls (or is a leaf function).


        


More information about the llvm-commits mailing list