mirror of
https://codeberg.org/guix/guix.git
synced 2026-01-25 03:55:08 -06:00
gnu: Remove llvm-9.
* gnu/packages/llvm.scm (llvm-9): Delete variable. * gnu/packages/patches/llvm-9-fix-bitcast-miscompilation.patch, gnu/packages/patches/llvm-9-fix-lpad-miscompilation.patch, gnu/packages/patches/llvm-9-fix-scev-miscompilation.patch: Remove files. * gnu/local.mk (dist_patch_DATA): Unregister files. Change-Id: I25c2261dd648194cc4f764f92988617bfac64561
This commit is contained in:
parent
80a2e7236e
commit
809100f719
5 changed files with 0 additions and 437 deletions
|
|
@ -1837,9 +1837,6 @@ dist_patch_DATA = \
|
|||
%D%/packages/patches/llvm-3.x.1-fix-build-with-gcc.patch \
|
||||
%D%/packages/patches/llvm-8-fix-build-with-gcc-10.patch \
|
||||
%D%/packages/patches/llvm-8-missing-include.patch \
|
||||
%D%/packages/patches/llvm-9-fix-bitcast-miscompilation.patch \
|
||||
%D%/packages/patches/llvm-9-fix-lpad-miscompilation.patch \
|
||||
%D%/packages/patches/llvm-9-fix-scev-miscompilation.patch \
|
||||
%D%/packages/patches/llvm-10-missing-include.patch \
|
||||
%D%/packages/patches/llvm-13-gcc-14.patch \
|
||||
%D%/packages/patches/lm-sensors-hwmon-attrs.patch \
|
||||
|
|
|
|||
|
|
@ -1137,38 +1137,6 @@ Library.")
|
|||
(define-public clang-toolchain-10
|
||||
(make-clang-toolchain clang-10 libomp-10))
|
||||
|
||||
(define-public llvm-9
|
||||
(package
|
||||
(inherit llvm-10)
|
||||
(version "9.0.1")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri (llvm-uri "llvm" version))
|
||||
(sha256
|
||||
(base32
|
||||
"16hwp3qa54c3a3v7h8nlw0fh5criqh0hlr1skybyk0cz70gyx880"))
|
||||
(patches (search-patches
|
||||
"llvm-8-missing-include.patch"
|
||||
"llvm-9-fix-bitcast-miscompilation.patch"
|
||||
"llvm-9-fix-scev-miscompilation.patch"
|
||||
"llvm-9-fix-lpad-miscompilation.patch"))))
|
||||
(arguments
|
||||
(if (target-riscv64?)
|
||||
(substitute-keyword-arguments (package-arguments llvm-10)
|
||||
((#:phases phases)
|
||||
#~(modify-phases #$phases
|
||||
(add-after 'unpack 'patch-dsymutil-link
|
||||
(lambda _
|
||||
(substitute* "tools/dsymutil/CMakeLists.txt"
|
||||
(("endif\\(APPLE\\)")
|
||||
(string-append
|
||||
"endif(APPLE)\n\n"
|
||||
"if (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES \"riscv64\")\n"
|
||||
" target_link_libraries(dsymutil PRIVATE atomic)\n"
|
||||
"endif()"))))))))
|
||||
(package-arguments llvm-10)))))
|
||||
|
||||
(define-public llvm-8
|
||||
(package
|
||||
(inherit llvm-10)
|
||||
|
|
|
|||
|
|
@ -1,192 +0,0 @@
|
|||
From f8e146f3430de3a6cd904f3f3f7aa1bfaefee14c Mon Sep 17 00:00:00 2001
|
||||
From: Bjorn Pettersson <bjorn.a.pettersson@ericsson.com>
|
||||
Date: Thu, 28 Nov 2019 23:18:28 +0100
|
||||
Subject: [PATCH] [InstCombine] Fix big-endian miscompile of (bitcast
|
||||
(zext/trunc (bitcast)))
|
||||
|
||||
Summary:
|
||||
optimizeVectorResize is rewriting patterns like:
|
||||
%1 = bitcast vector %src to integer
|
||||
%2 = trunc/zext %1
|
||||
%dst = bitcast %2 to vector
|
||||
|
||||
Since bitcasting between integer an vector types gives
|
||||
different integer values depending on endianness, we need
|
||||
to take endianness into account. As it happens the old
|
||||
implementation only produced the correct result for little
|
||||
endian targets.
|
||||
|
||||
Fixes: https://bugs.llvm.org/show_bug.cgi?id=44178
|
||||
|
||||
Reviewers: spatel, lattner, lebedev.ri
|
||||
|
||||
Reviewed By: spatel, lebedev.ri
|
||||
|
||||
Subscribers: lebedev.ri, hiraditya, uabelho, llvm-commits
|
||||
|
||||
Tags: #llvm
|
||||
|
||||
Differential Revision: https://reviews.llvm.org/D70844
|
||||
|
||||
(cherry picked from commit a9d6b0e5444741d08ff1df7cf71d1559e7fefc1f)
|
||||
---
|
||||
.../InstCombine/InstCombineCasts.cpp | 79 +++++++++++++------
|
||||
llvm/test/Transforms/InstCombine/cast.ll | 6 +-
|
||||
2 files changed, 60 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
|
||||
index 2c9ba203fbf3..0af3de300e77 100644
|
||||
--- llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
|
||||
+++ llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "llvm/IR/DIBuilder.h"
|
||||
#include "llvm/IR/PatternMatch.h"
|
||||
#include "llvm/Support/KnownBits.h"
|
||||
+#include <numeric>
|
||||
using namespace llvm;
|
||||
using namespace PatternMatch;
|
||||
|
||||
@@ -1820,12 +1821,24 @@ Instruction *InstCombiner::visitPtrToInt(PtrToIntInst &CI) {
|
||||
}
|
||||
|
||||
/// This input value (which is known to have vector type) is being zero extended
|
||||
-/// or truncated to the specified vector type.
|
||||
+/// or truncated to the specified vector type. Since the zext/trunc is done
|
||||
+/// using an integer type, we have a (bitcast(cast(bitcast))) pattern,
|
||||
+/// endianness will impact which end of the vector that is extended or
|
||||
+/// truncated.
|
||||
+///
|
||||
+/// A vector is always stored with index 0 at the lowest address, which
|
||||
+/// corresponds to the most significant bits for a big endian stored integer and
|
||||
+/// the least significant bits for little endian. A trunc/zext of an integer
|
||||
+/// impacts the big end of the integer. Thus, we need to add/remove elements at
|
||||
+/// the front of the vector for big endian targets, and the back of the vector
|
||||
+/// for little endian targets.
|
||||
+///
|
||||
/// Try to replace it with a shuffle (and vector/vector bitcast) if possible.
|
||||
///
|
||||
/// The source and destination vector types may have different element types.
|
||||
-static Instruction *optimizeVectorResize(Value *InVal, VectorType *DestTy,
|
||||
- InstCombiner &IC) {
|
||||
+static Instruction *optimizeVectorResizeWithIntegerBitCasts(Value *InVal,
|
||||
+ VectorType *DestTy,
|
||||
+ InstCombiner &IC) {
|
||||
// We can only do this optimization if the output is a multiple of the input
|
||||
// element size, or the input is a multiple of the output element size.
|
||||
// Convert the input type to have the same element type as the output.
|
||||
@@ -1844,31 +1857,53 @@ static Instruction *optimizeVectorResize(Value *InVal, VectorType *DestTy,
|
||||
InVal = IC.Builder.CreateBitCast(InVal, SrcTy);
|
||||
}
|
||||
|
||||
+ bool IsBigEndian = IC.getDataLayout().isBigEndian();
|
||||
+ unsigned SrcElts = SrcTy->getNumElements();
|
||||
+ unsigned DestElts = DestTy->getNumElements();
|
||||
+
|
||||
+ assert(SrcElts != DestElts && "Element counts should be different.");
|
||||
+
|
||||
// Now that the element types match, get the shuffle mask and RHS of the
|
||||
// shuffle to use, which depends on whether we're increasing or decreasing the
|
||||
// size of the input.
|
||||
- SmallVector<uint32_t, 16> ShuffleMask;
|
||||
+ SmallVector<uint32_t, 16> ShuffleMaskStorage;
|
||||
+ ArrayRef<uint32_t> ShuffleMask;
|
||||
Value *V2;
|
||||
|
||||
- if (SrcTy->getNumElements() > DestTy->getNumElements()) {
|
||||
- // If we're shrinking the number of elements, just shuffle in the low
|
||||
- // elements from the input and use undef as the second shuffle input.
|
||||
- V2 = UndefValue::get(SrcTy);
|
||||
- for (unsigned i = 0, e = DestTy->getNumElements(); i != e; ++i)
|
||||
- ShuffleMask.push_back(i);
|
||||
+ // Produce an identify shuffle mask for the src vector.
|
||||
+ ShuffleMaskStorage.resize(SrcElts);
|
||||
+ std::iota(ShuffleMaskStorage.begin(), ShuffleMaskStorage.end(), 0);
|
||||
|
||||
+ if (SrcElts > DestElts) {
|
||||
+ // If we're shrinking the number of elements (rewriting an integer
|
||||
+ // truncate), just shuffle in the elements corresponding to the least
|
||||
+ // significant bits from the input and use undef as the second shuffle
|
||||
+ // input.
|
||||
+ V2 = UndefValue::get(SrcTy);
|
||||
+ // Make sure the shuffle mask selects the "least significant bits" by
|
||||
+ // keeping elements from back of the src vector for big endian, and from the
|
||||
+ // front for little endian.
|
||||
+ ShuffleMask = ShuffleMaskStorage;
|
||||
+ if (IsBigEndian)
|
||||
+ ShuffleMask = ShuffleMask.take_back(DestElts);
|
||||
+ else
|
||||
+ ShuffleMask = ShuffleMask.take_front(DestElts);
|
||||
} else {
|
||||
- // If we're increasing the number of elements, shuffle in all of the
|
||||
- // elements from InVal and fill the rest of the result elements with zeros
|
||||
- // from a constant zero.
|
||||
+ // If we're increasing the number of elements (rewriting an integer zext),
|
||||
+ // shuffle in all of the elements from InVal. Fill the rest of the result
|
||||
+ // elements with zeros from a constant zero.
|
||||
V2 = Constant::getNullValue(SrcTy);
|
||||
- unsigned SrcElts = SrcTy->getNumElements();
|
||||
- for (unsigned i = 0, e = SrcElts; i != e; ++i)
|
||||
- ShuffleMask.push_back(i);
|
||||
-
|
||||
- // The excess elements reference the first element of the zero input.
|
||||
- for (unsigned i = 0, e = DestTy->getNumElements()-SrcElts; i != e; ++i)
|
||||
- ShuffleMask.push_back(SrcElts);
|
||||
+ // Use first elt from V2 when indicating zero in the shuffle mask.
|
||||
+ uint32_t NullElt = SrcElts;
|
||||
+ // Extend with null values in the "most significant bits" by adding elements
|
||||
+ // in front of the src vector for big endian, and at the back for little
|
||||
+ // endian.
|
||||
+ unsigned DeltaElts = DestElts - SrcElts;
|
||||
+ if (IsBigEndian)
|
||||
+ ShuffleMaskStorage.insert(ShuffleMaskStorage.begin(), DeltaElts, NullElt);
|
||||
+ else
|
||||
+ ShuffleMaskStorage.append(DeltaElts, NullElt);
|
||||
+ ShuffleMask = ShuffleMaskStorage;
|
||||
}
|
||||
|
||||
return new ShuffleVectorInst(InVal, V2,
|
||||
@@ -2359,8 +2394,8 @@ Instruction *InstCombiner::visitBitCast(BitCastInst &CI) {
|
||||
CastInst *SrcCast = cast<CastInst>(Src);
|
||||
if (BitCastInst *BCIn = dyn_cast<BitCastInst>(SrcCast->getOperand(0)))
|
||||
if (isa<VectorType>(BCIn->getOperand(0)->getType()))
|
||||
- if (Instruction *I = optimizeVectorResize(BCIn->getOperand(0),
|
||||
- cast<VectorType>(DestTy), *this))
|
||||
+ if (Instruction *I = optimizeVectorResizeWithIntegerBitCasts(
|
||||
+ BCIn->getOperand(0), cast<VectorType>(DestTy), *this))
|
||||
return I;
|
||||
}
|
||||
|
||||
diff --git a/llvm/test/Transforms/InstCombine/cast.ll b/llvm/test/Transforms/InstCombine/cast.ll
|
||||
index b6d1eda0601d..3ce8de033422 100644
|
||||
--- llvm/test/Transforms/InstCombine/cast.ll
|
||||
+++ llvm/test/Transforms/InstCombine/cast.ll
|
||||
@@ -824,7 +824,7 @@ define i64 @test59(i8 %A, i8 %B) {
|
||||
|
||||
define <3 x i32> @test60(<4 x i32> %call4) {
|
||||
; CHECK-LABEL: @test60(
|
||||
-; CHECK-NEXT: [[P10:%.*]] = shufflevector <4 x i32> [[CALL4:%.*]], <4 x i32> undef, <3 x i32> <i32 0, i32 1, i32 2>
|
||||
+; CHECK-NEXT: [[P10:%.*]] = shufflevector <4 x i32> [[CALL4:%.*]], <4 x i32> undef, <3 x i32> <i32 1, i32 2, i32 3>
|
||||
; CHECK-NEXT: ret <3 x i32> [[P10]]
|
||||
;
|
||||
%p11 = bitcast <4 x i32> %call4 to i128
|
||||
@@ -836,7 +836,7 @@ define <3 x i32> @test60(<4 x i32> %call4) {
|
||||
|
||||
define <4 x i32> @test61(<3 x i32> %call4) {
|
||||
; CHECK-LABEL: @test61(
|
||||
-; CHECK-NEXT: [[P10:%.*]] = shufflevector <3 x i32> [[CALL4:%.*]], <3 x i32> <i32 0, i32 undef, i32 undef>, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
|
||||
+; CHECK-NEXT: [[P10:%.*]] = shufflevector <3 x i32> [[CALL4:%.*]], <3 x i32> <i32 0, i32 undef, i32 undef>, <4 x i32> <i32 3, i32 0, i32 1, i32 2>
|
||||
; CHECK-NEXT: ret <4 x i32> [[P10]]
|
||||
;
|
||||
%p11 = bitcast <3 x i32> %call4 to i96
|
||||
@@ -848,7 +848,7 @@ define <4 x i32> @test61(<3 x i32> %call4) {
|
||||
define <4 x i32> @test62(<3 x float> %call4) {
|
||||
; CHECK-LABEL: @test62(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = bitcast <3 x float> [[CALL4:%.*]] to <3 x i32>
|
||||
-; CHECK-NEXT: [[P10:%.*]] = shufflevector <3 x i32> [[TMP1]], <3 x i32> <i32 0, i32 undef, i32 undef>, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
|
||||
+; CHECK-NEXT: [[P10:%.*]] = shufflevector <3 x i32> [[TMP1]], <3 x i32> <i32 0, i32 undef, i32 undef>, <4 x i32> <i32 3, i32 0, i32 1, i32 2>
|
||||
; CHECK-NEXT: ret <4 x i32> [[P10]]
|
||||
;
|
||||
%p11 = bitcast <3 x float> %call4 to i96
|
||||
--
|
||||
2.26.2
|
||||
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
From 011fb5bf8b31316472fccb1a19c91912246df9b2 Mon Sep 17 00:00:00 2001
|
||||
From: Reid Kleckner <rnk@google.com>
|
||||
Date: Sat, 28 Mar 2020 11:03:14 -0700
|
||||
Subject: [PATCH] [CodeGen] Fix sinking local values in lpads with phis
|
||||
|
||||
There was already a test case for landingpads to handle this case, but I
|
||||
had forgotten to consider PHI instructions preceding the EH_LABEL in the
|
||||
landingpad.
|
||||
|
||||
PR45261
|
||||
---
|
||||
llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 17 +++++++++-
|
||||
llvm/test/CodeGen/X86/sink-local-value.ll | 36 ++++++++++++++++++++++
|
||||
2 files changed, 52 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
|
||||
index 5ac3606dc662..2638b1e8a05c 100644
|
||||
--- llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
|
||||
+++ llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
|
||||
@@ -225,6 +225,21 @@ static bool isRegUsedByPhiNodes(unsigned DefReg,
|
||||
return false;
|
||||
}
|
||||
|
||||
+static bool isTerminatingEHLabel(MachineBasicBlock *MBB, MachineInstr &MI) {
|
||||
+ // Ignore non-EH labels.
|
||||
+ if (!MI.isEHLabel())
|
||||
+ return false;
|
||||
+
|
||||
+ // Any EH label outside a landing pad must be for an invoke. Consider it a
|
||||
+ // terminator.
|
||||
+ if (!MBB->isEHPad())
|
||||
+ return true;
|
||||
+
|
||||
+ // If this is a landingpad, the first non-phi instruction will be an EH_LABEL.
|
||||
+ // Don't consider that label to be a terminator.
|
||||
+ return MI.getIterator() != MBB->getFirstNonPHI();
|
||||
+}
|
||||
+
|
||||
/// Build a map of instruction orders. Return the first terminator and its
|
||||
/// order. Consider EH_LABEL instructions to be terminators as well, since local
|
||||
/// values for phis after invokes must be materialized before the call.
|
||||
@@ -233,7 +248,7 @@ void FastISel::InstOrderMap::initialize(
|
||||
unsigned Order = 0;
|
||||
for (MachineInstr &I : *MBB) {
|
||||
if (!FirstTerminator &&
|
||||
- (I.isTerminator() || (I.isEHLabel() && &I != &MBB->front()))) {
|
||||
+ (I.isTerminator() || isTerminatingEHLabel(MBB, I))) {
|
||||
FirstTerminator = &I;
|
||||
FirstTerminatorOrder = Order;
|
||||
}
|
||||
diff --git a/llvm/test/CodeGen/X86/sink-local-value.ll b/llvm/test/CodeGen/X86/sink-local-value.ll
|
||||
index b0e511ac1189..f7d861ac9b6c 100644
|
||||
--- llvm/test/CodeGen/X86/sink-local-value.ll
|
||||
+++ llvm/test/CodeGen/X86/sink-local-value.ll
|
||||
@@ -145,6 +145,42 @@ try.cont: ; preds = %entry, %lpad
|
||||
; CHECK: retl
|
||||
|
||||
|
||||
+define i32 @lpad_phi() personality i32 (...)* @__gxx_personality_v0 {
|
||||
+entry:
|
||||
+ store i32 42, i32* @sink_across
|
||||
+ invoke void @may_throw()
|
||||
+ to label %try.cont unwind label %lpad
|
||||
+
|
||||
+lpad: ; preds = %entry
|
||||
+ %p = phi i32 [ 11, %entry ] ; Trivial, but -O0 keeps it
|
||||
+ %0 = landingpad { i8*, i32 }
|
||||
+ catch i8* null
|
||||
+ store i32 %p, i32* @sink_across
|
||||
+ br label %try.cont
|
||||
+
|
||||
+try.cont: ; preds = %entry, %lpad
|
||||
+ %r.0 = phi i32 [ 13, %entry ], [ 55, %lpad ]
|
||||
+ ret i32 %r.0
|
||||
+}
|
||||
+
|
||||
+; The constant materialization should be *after* the stores to sink_across, but
|
||||
+; before any EH_LABEL.
|
||||
+
|
||||
+; CHECK-LABEL: lpad_phi:
|
||||
+; CHECK: movl $42, sink_across
|
||||
+; CHECK: movl $13, %{{[a-z]*}}
|
||||
+; CHECK: .Ltmp{{.*}}:
|
||||
+; CHECK: calll may_throw
|
||||
+; CHECK: .Ltmp{{.*}}:
|
||||
+; CHECK: jmp .LBB{{.*}}
|
||||
+; CHECK: .LBB{{.*}}: # %lpad
|
||||
+; CHECK-NEXT: .Ltmp{{.*}}:
|
||||
+; CHECK: movl {{.*}}, sink_across
|
||||
+; CHECK: movl $55, %{{[a-z]*}}
|
||||
+; CHECK: .LBB{{.*}}: # %try.cont
|
||||
+; CHECK: retl
|
||||
+
|
||||
+
|
||||
; Function Attrs: nounwind readnone speculatable
|
||||
declare void @llvm.dbg.value(metadata, metadata, metadata) #0
|
||||
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
Guix note: this got detected with the test suite of rustc 1.41.1, but
|
||||
the issue potentially affects all consumers of LLVM.
|
||||
|
||||
From 58e8c793d0e43150a6452e971a32d7407a8a7401 Mon Sep 17 00:00:00 2001
|
||||
From: Tim Northover <tnorthover@apple.com>
|
||||
Date: Mon, 30 Sep 2019 07:46:52 +0000
|
||||
Subject: [PATCH] Revert "[SCEV] add no wrap flag for SCEVAddExpr."
|
||||
|
||||
This reverts r366419 because the analysis performed is within the context of
|
||||
the loop and it's only valid to add wrapping flags to "global" expressions if
|
||||
they're always correct.
|
||||
|
||||
llvm-svn: 373184
|
||||
---
|
||||
llvm/lib/Analysis/ScalarEvolution.cpp | 2 +-
|
||||
llvm/test/Analysis/ScalarEvolution/limit-depth.ll | 2 +-
|
||||
llvm/test/Analysis/ScalarEvolution/nsw.ll | 2 +-
|
||||
llvm/test/Analysis/ScalarEvolution/trip-count12.ll | 2 +-
|
||||
llvm/test/Analysis/ScalarEvolution/trip-count9.ll | 8 ++++----
|
||||
5 files changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
|
||||
index 354ae05bb841..c29fc5dbccfb 100644
|
||||
--- llvm/lib/Analysis/ScalarEvolution.cpp
|
||||
+++ llvm/lib/Analysis/ScalarEvolution.cpp
|
||||
@@ -4992,7 +4992,7 @@ const SCEV *ScalarEvolution::createSimpleAffineAddRec(PHINode *PN,
|
||||
// overflow.
|
||||
if (auto *BEInst = dyn_cast<Instruction>(BEValueV))
|
||||
if (isLoopInvariant(Accum, L) && isAddRecNeverPoison(BEInst, L))
|
||||
- (void)getAddRecExpr(getAddExpr(StartVal, Accum, Flags), Accum, L, Flags);
|
||||
+ (void)getAddRecExpr(getAddExpr(StartVal, Accum), Accum, L, Flags);
|
||||
|
||||
return PHISCEV;
|
||||
}
|
||||
diff --git a/llvm/test/Analysis/ScalarEvolution/limit-depth.ll b/llvm/test/Analysis/ScalarEvolution/limit-depth.ll
|
||||
index db68a4f84c91..6fdf8c5df974 100644
|
||||
--- llvm/test/Analysis/ScalarEvolution/limit-depth.ll
|
||||
+++ llvm/test/Analysis/ScalarEvolution/limit-depth.ll
|
||||
@@ -46,7 +46,7 @@ define void @test_mul(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, i32 %f) {
|
||||
define void @test_sext(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, i32 %f) {
|
||||
; CHECK-LABEL: @test_sext
|
||||
; CHECK: %se2 = sext i64 %iv2.inc to i128
|
||||
-; CHECK-NEXT: --> {(1 + (sext i64 {(sext i32 (1 + %a)<nsw> to i64),+,1}<nsw><%loop> to i128))<nsw>,+,1}<nsw><%loop2>
|
||||
+; CHECK-NEXT: --> {(1 + (sext i64 {(sext i32 (1 + %a) to i64),+,1}<nsw><%loop> to i128))<nsw>,+,1}<nsw><%loop2>
|
||||
entry:
|
||||
br label %loop
|
||||
|
||||
diff --git a/llvm/test/Analysis/ScalarEvolution/nsw.ll b/llvm/test/Analysis/ScalarEvolution/nsw.ll
|
||||
index 69427368625d..ca24f9d4a04b 100644
|
||||
--- llvm/test/Analysis/ScalarEvolution/nsw.ll
|
||||
+++ llvm/test/Analysis/ScalarEvolution/nsw.ll
|
||||
@@ -163,7 +163,7 @@ bb5: ; preds = %bb2
|
||||
declare void @f(i32)
|
||||
|
||||
; CHECK-LABEL: nswnowrap
|
||||
-; CHECK: --> {(1 + %v)<nsw>,+,1}<nsw><%for.body>{{ U: [^ ]+ S: [^ ]+}}{{ *}}Exits: (2 + %v)
|
||||
+; CHECK: --> {(1 + %v)<nsw>,+,1}<nsw><%for.body>{{ U: [^ ]+ S: [^ ]+}}{{ *}}Exits: (1 + ((1 + %v)<nsw> smax %v))
|
||||
define void @nswnowrap(i32 %v, i32* %buf) {
|
||||
entry:
|
||||
%add = add nsw i32 %v, 1
|
||||
diff --git a/llvm/test/Analysis/ScalarEvolution/trip-count12.ll b/llvm/test/Analysis/ScalarEvolution/trip-count12.ll
|
||||
index 5e7d72d5e4f3..d0086ee2e6ac 100644
|
||||
--- llvm/test/Analysis/ScalarEvolution/trip-count12.ll
|
||||
+++ llvm/test/Analysis/ScalarEvolution/trip-count12.ll
|
||||
@@ -1,7 +1,7 @@
|
||||
; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
|
||||
|
||||
; CHECK: Determining loop execution counts for: @test
|
||||
-; CHECK: Loop %for.body: backedge-taken count is ((-2 + %len)<nsw> /u 2)
|
||||
+; CHECK: Loop %for.body: backedge-taken count is ((-2 + %len) /u 2)
|
||||
; CHECK: Loop %for.body: max backedge-taken count is 1073741823
|
||||
|
||||
define zeroext i16 @test(i16* nocapture %p, i32 %len) nounwind readonly {
|
||||
diff --git a/llvm/test/Analysis/ScalarEvolution/trip-count9.ll b/llvm/test/Analysis/ScalarEvolution/trip-count9.ll
|
||||
index c0a1d12fa00e..9a080b34743f 100644
|
||||
--- llvm/test/Analysis/ScalarEvolution/trip-count9.ll
|
||||
+++ llvm/test/Analysis/ScalarEvolution/trip-count9.ll
|
||||
@@ -179,7 +179,7 @@ exit:
|
||||
}
|
||||
|
||||
; CHECK: Determining loop execution counts for: @nsw_startx
|
||||
-; CHECK: Loop %loop: backedge-taken count is (-1 + (-1 * %x) + ((1 + %x)<nsw> smax %n))
|
||||
+; CHECK: Loop %loop: backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax %n))
|
||||
; CHECK: Loop %loop: max backedge-taken count is -1
|
||||
define void @nsw_startx(i4 %n, i4 %x) {
|
||||
entry:
|
||||
@@ -195,7 +195,7 @@ exit:
|
||||
}
|
||||
|
||||
; CHECK: Determining loop execution counts for: @nsw_startx_step2
|
||||
-; CHECK: Loop %loop: backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x)<nsw> smax %n)) /u 2)
|
||||
+; CHECK: Loop %loop: backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x) smax %n)) /u 2)
|
||||
; CHECK: Loop %loop: max backedge-taken count is 7
|
||||
define void @nsw_startx_step2(i4 %n, i4 %x) {
|
||||
entry:
|
||||
@@ -381,7 +381,7 @@ exit:
|
||||
}
|
||||
|
||||
; CHECK: Determining loop execution counts for: @even_nsw_startx
|
||||
-; CHECK: Loop %loop: backedge-taken count is (-1 + (-1 * %x) + ((1 + %x)<nsw> smax (2 * %n)))
|
||||
+; CHECK: Loop %loop: backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax (2 * %n)))
|
||||
; CHECK: Loop %loop: max backedge-taken count is -2
|
||||
define void @even_nsw_startx(i4 %n, i4 %x) {
|
||||
entry:
|
||||
@@ -398,7 +398,7 @@ exit:
|
||||
}
|
||||
|
||||
; CHECK: Determining loop execution counts for: @even_nsw_startx_step2
|
||||
-; CHECK: Loop %loop: backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x)<nsw> smax (2 * %n))) /u 2)
|
||||
+; CHECK: Loop %loop: backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x) smax (2 * %n))) /u 2)
|
||||
; CHECK: Loop %loop: max backedge-taken count is 7
|
||||
define void @even_nsw_startx_step2(i4 %n, i4 %x) {
|
||||
entry:
|
||||
Loading…
Add table
Reference in a new issue