Skip to content

Commit d1d265d

Browse files
committed
Merge remote-tracking branch 'origin/main' into vplan-region-getcanonicalivtype
2 parents 991548f + c87e3c9 commit d1d265d

File tree

7 files changed

+33
-20
lines changed

7 files changed

+33
-20
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2871,18 +2871,14 @@ SDValue DAGTypeLegalizer::PromoteIntOp_SET_ROUNDING(SDNode *N) {
28712871
SDValue DAGTypeLegalizer::PromoteIntOp_STACKMAP(SDNode *N, unsigned OpNo) {
28722872
assert(OpNo > 1); // Because the first two arguments are guaranteed legal.
28732873
SmallVector<SDValue> NewOps(N->ops());
2874-
SDValue Operand = N->getOperand(OpNo);
2875-
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), Operand.getValueType());
2876-
NewOps[OpNo] = DAG.getNode(ISD::ANY_EXTEND, SDLoc(N), NVT, Operand);
2874+
NewOps[OpNo] = GetPromotedInteger(NewOps[OpNo]);
28772875
return SDValue(DAG.UpdateNodeOperands(N, NewOps), 0);
28782876
}
28792877

28802878
SDValue DAGTypeLegalizer::PromoteIntOp_PATCHPOINT(SDNode *N, unsigned OpNo) {
28812879
assert(OpNo >= 7);
28822880
SmallVector<SDValue> NewOps(N->ops());
2883-
SDValue Operand = N->getOperand(OpNo);
2884-
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), Operand.getValueType());
2885-
NewOps[OpNo] = DAG.getNode(ISD::ANY_EXTEND, SDLoc(N), NVT, Operand);
2881+
NewOps[OpNo] = GetPromotedInteger(NewOps[OpNo]);
28862882
return SDValue(DAG.UpdateNodeOperands(N, NewOps), 0);
28872883
}
28882884

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22134,6 +22134,27 @@ bool BoUpSLP::collectValuesToDemote(
2213422134
{VectorizableTree[E.CombinedEntriesWithIndices.front().first].get(),
2213522135
VectorizableTree[E.CombinedEntriesWithIndices.back().first].get()});
2213622136

