import llvm-11.0.1-2.module+el8.4.0+12666+0fb5828f

This commit is contained in:
CentOS Sources 2021-11-02 06:36:32 -04:00 committed by Stepan Oksanichenko
parent 66675f4b21
commit 2ae2453e20
6 changed files with 440 additions and 68 deletions

3
.gitignore vendored
View File

@ -1,2 +1 @@
SOURCES/hans-gpg-key.asc SOURCES/llvm-11.0.1.src.tar.xz
SOURCES/llvm-11.0.0.src.tar.xz

View File

@ -1,2 +1 @@
32fa4b0193960f05064f2ab31b5a89c7cf48a0b9 SOURCES/hans-gpg-key.asc 1a911295260d4e41116b72788eb602702b4bb252 SOURCES/llvm-11.0.1.src.tar.xz
5723ae20d1e6e9ccfda208cb9a8cf2f87c3a6107 SOURCES/llvm-11.0.0.src.tar.xz

View File

@ -0,0 +1,427 @@
From 153232761304a2746ea9a11d9da3aa5e5a7c26d0 Mon Sep 17 00:00:00 2001
From: Hsiangkai Wang <kai.wang@sifive.com>
Date: Fri, 20 Nov 2020 08:52:03 +0800
Subject: [PATCH] [SelectionDAG] Avoid aliasing analysis if the object size is
unknown.
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.
Differential Revision: https://reviews.llvm.org/D91833
---
.../SelectionDAGAddressAnalysis.cpp | 31 +-
llvm/unittests/CodeGen/CMakeLists.txt | 1 +
.../SelectionDAGAddressAnalysisTest.cpp | 337 ++++++++++++++++++
3 files changed, 359 insertions(+), 10 deletions(-)
create mode 100644 llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
index 3a53ab9717a4..20c7d771bfb6 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
+++ b/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(const SDNode *Op0,
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
diff --git a/llvm/unittests/CodeGen/CMakeLists.txt b/llvm/unittests/CodeGen/CMakeLists.txt
index fa3cb1fa7669..2fe525f1b413 100644
--- a/llvm/unittests/CodeGen/CMakeLists.txt
+++ b/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
)
diff --git a/llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp b/llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp
new file mode 100644
index 000000000000..c00b6c518e70
--- /dev/null
+++ b/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
--
2.26.2

Binary file not shown.

Binary file not shown.

View File

