mirror of
				https://git.proxmox.com/git/llvm-toolchain
				synced 2025-11-01 10:28:12 +00:00 
			
		
		
		
	remove patches from 12
This commit is contained in:
		
							parent
							
								
									e2793c0903
								
							
						
					
					
						commit
						b734e3a9f1
					
				| @ -1,58 +0,0 @@ | ||||
| From 3a8282376b6c2bb65a3bb580c10d4da1296d8df1 Mon Sep 17 00:00:00 2001 | ||||
| From: Tom Stellard <tstellar@redhat.com> | ||||
| Date: Thu, 21 Jan 2021 11:35:48 -0800 | ||||
| Subject: [PATCH] Add minor version to libclang.so and libclang-cpp.so SONAME | ||||
| 
 | ||||
| This patch is for the release/11.x branch.  We need to bump the SONAME, because | ||||
| the ABI of the shared library is changing | ||||
| 
 | ||||
| Reviewed By: sylvestre.ledru, cuviper | ||||
| 
 | ||||
| Differential Revision: https://reviews.llvm.org/D94941 | ||||
| ---
 | ||||
|  clang/CMakeLists.txt                   | 2 +- | ||||
|  clang/tools/clang-shlib/CMakeLists.txt | 5 ----- | ||||
|  clang/tools/libclang/CMakeLists.txt    | 1 - | ||||
|  3 files changed, 1 insertion(+), 7 deletions(-) | ||||
| 
 | ||||
| diff --git b/clang/CMakeLists.txt a/clang/CMakeLists.txt
 | ||||
| index bb4b801f01c8..2e06c5fd9028 100644
 | ||||
| --- b/clang/CMakeLists.txt
 | ||||
| +++ a/clang/CMakeLists.txt
 | ||||
| @@ -509,7 +509,7 @@ set(CLANG_EXECUTABLE_VERSION
 | ||||
|      "${CLANG_VERSION_MAJOR}" CACHE STRING | ||||
|      "Major version number that will be appended to the clang executable name") | ||||
|  set(LIBCLANG_LIBRARY_VERSION | ||||
| -    "${CLANG_VERSION_MAJOR}.${CLANG_VERSION_MINOR}" CACHE STRING
 | ||||
| +    "${CLANG_VERSION_MAJOR}" CACHE STRING
 | ||||
|      "Major version number that will be appended to the libclang library") | ||||
|  mark_as_advanced(CLANG_EXECUTABLE_VERSION LIBCLANG_LIBRARY_VERSION) | ||||
|   | ||||
| diff --git b/clang/tools/clang-shlib/CMakeLists.txt a/clang/tools/clang-shlib/CMakeLists.txt
 | ||||
| index 47ff80418bb0..5949223fc8e3 100644
 | ||||
| --- b/clang/tools/clang-shlib/CMakeLists.txt
 | ||||
| +++ a/clang/tools/clang-shlib/CMakeLists.txt
 | ||||
| @@ -48,8 +48,3 @@ add_clang_library(clang-cpp
 | ||||
|                    ${_OBJECTS} | ||||
|                    LINK_LIBS | ||||
|                    ${_DEPS}) | ||||
| -
 | ||||
| -    set_target_properties(clang-cpp
 | ||||
| -      PROPERTIES
 | ||||
| -      VERSION ${LIBCLANG_LIBRARY_VERSION}
 | ||||
| -      SOVERSION ${LIBCLANG_LIBRARY_VERSION})
 | ||||
| diff --git b/clang/tools/libclang/CMakeLists.txt a/clang/tools/libclang/CMakeLists.txt
 | ||||
| index 5cd9ac5cddc1..a4077140acee 100644
 | ||||
| --- b/clang/tools/libclang/CMakeLists.txt
 | ||||
| +++ a/clang/tools/libclang/CMakeLists.txt
 | ||||
| @@ -150,7 +150,6 @@ if(ENABLE_SHARED)
 | ||||
|    else() | ||||
|      set_target_properties(libclang | ||||
|        PROPERTIES | ||||
| -      SOVERSION ${LIBCLANG_LIBRARY_VERSION}
 | ||||
|        VERSION ${LIBCLANG_LIBRARY_VERSION} | ||||
|        DEFINE_SYMBOL _CINDEX_LIB_) | ||||
|      # FIXME: _CINDEX_LIB_ affects dllexport/dllimport on Win32. | ||||
| -- 
 | ||||
| 2.29.2 | ||||
| 
 | ||||
							
								
								
									
										405
									
								
								debian/patches/D91833-bpftrace-fix-code-gen.diff
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										405
									
								
								debian/patches/D91833-bpftrace-fix-code-gen.diff
									
									
									
									
										vendored
									
									
								
							| @ -1,405 +0,0 @@ | ||||
| Index: llvm-toolchain-11-11.1.0/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
 | ||||
| ===================================================================
 | ||||
| --- llvm-toolchain-11-11.1.0.orig/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
 | ||||
| +++ llvm-toolchain-11-11.1.0/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
 | ||||
| @@ -7,6 +7,7 @@
 | ||||
|  //===----------------------------------------------------------------------===// | ||||
|   | ||||
|  #include "llvm/CodeGen/SelectionDAGAddressAnalysis.h" | ||||
| +#include "llvm/Analysis/MemoryLocation.h"
 | ||||