22137+
if (E.isAltShuffle()) {
22138+
// Combining these opcodes may lead to incorrect analysis, skip for now.
22139+
auto IsDangerousOpcode = [](unsigned Opcode) {
22140+
switch (Opcode) {
22141+
case Instruction::Shl:
22142+
case Instruction::AShr:
22143+
case Instruction::LShr:
22144+
case Instruction::UDiv:
22145+
case Instruction::SDiv:
22146+
case Instruction::URem:
22147+
case Instruction::SRem:
22148+
return true;
22149+
default:
22150+
break;
22151+
}
22152+
return false;
22153+
};
22154+
if (IsDangerousOpcode(E.getAltOpcode()))
22155+
return FinalAnalysis();
22156+
}
22157+
2213722158
switch (E.getOpcode()) {
2213822159

2213922160
// We can always demote truncations and extensions. Since truncations can

llvm/test/CodeGen/AArch64/stackmap.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@
8181
; CHECK-NEXT: .hword 8
8282
; CHECK-NEXT: .hword 0
8383
; CHECK-NEXT: .hword 0
84-
; CHECK-NEXT: .word 65535
84+
; CHECK-NEXT: .word -1
8585
; SmallConstant
8686
; CHECK-NEXT: .byte 4
8787
; CHECK-NEXT: .byte 0
8888
; CHECK-NEXT: .hword 8
8989
; CHECK-NEXT: .hword 0
9090
; CHECK-NEXT: .hword 0
91-
; CHECK-NEXT: .word 65535
91+
; CHECK-NEXT: .word -1
9292
; SmallConstant
9393
; CHECK-NEXT: .byte 4
9494
; CHECK-NEXT: .byte 0

llvm/test/CodeGen/SystemZ/stackmap.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@
8484
; CHECK-NEXT: .short 8
8585
; CHECK-NEXT: .short 0
8686
; CHECK-NEXT: .short 0
87-
; CHECK-NEXT: .long 65535
87+
; CHECK-NEXT: .long -1
8888
; SmallConstant
8989
; CHECK-NEXT: .byte 4
9090
; CHECK-NEXT: .byte 0
9191
; CHECK-NEXT: .short 8
9292
; CHECK-NEXT: .short 0
9393
; CHECK-NEXT: .short 0
94-
; CHECK-NEXT: .long 65535
94+
; CHECK-NEXT: .long -1
9595
; SmallConstant
9696
; CHECK-NEXT: .byte 4
9797
; CHECK-NEXT: .byte 0

llvm/test/Transforms/SLPVectorizer/X86/alternate-opcode-strict-bitwidth-than-main.ll

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ define float @test(i8 %0) {
66
; CHECK-SAME: i8 [[TMP0:%.*]]) {
77
; CHECK-NEXT: [[ENTRY:.*:]]
88
; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i8> <i8 poison, i8 0>, i8 [[TMP0]], i32 0
9-
; CHECK-NEXT: [[TMP2:%.*]] = sext <2 x i8> [[TMP1]] to <2 x i16>
10-
; CHECK-NEXT: [[TMP3:%.*]] = mul <2 x i16> [[TMP2]], <i16 2, i16 27>
11-
; CHECK-NEXT: [[TMP4:%.*]] = lshr <2 x i16> [[TMP2]], <i16 2, i16 27>
12-
; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <2 x i16> [[TMP3]], <2 x i16> [[TMP4]], <2 x i32> <i32 0, i32 3>
13-
; CHECK-NEXT: [[TMP9:%.*]] = extractelement <2 x i16> [[TMP5]], i32 0
14-
; CHECK-NEXT: [[TMP6:%.*]] = sext i16 [[TMP9]] to i32
15-
; CHECK-NEXT: [[TMP10:%.*]] = extractelement <2 x i16> [[TMP5]], i32 1
16-
; CHECK-NEXT: [[TMP7:%.*]] = zext i16 [[TMP10]] to i32
9+
; CHECK-NEXT: [[TMP2:%.*]] = sext <2 x i8> [[TMP1]] to <2 x i32>
10+
; CHECK-NEXT: [[TMP3:%.*]] = mul <2 x i32> [[TMP2]], <i32 2, i32 27>
11+
; CHECK-NEXT: [[TMP4:%.*]] = lshr <2 x i32> [[TMP2]], <i32 2, i32 27>
12+
; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <2 x i32> [[TMP3]], <2 x i32> [[TMP4]], <2 x i32> <i32 0, i32 3>
13+
; CHECK-NEXT: [[TMP6:%.*]] = extractelement <2 x i32> [[TMP5]], i32 0
14+
; CHECK-NEXT: [[TMP7:%.*]] = extractelement <2 x i32> [[TMP5]], i32 1
1715
; CHECK-NEXT: [[TMP8:%.*]] = or i32 [[TMP6]], [[TMP7]]
1816
; CHECK-NEXT: switch i32 [[TMP8]], label %[[EXIT:.*]] [
1917
; CHECK-NEXT: i32 0, label %[[EXIT]]

mlir/lib/Dialect/XeGPU/IR/XeGPUDialect.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "mlir/Dialect/Index/IR/IndexOps.h"
1212
#include "mlir/Dialect/Utils/IndexingUtils.h"
1313
#include "mlir/Dialect/XeGPU/IR/XeGPU.h"
14-
#include "mlir/Dialect/XeGPU/Utils/XeGPUUtils.h"
1514
#include "mlir/Dialect/XeGPU/uArch/IntelGpuXe2.h"
1615
#include "mlir/IR/Builders.h"
1716
#include "mlir/IR/DialectImplementation.h"

utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3729,7 +3729,6 @@ cc_library(
37293729
":XeGPUAttrInterfaceIncGen",
37303730
":XeGPUEnumsIncGen",
37313731
":XeGPUIncGen",
3732-
":XeGPUUtils",
37333732
":XeGPUuArch",
37343733
":XeVMDialect",
37353734
"//llvm:Support",

0 commit comments

Comments
 (0)