@ -17,7 +17,7 @@
%global llvm_srcdir llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src %global llvm_srcdir llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src
%global maj_ver 11 %global maj_ver 11
%global min_ver 0 %global min_ver 0
%global patch_ver 0 %global patch_ver 1
%if %{with compat_build} %if %{with compat_build}
%global pkg_name llvm%{maj_ver}.%{min_ver} %global pkg_name llvm%{maj_ver}.%{min_ver}
@ -54,7 +54,6 @@ License: NCSA
URL: http://llvm.org URL: http://llvm.org
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz.sig Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz.sig
Source2: https://prereleases.llvm.org/%{version}/hans-gpg-key.asc
%if %{without compat_build} %if %{without compat_build}
Source3: run-lit-tests Source3: run-lit-tests
Source4: lit.fedora.cfg.py Source4: lit.fedora.cfg.py
@ -64,6 +63,7 @@ Source4: lit.fedora.cfg.py
Patch1: 0001-SystemZ-Use-LA-instead-of-AGR-in-eliminateFrameIndex.patch Patch1: 0001-SystemZ-Use-LA-instead-of-AGR-in-eliminateFrameIndex.patch
Patch2: 0001-CMake-Split-static-library-exports-into-their-own-ex.patch Patch2: 0001-CMake-Split-static-library-exports-into-their-own-ex.patch
Patch3: 0001-CMake-Split-test-binary-exports-into-their-own-expor.patch Patch3: 0001-CMake-Split-test-binary-exports-into-their-own-expor.patch
Patch4: 0001-SelectionDAG-Avoid-aliasing-analysis-if-the-object-s.patch
# RHEL-specific patches. # RHEL-specific patches.
Patch101: 0001-Deactivate-markdown-doc.patch Patch101: 0001-Deactivate-markdown-doc.patch
@ -164,14 +164,6 @@ Static libraries for the LLVM compiler infrastructure.
Summary: LLVM regression tests Summary: LLVM regression tests
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: python3-lit
# The regression tests need gold.
Requires: binutils
# This is for llvm-config
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
# Bugpoint tests require gcc
Requires: gcc
Requires: findutils
Provides: llvm-test(major) = %{maj_ver} Provides: llvm-test(major) = %{maj_ver}
@ -335,50 +327,6 @@ cp -R utils/unittest %{install_srcdir}/utils/
cp utils/update_cc_test_checks.py %{install_srcdir}/utils/ cp utils/update_cc_test_checks.py %{install_srcdir}/utils/
cp -R utils/UpdateTestChecks %{install_srcdir}/utils/ cp -R utils/UpdateTestChecks %{install_srcdir}/utils/
# One of the lit tests references this file
install -d %{install_srcdir}/docs/CommandGuide/
install -m 0644 docs/CommandGuide/dsymutil.rst %{install_srcdir}/docs/CommandGuide/
# Generate lit config files. Strip off the last lines that initiates the
# test run, so we can customize the configuration.
head -n -2 _build/test/lit.site.cfg.py >> %{lit_cfg}
head -n -2 _build/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg}
# Install custom fedora config file
cp %{SOURCE4} %{buildroot}%{lit_fedora_cfg}
# Patch lit config files to load custom fedora config:
for f in %{lit_cfg} %{lit_unit_cfg}; do
echo "lit_config.load_config(config, '%{lit_fedora_cfg}')" >> $f
done
install -d %{buildroot}%{_libexecdir}/tests/llvm
install -m 0755 %{SOURCE3} %{buildroot}%{_libexecdir}/tests/llvm
# Install lit tests. We need to put these in a tarball otherwise rpm will complain
# about some of the test inputs having the wrong object file format.
install -d %{buildroot}%{_datadir}/llvm/
# The various tar options are there to make sur the archive is the same on 32 and 64 bit arch, i.e.
# the archive creation is reproducible. Move arch-specific content out of the tarball
mv %{lit_cfg} %{install_srcdir}/%{_arch}.site.cfg.py
mv %{lit_unit_cfg} %{install_srcdir}/%{_arch}.Unit.site.cfg.py
tar --sort=name --mtime='UTC 2020-01-01' -c test/ | gzip -n > %{install_srcdir}/test.tar.gz
# Install the unit test binaries
mkdir -p %{build_llvm_libdir}
cp -R _build/unittests %{build_llvm_libdir}/
rm -rf `find %{build_llvm_libdir} -iname 'cmake*'`
# Install libraries used for testing
install -m 0755 %{build_libdir}/BugpointPasses.so %{buildroot}%{_libdir}
install -m 0755 %{build_libdir}/LLVMHello.so %{buildroot}%{_libdir}
# Install test inputs for PDB tests
echo "%{_datadir}/llvm/src/unittests/DebugInfo/PDB" > %{build_llvm_libdir}/unittests/DebugInfo/PDB/llvm.srcdir.txt
mkdir -p %{buildroot}%{_datadir}/llvm/src/unittests/DebugInfo/PDB/
cp -R unittests/DebugInfo/PDB/Inputs %{buildroot}%{_datadir}/llvm/src/unittests/DebugInfo/PDB/
%if %{with gold} %if %{with gold}
# Add symlink to lto plugin in the binutils plugin directory. # Add symlink to lto plugin in the binutils plugin directory.
%{__mkdir_p} %{buildroot}%{_libdir}/bfd-plugins/ %{__mkdir_p} %{buildroot}%{_libdir}/bfd-plugins/
@ -531,22 +479,12 @@ fi
%files test %files test
%license LICENSE.TXT %license LICENSE.TXT
%{_libexecdir}/tests/llvm/
%{llvm_libdir}/unittests/
%{_datadir}/llvm/src/unittests
%{_datadir}/llvm/src/test.tar.gz
%{_datadir}/llvm/src/%{_arch}.site.cfg.py
%{_datadir}/llvm/src/%{_arch}.Unit.site.cfg.py
%{_datadir}/llvm/lit.fedora.cfg.py
%{_datadir}/llvm/src/docs/CommandGuide/dsymutil.rst
%{_bindir}/not %{_bindir}/not
%{_bindir}/count %{_bindir}/count
%{_bindir}/yaml-bench %{_bindir}/yaml-bench
%{_bindir}/lli-child-target %{_bindir}/lli-child-target
%{_bindir}/llvm-isel-fuzzer %{_bindir}/llvm-isel-fuzzer
%{_bindir}/llvm-opt-fuzzer %{_bindir}/llvm-opt-fuzzer
%{_libdir}/BugpointPasses.so
%{_libdir}/LLVMHello.so
%{_libdir}/cmake/llvm/LLVMTestExports.cmake %{_libdir}/cmake/llvm/LLVMTestExports.cmake
%files googletest %files googletest
@ -557,6 +495,15 @@ fi
%endif %endif
%changelog %changelog
* Sat Sep 04 2021 Tom Stellard <tstellar@redhat.com> - 11.0.1-2
- Backport bpftrace fix
* Wed Sep 01 2021 Tom Stellard <tstellar@redhat.com> - 11.0.1-1
- 11.0.1 Release
* Mon Jul 19 2021 Tom Stellard <tstellar@redhat.com> - 11.0.0-3
- Stop installing lit tests
* Thu Oct 29 2020 sguelton@redhat.com - 11.0.0-2 * Thu Oct 29 2020 sguelton@redhat.com - 11.0.0-2
- Remove obsolete patch - Remove obsolete patch