|  #include "llvm/CodeGen/ISDOpcodes.h" | ||||
|  #include "llvm/CodeGen/MachineFrameInfo.h" | ||||
|  #include "llvm/CodeGen/MachineFunction.h" | ||||
| @@ -96,18 +97,28 @@ bool BaseIndexOffset::computeAliasing(co
 | ||||
|    int64_t PtrDiff; | ||||
|    if (NumBytes0.hasValue() && NumBytes1.hasValue() && | ||||
|        BasePtr0.equalBaseIndex(BasePtr1, DAG, PtrDiff)) { | ||||
| +    // If the size of memory access is unknown, do not use it to analysis.
 | ||||
| +    // One example of unknown size memory access is to load/store scalable
 | ||||
| +    // vector objects on the stack.
 | ||||
|      // BasePtr1 is PtrDiff away from BasePtr0. They alias if none of the | ||||
|      // following situations arise: | ||||
| -    IsAlias = !(
 | ||||
| -        // [----BasePtr0----]
 | ||||
| -        //                         [---BasePtr1--]
 | ||||
| -        // ========PtrDiff========>
 | ||||
| -        (*NumBytes0 <= PtrDiff) ||
 | ||||
| -        //                     [----BasePtr0----]
 | ||||
| -        // [---BasePtr1--]
 | ||||
| -        // =====(-PtrDiff)====>
 | ||||
| -        (PtrDiff + *NumBytes1 <= 0)); // i.e. *NumBytes1 < -PtrDiff.
 | ||||
| -    return true;
 | ||||
| +    if (PtrDiff >= 0 &&
 | ||||
| +        *NumBytes0 != static_cast<int64_t>(MemoryLocation::UnknownSize)) {
 | ||||
| +      // [----BasePtr0----]
 | ||||
| +      //                         [---BasePtr1--]
 | ||||
| +      // ========PtrDiff========>
 | ||||
| +      IsAlias = !(*NumBytes0 <= PtrDiff);
 | ||||
| +      return true;
 | ||||
| +    }
 | ||||
| +    if (PtrDiff < 0 &&
 | ||||
| +        *NumBytes1 != static_cast<int64_t>(MemoryLocation::UnknownSize)) {
 | ||||
| +      //                     [----BasePtr0----]
 | ||||
| +      // [---BasePtr1--]
 | ||||
| +      // =====(-PtrDiff)====>
 | ||||
| +      IsAlias = !((PtrDiff + *NumBytes1) <= 0);
 | ||||
| +      return true;
 | ||||
| +    }
 | ||||
| +    return false;
 | ||||
|    } | ||||
|    // If both BasePtr0 and BasePtr1 are FrameIndexes, we will not be | ||||
|    // able to calculate their relative offset if at least one arises | ||||
| Index: llvm-toolchain-11-11.1.0/llvm/unittests/CodeGen/CMakeLists.txt
 | ||||
| ===================================================================
 | ||||
| --- llvm-toolchain-11-11.1.0.orig/llvm/unittests/CodeGen/CMakeLists.txt
 | ||||
| +++ llvm-toolchain-11-11.1.0/llvm/unittests/CodeGen/CMakeLists.txt
 | ||||
| @@ -21,6 +21,7 @@ add_llvm_unittest(CodeGenTests
 | ||||
|    MachineInstrTest.cpp | ||||
|    MachineOperandTest.cpp | ||||
|    ScalableVectorMVTsTest.cpp | ||||
| +  SelectionDAGAddressAnalysisTest.cpp
 | ||||
|    TypeTraitsTest.cpp | ||||
|    TargetOptionsTest.cpp | ||||
|    ) | ||||
| Index: llvm-toolchain-11-11.1.0/llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp
 | ||||
| ===================================================================
 | ||||
| --- /dev/null
 | ||||
| +++ llvm-toolchain-11-11.1.0/llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp
 | ||||
| @@ -0,0 +1,337 @@
 | ||||
| +//===- llvm/unittest/CodeGen/SelectionDAGAddressAnalysisTest.cpp  ---------===//
 | ||||
| +//
 | ||||
| +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 | ||||
| +// See https://llvm.org/LICENSE.txt for license information.
 | ||||
| +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 | ||||
| +//
 | ||||
| +//===----------------------------------------------------------------------===//
 | ||||
| +
 | ||||
| +#include "llvm/CodeGen/SelectionDAGAddressAnalysis.h"
 | ||||
| +#include "llvm/Analysis/MemoryLocation.h"
 | ||||
| +#include "llvm/Analysis/OptimizationRemarkEmitter.h"
 | ||||
| +#include "llvm/AsmParser/Parser.h"
 | ||||
| +#include "llvm/CodeGen/MachineModuleInfo.h"
 | ||||
| +#include "llvm/CodeGen/SelectionDAG.h"
 | ||||
| +#include "llvm/CodeGen/TargetLowering.h"
 | ||||
| +#include "llvm/Support/SourceMgr.h"
 | ||||
| +#include "llvm/Support/TargetRegistry.h"
 | ||||
| +#include "llvm/Support/TargetSelect.h"
 | ||||
| +#include "llvm/Target/TargetMachine.h"
 | ||||
| +#include "gtest/gtest.h"
 | ||||
| +
 | ||||
| +namespace llvm {
 | ||||
| +
 | ||||
| +class SelectionDAGAddressAnalysisTest : public testing::Test {
 | ||||
| +protected:
 | ||||
| +  static void SetUpTestCase() {
 | ||||
| +    InitializeAllTargets();
 | ||||
| +    InitializeAllTargetMCs();
 | ||||
| +  }
 | ||||
| +
 | ||||
| +  void SetUp() override {
 | ||||
| +    StringRef Assembly = "@g = global i32 0\n"
 | ||||
| +                         "define i32 @f() {\n"
 | ||||
| +                         "  %1 = load i32, i32* @g\n"
 | ||||
| +                         "  ret i32 %1\n"
 | ||||
| +                         "}";
 | ||||
| +
 | ||||
| +    Triple TargetTriple("aarch64--");
 | ||||
| +    std::string Error;
 | ||||
| +    const Target *T = TargetRegistry::lookupTarget("", TargetTriple, Error);
 | ||||
| +    // FIXME: These tests do not depend on AArch64 specifically, but we have to
 | ||||
| +    // initialize a target. A skeleton Target for unittests would allow us to
 | ||||
| +    // always run these tests.
 | ||||
| +    if (!T)
 | ||||
| +      return;
 | ||||
| +
 | ||||
| +    TargetOptions Options;
 | ||||
| +    TM = std::unique_ptr<LLVMTargetMachine>(static_cast<LLVMTargetMachine *>(
 | ||||
| +        T->createTargetMachine("AArch64", "", "+sve", Options, None, None,
 | ||||
| +                               CodeGenOpt::Aggressive)));
 | ||||
| +    if (!TM)
 | ||||
| +      return;
 | ||||
| +
 | ||||
| +    SMDiagnostic SMError;
 | ||||
| +    M = parseAssemblyString(Assembly, SMError, Context);
 | ||||
| +    if (!M)
 | ||||
| +      report_fatal_error(SMError.getMessage());
 | ||||
| +    M->setDataLayout(TM->createDataLayout());
 | ||||
| +
 | ||||
| +    F = M->getFunction("f");
 | ||||
| +    if (!F)
 | ||||
| +      report_fatal_error("F?");
 | ||||
| +    G = M->getGlobalVariable("g");
 | ||||
| +    if (!G)
 | ||||
| +      report_fatal_error("G?");
 | ||||
| +
 | ||||
| +    MachineModuleInfo MMI(TM.get());
 | ||||
| +
 | ||||
| +    MF = std::make_unique<MachineFunction>(*F, *TM, *TM->getSubtargetImpl(*F),
 | ||||
| +                                           0, MMI);
 | ||||
| +
 | ||||
| +    DAG = std::make_unique<SelectionDAG>(*TM, CodeGenOpt::None);
 | ||||
| +    if (!DAG)
 | ||||
| +      report_fatal_error("DAG?");
 | ||||
| +    OptimizationRemarkEmitter ORE(F);
 | ||||
| +    DAG->init(*MF, ORE, nullptr, nullptr, nullptr, nullptr, nullptr);
 | ||||
| +  }
 | ||||
| +
 | ||||
| +  TargetLoweringBase::LegalizeTypeAction getTypeAction(EVT VT) {
 | ||||
| +    return DAG->getTargetLoweringInfo().getTypeAction(Context, VT);
 | ||||
| +  }
 | ||||
| +
 | ||||
| +  EVT getTypeToTransformTo(EVT VT) {
 | ||||
| +    return DAG->getTargetLoweringInfo().getTypeToTransformTo(Context, VT);
 | ||||
| +  }
 | ||||
| +
 | ||||
| +  LLVMContext Context;
 | ||||
| +  std::unique_ptr<LLVMTargetMachine> TM;
 | ||||
| +  std::unique_ptr<Module> M;
 | ||||
| +  Function *F;
 | ||||
| +  GlobalVariable *G;
 | ||||
| +  std::unique_ptr<MachineFunction> MF;
 | ||||
| +  std::unique_ptr<SelectionDAG> DAG;
 | ||||
| +};
 | ||||
| +
 | ||||
| +TEST_F(SelectionDAGAddressAnalysisTest, sameFrameObject) {
 | ||||
| +  if (!TM)
 | ||||
| +    return;
 | ||||
| +  SDLoc Loc;
 | ||||
| +  auto Int8VT = EVT::getIntegerVT(Context, 8);
 | ||||
| +  auto VecVT = EVT::getVectorVT(Context, Int8VT, 4);
 | ||||
| +  SDValue FIPtr = DAG->CreateStackTemporary(VecVT);
 | ||||
| +  int FI = cast<FrameIndexSDNode>(FIPtr.getNode())->getIndex();
 | ||||
| +  MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(*MF, FI);
 | ||||
| +  TypeSize Offset = TypeSize::Fixed(0);
 | ||||
| +  SDValue Value = DAG->getConstant(0, Loc, VecVT);
 | ||||
| +  SDValue Index = DAG->getMemBasePlusOffset(FIPtr, Offset, Loc);
 | ||||
| +  SDValue Store = DAG->getStore(DAG->getEntryNode(), Loc, Value, Index,
 | ||||
| +                                PtrInfo.getWithOffset(Offset));
 | ||||
| +  Optional<int64_t> NumBytes = MemoryLocation::getSizeOrUnknown(
 | ||||
| +      cast<StoreSDNode>(Store)->getMemoryVT().getStoreSize());
 | ||||
| +
 | ||||
| +  bool IsAlias;
 | ||||
| +  bool IsValid = BaseIndexOffset::computeAliasing(
 | ||||
| +      Store.getNode(), NumBytes, Store.getNode(), NumBytes, *DAG, IsAlias);
 | ||||
| +
 | ||||
| +  EXPECT_TRUE(IsValid);
 | ||||
| +  EXPECT_TRUE(IsAlias);
 | ||||
| +}
 | ||||
| +
 | ||||
| +TEST_F(SelectionDAGAddressAnalysisTest, noAliasingFrameObjects) {
 | ||||
| +  if (!TM)
 | ||||
| +    return;
 | ||||
| +  SDLoc Loc;
 | ||||
| +  auto Int8VT = EVT::getIntegerVT(Context, 8);
 | ||||
| +  // <4 x i8>
 | ||||
| +  auto VecVT = EVT::getVectorVT(Context, Int8VT, 4);
 | ||||
| +  // <2 x i8>
 | ||||
| +  auto SubVecVT = EVT::getVectorVT(Context, Int8VT, 2);
 | ||||
| +  SDValue FIPtr = DAG->CreateStackTemporary(VecVT);
 | ||||
| +  int FI = cast<FrameIndexSDNode>(FIPtr.getNode())->getIndex();
 | ||||
| +  MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(*MF, FI);
 | ||||
| +  SDValue Value = DAG->getConstant(0, Loc, SubVecVT);
 | ||||
| +  TypeSize Offset0 = TypeSize::Fixed(0);
 | ||||
| +  TypeSize Offset1 = SubVecVT.getStoreSize();
 | ||||
| +  SDValue Index0 = DAG->getMemBasePlusOffset(FIPtr, Offset0, Loc);
 | ||||
| +  SDValue Index1 = DAG->getMemBasePlusOffset(FIPtr, Offset1, Loc);
 | ||||
| +  SDValue Store0 = DAG->getStore(DAG->getEntryNode(), Loc, Value, Index0,
 | ||||
| +                                 PtrInfo.getWithOffset(Offset0));
 | ||||
| +  SDValue Store1 = DAG->getStore(DAG->getEntryNode(), Loc, Value, Index1,
 | ||||
| +                                 PtrInfo.getWithOffset(Offset1));
 | ||||
| +  Optional<int64_t> NumBytes0 = MemoryLocation::getSizeOrUnknown(
 | ||||
| +      cast<StoreSDNode>(Store0)->getMemoryVT().getStoreSize());
 | ||||
| +  Optional<int64_t> NumBytes1 = MemoryLocation::getSizeOrUnknown(
 | ||||
| +      cast<StoreSDNode>(Store1)->getMemoryVT().getStoreSize());
 | ||||
| +
 | ||||
| +  bool IsAlias;
 | ||||
| +  bool IsValid = BaseIndexOffset::computeAliasing(
 | ||||
| +      Store0.getNode(), NumBytes0, Store1.getNode(), NumBytes1, *DAG, IsAlias);
 | ||||
| +
 | ||||
| +  EXPECT_TRUE(IsValid);
 | ||||
| +  EXPECT_FALSE(IsAlias);
 | ||||
| +}
 | ||||
| +
 | ||||
| +TEST_F(SelectionDAGAddressAnalysisTest, unknownSizeFrameObjects) {
 | ||||
| +  if (!TM)
 | ||||
| +    return;
 | ||||
| +  SDLoc Loc;
 | ||||
| +  auto Int8VT = EVT::getIntegerVT(Context, 8);
 | ||||
| +  // <vscale x 4 x i8>
 | ||||
| +  auto VecVT = EVT::getVectorVT(Context, Int8VT, 4, true);
 | ||||
| +  // <vscale x 2 x i8>
 | ||||
| +  auto SubVecVT = EVT::getVectorVT(Context, Int8VT, 2, true);
 | ||||
| +  SDValue FIPtr = DAG->CreateStackTemporary(VecVT);
 | ||||
| +  int FI = cast<FrameIndexSDNode>(FIPtr.getNode())->getIndex();
 | ||||
| +  MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(*MF, FI);
 | ||||
| +  SDValue Value = DAG->getConstant(0, Loc, SubVecVT);
 | ||||
| +  TypeSize Offset0 = TypeSize::Fixed(0);
 | ||||
| +  TypeSize Offset1 = SubVecVT.getStoreSize();
 | ||||
| +  SDValue Index0 = DAG->getMemBasePlusOffset(FIPtr, Offset0, Loc);
 | ||||
| +  SDValue Index1 = DAG->getMemBasePlusOffset(FIPtr, Offset1, Loc);
 | ||||
| +  SDValue Store0 = DAG->getStore(DAG->getEntryNode(), Loc, Value, Index0,
 | ||||
| +                                 PtrInfo.getWithOffset(Offset0));
 | ||||
| +  SDValue Store1 = DAG->getStore(DAG->getEntryNode(), Loc, Value, Index1,
 | ||||
| +                                 PtrInfo.getWithOffset(Offset1));
 | ||||
| +  Optional<int64_t> NumBytes0 = MemoryLocation::getSizeOrUnknown(
 | ||||
| +      cast<StoreSDNode>(Store0)->getMemoryVT().getStoreSize());
 | ||||
| +  Optional<int64_t> NumBytes1 = MemoryLocation::getSizeOrUnknown(
 | ||||
| +      cast<StoreSDNode>(Store1)->getMemoryVT().getStoreSize());
 | ||||
| +
 | ||||
| +  bool IsAlias;
 | ||||
| +  bool IsValid = BaseIndexOffset::computeAliasing(
 | ||||
| +      Store0.getNode(), NumBytes0, Store1.getNode(), NumBytes1, *DAG, IsAlias);
 | ||||
| +
 | ||||
| +  EXPECT_FALSE(IsValid);
 | ||||
| +}
 | ||||
| +
 | ||||
| +TEST_F(SelectionDAGAddressAnalysisTest, globalWithFrameObject) {
 | ||||
| +  if (!TM)
 | ||||
| +    return;
 | ||||
| +  SDLoc Loc;
 | ||||
| +  auto Int8VT = EVT::getIntegerVT(Context, 8);
 | ||||
| +  // <vscale x 4 x i8>
 | ||||
| +  auto VecVT = EVT::getVectorVT(Context, Int8VT, 4, true);
 | ||||
| +  SDValue FIPtr = DAG->CreateStackTemporary(VecVT);
 | ||||
| +  int FI = cast<FrameIndexSDNode>(FIPtr.getNode())->getIndex();
 | ||||
| +  MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(*MF, FI);
 | ||||
| +  SDValue Value = DAG->getConstant(0, Loc, VecVT);
 | ||||
| +  TypeSize Offset = TypeSize::Fixed(0);
 | ||||
| +  SDValue Index = DAG->getMemBasePlusOffset(FIPtr, Offset, Loc);
 | ||||
| +  SDValue Store = DAG->getStore(DAG->getEntryNode(), Loc, Value, Index,
 | ||||
| +                                PtrInfo.getWithOffset(Offset));
 | ||||
| +  Optional<int64_t> NumBytes = MemoryLocation::getSizeOrUnknown(
 | ||||
| +      cast<StoreSDNode>(Store)->getMemoryVT().getStoreSize());
 | ||||
| +  EVT GTy = DAG->getTargetLoweringInfo().getValueType(DAG->getDataLayout(),
 | ||||
| +                                                      G->getType());
 | ||||
| +  SDValue GValue = DAG->getConstant(0, Loc, GTy);
 | ||||
| +  SDValue GAddr = DAG->getGlobalAddress(G, Loc, GTy);
 | ||||
| +  SDValue GStore = DAG->getStore(DAG->getEntryNode(), Loc, GValue, GAddr,
 | ||||
| +                                 MachinePointerInfo(G, 0));
 | ||||
| +  Optional<int64_t> GNumBytes = MemoryLocation::getSizeOrUnknown(
 | ||||
| +      cast<StoreSDNode>(GStore)->getMemoryVT().getStoreSize());
 | ||||
| +
 | ||||
| +  bool IsAlias;
 | ||||
| +  bool IsValid = BaseIndexOffset::computeAliasing(
 | ||||
| +      Store.getNode(), NumBytes, GStore.getNode(), GNumBytes, *DAG, IsAlias);
 | ||||
| +
 | ||||
| +  EXPECT_TRUE(IsValid);
 | ||||
| +  EXPECT_FALSE(IsAlias);
 | ||||
| +}
 | ||||
| +
 | ||||
| +TEST_F(SelectionDAGAddressAnalysisTest, fixedSizeFrameObjectsWithinDiff) {
 | ||||
| +  if (!TM)
 | ||||
| +    return;
 | ||||
| +  SDLoc Loc;
 | ||||
| +  auto Int8VT = EVT::getIntegerVT(Context, 8);
 | ||||
| +  // <vscale x 4 x i8>
 | ||||
| +  auto VecVT = EVT::getVectorVT(Context, Int8VT, 4, true);
 | ||||
| +  // <vscale x 2 x i8>
 | ||||
| +  auto SubVecVT = EVT::getVectorVT(Context, Int8VT, 2, true);
 | ||||
| +  // <2 x i8>
 | ||||
| +  auto SubFixedVecVT2xi8 = EVT::getVectorVT(Context, Int8VT, 2);
 | ||||
| +  SDValue FIPtr = DAG->CreateStackTemporary(VecVT);
 | ||||
| +  int FI = cast<FrameIndexSDNode>(FIPtr.getNode())->getIndex();
 | ||||
| +  MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(*MF, FI);
 | ||||
| +  SDValue Value0 = DAG->getConstant(0, Loc, SubFixedVecVT2xi8);
 | ||||
| +  SDValue Value1 = DAG->getConstant(0, Loc, SubVecVT);
 | ||||
| +  TypeSize Offset0 = TypeSize::Fixed(0);
 | ||||
| +  TypeSize Offset1 = SubFixedVecVT2xi8.getStoreSize();
 | ||||
| +  SDValue Index0 = DAG->getMemBasePlusOffset(FIPtr, Offset0, Loc);
 | ||||
| +  SDValue Index1 = DAG->getMemBasePlusOffset(FIPtr, Offset1, Loc);
 | ||||
| +  SDValue Store0 = DAG->getStore(DAG->getEntryNode(), Loc, Value0, Index0,
 | ||||
| +                                 PtrInfo.getWithOffset(Offset0));
 | ||||
| +  SDValue Store1 = DAG->getStore(DAG->getEntryNode(), Loc, Value1, Index1,
 | ||||
| +                                 PtrInfo.getWithOffset(Offset1));
 | ||||
| +  Optional<int64_t> NumBytes0 = MemoryLocation::getSizeOrUnknown(
 | ||||
| +      cast<StoreSDNode>(Store0)->getMemoryVT().getStoreSize());
 | ||||
| +  Optional<int64_t> NumBytes1 = MemoryLocation::getSizeOrUnknown(
 | ||||
| +      cast<StoreSDNode>(Store1)->getMemoryVT().getStoreSize());
 | ||||
| +
 | ||||
| +  bool IsAlias;
 | ||||
| +  bool IsValid = BaseIndexOffset::computeAliasing(
 | ||||
| +      Store0.getNode(), NumBytes0, Store1.getNode(), NumBytes1, *DAG, IsAlias);
 | ||||
| +  EXPECT_TRUE(IsValid);
 | ||||
| +  EXPECT_FALSE(IsAlias);
 | ||||
| +
 | ||||
| +  IsValid = BaseIndexOffset::computeAliasing(
 | ||||
| +      Store1.getNode(), NumBytes1, Store0.getNode(), NumBytes0, *DAG, IsAlias);
 | ||||
| +  EXPECT_TRUE(IsValid);
 | ||||
| +  EXPECT_FALSE(IsAlias);
 | ||||
| +}
 | ||||
| +
 | ||||
| +TEST_F(SelectionDAGAddressAnalysisTest, fixedSizeFrameObjectsOutOfDiff) {
 | ||||
| +  if (!TM)
 | ||||
| +    return;
 | ||||
| +  SDLoc Loc;
 | ||||
| +  auto Int8VT = EVT::getIntegerVT(Context, 8);
 | ||||
| +  // <vscale x 4 x i8>
 | ||||
| +  auto VecVT = EVT::getVectorVT(Context, Int8VT, 4, true);
 | ||||
| +  // <vscale x 2 x i8>
 | ||||
| +  auto SubVecVT = EVT::getVectorVT(Context, Int8VT, 2, true);
 | ||||
| +  // <2 x i8>
 | ||||
| +  auto SubFixedVecVT2xi8 = EVT::getVectorVT(Context, Int8VT, 2);
 | ||||
| +  // <4 x i8>
 | ||||
| +  auto SubFixedVecVT4xi8 = EVT::getVectorVT(Context, Int8VT, 4);
 | ||||
| +  SDValue FIPtr = DAG->CreateStackTemporary(VecVT);
 | ||||
| +  int FI = cast<FrameIndexSDNode>(FIPtr.getNode())->getIndex();
 | ||||
| +  MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(*MF, FI);
 | ||||
| +  SDValue Value0 = DAG->getConstant(0, Loc, SubFixedVecVT4xi8);
 | ||||
| +  SDValue Value1 = DAG->getConstant(0, Loc, SubVecVT);
 | ||||
| +  TypeSize Offset0 = TypeSize::Fixed(0);
 | ||||
| +  TypeSize Offset1 = SubFixedVecVT2xi8.getStoreSize();
 | ||||
| +  SDValue Index0 = DAG->getMemBasePlusOffset(FIPtr, Offset0, Loc);
 | ||||
| +  SDValue Index1 = DAG->getMemBasePlusOffset(FIPtr, Offset1, Loc);
 | ||||
| +  SDValue Store0 = DAG->getStore(DAG->getEntryNode(), Loc, Value0, Index0,
 | ||||
| +                                 PtrInfo.getWithOffset(Offset0));
 | ||||
| +  SDValue Store1 = DAG->getStore(DAG->getEntryNode(), Loc, Value1, Index1,
 | ||||
| +                                 PtrInfo.getWithOffset(Offset1));
 | ||||
| +  Optional<int64_t> NumBytes0 = MemoryLocation::getSizeOrUnknown(
 | ||||
| +      cast<StoreSDNode>(Store0)->getMemoryVT().getStoreSize());
 | ||||
| +  Optional<int64_t> NumBytes1 = MemoryLocation::getSizeOrUnknown(
 | ||||
| +      cast<StoreSDNode>(Store1)->getMemoryVT().getStoreSize());
 | ||||
| +
 | ||||
| +  bool IsAlias;
 | ||||
| +  bool IsValid = BaseIndexOffset::computeAliasing(
 | ||||
| +      Store0.getNode(), NumBytes0, Store1.getNode(), NumBytes1, *DAG, IsAlias);
 | ||||
| +  EXPECT_TRUE(IsValid);
 | ||||
| +  EXPECT_TRUE(IsAlias);
 | ||||
| +}
 | ||||
| +
 | ||||
| +TEST_F(SelectionDAGAddressAnalysisTest, twoFixedStackObjects) {
 | ||||
| +  if (!TM)
 | ||||
| +    return;
 | ||||
| +  SDLoc Loc;
 | ||||
| +  auto Int8VT = EVT::getIntegerVT(Context, 8);
 | ||||
| +  // <vscale x 2 x i8>
 | ||||
| +  auto VecVT = EVT::getVectorVT(Context, Int8VT, 2, true);
 | ||||
| +  // <2 x i8>
 | ||||
| +  auto FixedVecVT = EVT::getVectorVT(Context, Int8VT, 2);
 | ||||
| +  SDValue FIPtr0 = DAG->CreateStackTemporary(FixedVecVT);
 | ||||
| +  SDValue FIPtr1 = DAG->CreateStackTemporary(VecVT);
 | ||||
| +  int FI0 = cast<FrameIndexSDNode>(FIPtr0.getNode())->getIndex();
 | ||||
| +  int FI1 = cast<FrameIndexSDNode>(FIPtr1.getNode())->getIndex();
 | ||||
| +  MachinePointerInfo PtrInfo0 = MachinePointerInfo::getFixedStack(*MF, FI0);
 | ||||
| +  MachinePointerInfo PtrInfo1 = MachinePointerInfo::getFixedStack(*MF, FI1);
 | ||||
| +  SDValue Value0 = DAG->getConstant(0, Loc, FixedVecVT);
 | ||||
| +  SDValue Value1 = DAG->getConstant(0, Loc, VecVT);
 | ||||
| +  TypeSize Offset0 = TypeSize::Fixed(0);
 | ||||
| +  SDValue Index0 = DAG->getMemBasePlusOffset(FIPtr0, Offset0, Loc);
 | ||||
| +  SDValue Index1 = DAG->getMemBasePlusOffset(FIPtr1, Offset0, Loc);
 | ||||
| +  SDValue Store0 = DAG->getStore(DAG->getEntryNode(), Loc, Value0, Index0,
 | ||||
| +                                 PtrInfo0.getWithOffset(Offset0));
 | ||||
| +  SDValue Store1 = DAG->getStore(DAG->getEntryNode(), Loc, Value1, Index1,
 | ||||
| +                                 PtrInfo1.getWithOffset(Offset0));
 | ||||
| +  Optional<int64_t> NumBytes0 = MemoryLocation::getSizeOrUnknown(
 | ||||
| +      cast<StoreSDNode>(Store0)->getMemoryVT().getStoreSize());
 | ||||
| +  Optional<int64_t> NumBytes1 = MemoryLocation::getSizeOrUnknown(
 | ||||
| +      cast<StoreSDNode>(Store1)->getMemoryVT().getStoreSize());
 | ||||
| +
 | ||||
| +  bool IsAlias;
 | ||||
| +  bool IsValid = BaseIndexOffset::computeAliasing(
 | ||||
| +      Store0.getNode(), NumBytes0, Store1.getNode(), NumBytes1, *DAG, IsAlias);
 | ||||
| +  EXPECT_TRUE(IsValid);
 | ||||
| +  EXPECT_FALSE(IsAlias);
 | ||||
| +}
 | ||||
| +
 | ||||
| +} // end namespace llvm
 | ||||
							
								
								
									
										187
									
								
								debian/patches/revert-abi-change-clang.diff
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										187
									
								
								debian/patches/revert-abi-change-clang.diff
									
									
									
									
										vendored
									
									
								
							| @ -1,187 +0,0 @@ | ||||
| commit 9bbcb554cdbf1a7b85e9a72169e4037cf4736a10 | ||||
| Author: Marco Antognini <marco.antognini@arm.com> | ||||
| Date:   Thu Oct 29 10:30:11 2020 +0000 | ||||
| 
 | ||||
|     Address ABI issues introduced with CXCursor_CXXAddrspaceCastExpr | ||||
|      | ||||
|     Revert values in CXCursorKind as they were before | ||||
|     CXCursor_CXXAddrspaceCastExpr was introduced in a6a237f2046a ([OpenCL] | ||||
|     Added addrspace_cast operator in C++ mode., 2020-05-18). | ||||
|      | ||||
|     Insert CXCursor_CXXAddrspaceCastExpr after the last expression in | ||||
|     CXCursorKind using the next available value. | ||||
|      | ||||
|     Reviewed By: akyrtzi, svenvh | ||||
|      | ||||
|     Differential Revision: https://reviews.llvm.org/D90385 | ||||
|      | ||||
|     (cherry picked from commit bbdbd020d2c2f315ed1545b23c23ec6ff1abc022) | ||||
| 
 | ||||
| Index: llvm-toolchain-11_11.1.0/clang/include/clang-c/Index.h
 | ||||
| ===================================================================
 | ||||
| --- llvm-toolchain-11_11.1.0.orig/clang/include/clang-c/Index.h
 | ||||
| +++ llvm-toolchain-11_11.1.0/clang/include/clang-c/Index.h
 | ||||
| @@ -33,7 +33,7 @@
 | ||||
|   * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. | ||||
|   */ | ||||
|  #define CINDEX_VERSION_MAJOR 0 | ||||
| -#define CINDEX_VERSION_MINOR 61
 | ||||
| +#define CINDEX_VERSION_MINOR 60
 | ||||
|   | ||||
|  #define CINDEX_VERSION_ENCODE(major, minor) (((major)*10000) + ((minor)*1)) | ||||
|   | ||||
| @@ -2052,58 +2052,62 @@ enum CXCursorKind {
 | ||||
|     */ | ||||
|    CXCursor_CXXFunctionalCastExpr = 128, | ||||
|   | ||||
| +  /** OpenCL's addrspace_cast<> expression.
 | ||||
| +   */
 | ||||
| +  CXCursor_CXXAddrspaceCastExpr = 129,
 | ||||
| +
 | ||||
|    /** A C++ typeid expression (C++ [expr.typeid]). | ||||
|     */ | ||||
| -  CXCursor_CXXTypeidExpr = 129,
 | ||||
| +  CXCursor_CXXTypeidExpr = 130,
 | ||||
|   | ||||
|    /** [C++ 2.13.5] C++ Boolean Literal. | ||||
|     */ | ||||
| -  CXCursor_CXXBoolLiteralExpr = 130,
 | ||||
| +  CXCursor_CXXBoolLiteralExpr = 131,
 | ||||
|   | ||||
|    /** [C++0x 2.14.7] C++ Pointer Literal. | ||||
|     */ | ||||
| -  CXCursor_CXXNullPtrLiteralExpr = 131,
 | ||||
| +  CXCursor_CXXNullPtrLiteralExpr = 132,
 | ||||
|   | ||||
|    /** Represents the "this" expression in C++ | ||||
|     */ | ||||
| -  CXCursor_CXXThisExpr = 132,
 | ||||
| +  CXCursor_CXXThisExpr = 133,
 | ||||
|   | ||||
|    /** [C++ 15] C++ Throw Expression. | ||||
|     * | ||||
|     * This handles 'throw' and 'throw' assignment-expression. When | ||||
|     * assignment-expression isn't present, Op will be null. | ||||
|     */ | ||||
| -  CXCursor_CXXThrowExpr = 133,
 | ||||
| +  CXCursor_CXXThrowExpr = 134,
 | ||||
|   | ||||
|    /** A new expression for memory allocation and constructor calls, e.g: | ||||
|     * "new CXXNewExpr(foo)". | ||||
|     */ | ||||
| -  CXCursor_CXXNewExpr = 134,
 | ||||
| +  CXCursor_CXXNewExpr = 135,
 | ||||
|   | ||||
|    /** A delete expression for memory deallocation and destructor calls, | ||||
|     * e.g. "delete[] pArray". | ||||
|     */ | ||||
| -  CXCursor_CXXDeleteExpr = 135,
 | ||||
| +  CXCursor_CXXDeleteExpr = 136,
 | ||||
|   | ||||
|    /** A unary expression. (noexcept, sizeof, or other traits) | ||||
|     */ | ||||
| -  CXCursor_UnaryExpr = 136,
 | ||||
| +  CXCursor_UnaryExpr = 137,
 | ||||
|   | ||||
|    /** An Objective-C string literal i.e. @"foo". | ||||
|     */ | ||||
| -  CXCursor_ObjCStringLiteral = 137,
 | ||||
| +  CXCursor_ObjCStringLiteral = 138,
 | ||||
|   | ||||
|    /** An Objective-C \@encode expression. | ||||
|     */ | ||||
| -  CXCursor_ObjCEncodeExpr = 138,
 | ||||
| +  CXCursor_ObjCEncodeExpr = 139,
 | ||||
|   | ||||
|    /** An Objective-C \@selector expression. | ||||
|     */ | ||||
| -  CXCursor_ObjCSelectorExpr = 139,
 | ||||
| +  CXCursor_ObjCSelectorExpr = 140,
 | ||||
|   | ||||
|    /** An Objective-C \@protocol expression. | ||||
|     */ | ||||
| -  CXCursor_ObjCProtocolExpr = 140,
 | ||||
| +  CXCursor_ObjCProtocolExpr = 141,
 | ||||
|   | ||||
|    /** An Objective-C "bridged" cast expression, which casts between | ||||
|     * Objective-C pointers and C pointers, transferring ownership in the process. | ||||
| @@ -2112,7 +2116,7 @@ enum CXCursorKind {
 | ||||
|     *   NSString *str = (__bridge_transfer NSString *)CFCreateString(); | ||||
|     * \endcode | ||||
|     */ | ||||
| -  CXCursor_ObjCBridgedCastExpr = 141,
 | ||||
| +  CXCursor_ObjCBridgedCastExpr = 142,
 | ||||
|   | ||||
|    /** Represents a C++0x pack expansion that produces a sequence of | ||||
|     * expressions. | ||||
| @@ -2127,7 +2131,7 @@ enum CXCursorKind {
 | ||||
|     * } | ||||
|     * \endcode | ||||
|     */ | ||||
| -  CXCursor_PackExpansionExpr = 142,
 | ||||
| +  CXCursor_PackExpansionExpr = 143,
 | ||||
|   | ||||
|    /** Represents an expression that computes the length of a parameter | ||||
|     * pack. | ||||
| @@ -2139,7 +2143,7 @@ enum CXCursorKind {
 | ||||
|     * }; | ||||
|     * \endcode | ||||
|     */ | ||||
| -  CXCursor_SizeOfPackExpr = 143,
 | ||||
| +  CXCursor_SizeOfPackExpr = 144,
 | ||||
|   | ||||
|    /* Represents a C++ lambda expression that produces a local function | ||||
|     * object. | ||||
| @@ -2153,43 +2157,39 @@ enum CXCursorKind {
 | ||||
|     * } | ||||
|     * \endcode | ||||
|     */ | ||||
| -  CXCursor_LambdaExpr = 144,
 | ||||
| +  CXCursor_LambdaExpr = 145,
 | ||||
|   | ||||
|    /** Objective-c Boolean Literal. | ||||
|     */ | ||||
| -  CXCursor_ObjCBoolLiteralExpr = 145,
 | ||||
| +  CXCursor_ObjCBoolLiteralExpr = 146,
 | ||||
|   | ||||
|    /** Represents the "self" expression in an Objective-C method. | ||||
|     */ | ||||
| -  CXCursor_ObjCSelfExpr = 146,
 | ||||
| +  CXCursor_ObjCSelfExpr = 147,
 | ||||
|   | ||||
|    /** OpenMP 5.0 [2.1.5, Array Section]. | ||||
|     */ | ||||
| -  CXCursor_OMPArraySectionExpr = 147,
 | ||||
| +  CXCursor_OMPArraySectionExpr = 148,
 | ||||
|   | ||||
|    /** Represents an @available(...) check. | ||||
|     */ | ||||
| -  CXCursor_ObjCAvailabilityCheckExpr = 148,
 | ||||
| +  CXCursor_ObjCAvailabilityCheckExpr = 149,
 | ||||
|   | ||||
|    /** | ||||
|     * Fixed point literal | ||||
|     */ | ||||
| -  CXCursor_FixedPointLiteral = 149,
 | ||||
| +  CXCursor_FixedPointLiteral = 150,
 | ||||
|   | ||||
|    /** OpenMP 5.0 [2.1.4, Array Shaping]. | ||||
|     */ | ||||
| -  CXCursor_OMPArrayShapingExpr = 150,
 | ||||
| +  CXCursor_OMPArrayShapingExpr = 151,
 | ||||
|   | ||||
|    /** | ||||
|     * OpenMP 5.0 [2.1.6 Iterators] | ||||
|     */ | ||||
| -  CXCursor_OMPIteratorExpr = 151,
 | ||||
| -
 | ||||
| -  /** OpenCL's addrspace_cast<> expression.
 | ||||
| -   */
 | ||||
| -  CXCursor_CXXAddrspaceCastExpr = 152,
 | ||||
| +  CXCursor_OMPIteratorExpr = 152,
 | ||||
|   | ||||
| -  CXCursor_LastExpr = CXCursor_CXXAddrspaceCastExpr,
 | ||||
| +  CXCursor_LastExpr = CXCursor_OMPIteratorExpr,
 | ||||
|   | ||||
|    /* Statements */ | ||||
|    CXCursor_FirstStmt = 200, | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Sylvestre Ledru
						Sylvestre Ledru