Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 3906402

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:80b2aac2c671 into amd-gfx:634c100884f8
Local branch amd-gfx 634c100 Merged main:817519058a98 into amd-gfx:7e00bdde62c2 Remote branch main 80b2aac [Github] Make PR formatting job only run with C/C++ changes (llvm#69556)
2 parents 634c100 + 80b2aac commit 3906402

File tree

9 files changed

+34
-20
lines changed

9 files changed

+34
-20
lines changed

.github/workflows/pr-code-format.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
name: "Check code formatting"
2-
on: pull_request_target
2+
3+
on:
4+
pull_request_target:
5+
paths:
6+
- '**/*.cpp'
7+
- '**/*.c'
8+
- '**/*.h'
9+
- '**/*.inc'
10+
311
permissions:
412
pull-requests: write
513

614
jobs:
7-
code_formatter:
15+
cpp_code_formatter:
16+
name: "Check C++ Formatting"
817
runs-on: ubuntu-latest
918
steps:
1019
- name: Fetch LLVM sources

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 477959
19+
#define LLVM_MAIN_REVISION 477964
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13717,7 +13717,7 @@ static SDValue performSELECTCombine(SDNode *N, SelectionDAG &DAG,
1371713717
return tryFoldSelectIntoOp(N, DAG, FalseVal, TrueVal, /*Swapped*/true);
1371813718
}
1371913719

13720-
/// IF we have a build_vector where each lane is binop X, C, where C
13720+
/// If we have a build_vector where each lane is binop X, C, where C
1372113721
/// is a constant (but not necessarily the same constant on all lanes),
1372213722
/// form binop (build_vector x1, x2, ...), (build_vector c1, c2, c3, ..).
1372313723
/// We assume that materializing a constant build vector will be no more
@@ -13763,6 +13763,10 @@ static SDValue performBUILD_VECTORCombine(SDNode *N, SelectionDAG &DAG,
1376313763
if (!isa<ConstantSDNode>(Op.getOperand(1)) &&
1376413764
!isa<ConstantFPSDNode>(Op.getOperand(1)))
1376513765
return SDValue();
13766+
// FIXME: Return failure if the RHS type doesn't match the LHS. Shifts may
13767+
// have different LHS and RHS types.
13768+
if (Op.getOperand(0).getValueType() != Op.getOperand(1).getValueType())
13769+
return SDValue();
1376613770
RHSOps.push_back(Op.getOperand(1));
1376713771
}
1376813772

llvm/lib/Target/RISCV/RISCVMacroFusion.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ static bool isLUIADDI(const MachineInstr *FirstMI,
3535
if (FirstMI->getOpcode() != RISCV::LUI)
3636
return false;
3737

38-
// The first operand of ADDI might be a frame index.
39-
if (!SecondMI.getOperand(1).isReg())
40-
return false;
41-
4238
Register FirstDest = FirstMI->getOperand(0).getReg();
4339

4440
// Destination of LUI should be the ADDI(W) source register.

llvm/lib/Target/RISCV/RISCVTargetMachine.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ class RISCVPassConfig : public TargetPassConfig {
248248
public:
249249
RISCVPassConfig(RISCVTargetMachine &TM, PassManagerBase &PM)
250250
: TargetPassConfig(TM, PM) {
251+
if (TM.getOptLevel() != CodeGenOptLevel::None)
252+
substitutePass(&PostRASchedulerID, &PostMachineSchedulerID);
251253
setEnableSinkAndFold(EnableSinkFold);
252254
}
253255

llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -594,12 +594,6 @@ SPIRVType *SPIRVGlobalRegistry::getOpTypeStruct(const StructType *Ty,
594594
SPIRVType *SPIRVGlobalRegistry::getOrCreateSpecialType(
595595
const Type *Ty, MachineIRBuilder &MIRBuilder,
596596
SPIRV::AccessQualifier::AccessQualifier AccQual) {
597-
// Some OpenCL and SPIRV builtins like image2d_t are passed in as
598-
// pointers, but should be treated as custom types like OpTypeImage.
599-
if (auto PType = dyn_cast<PointerType>(Ty)) {
600-
assert(!PType->isOpaque());
601-
Ty = PType->getNonOpaquePointerElementType();
602-
}
603597
assert(isSpecialOpaqueType(Ty) && "Not a special opaque builtin type");
604598
return SPIRV::lowerBuiltinType(Ty, AccQual, MIRBuilder, this);
605599
}
@@ -755,13 +749,10 @@ SPIRVType *SPIRVGlobalRegistry::restOfCreateSPIRVType(
755749
!isSpecialOpaqueType(Ty)) {
756750
if (!Ty->isPointerTy())
757751
DT.add(Ty, &MIRBuilder.getMF(), getSPIRVTypeID(SpirvType));
758-
else if (Ty->isOpaquePointerTy())
752+
else
759753
DT.add(Type::getInt8Ty(MIRBuilder.getMF().getFunction().getContext()),
760754
Ty->getPointerAddressSpace(), &MIRBuilder.getMF(),
761755
getSPIRVTypeID(SpirvType));
762-
else
763-
DT.add(Ty->getNonOpaquePointerElementType(), Ty->getPointerAddressSpace(),
764-
&MIRBuilder.getMF(), getSPIRVTypeID(SpirvType));
765756
}
766757

767758
return SpirvType;

llvm/test/CodeGen/RISCV/O3-pipeline.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
; CHECK-NEXT: Insert KCFI indirect call checks
160160
; CHECK-NEXT: MachineDominator Tree Construction
161161
; CHECK-NEXT: Machine Natural Loop Construction
162-
; CHECK-NEXT: Post RA top-down list latency scheduler
162+
; CHECK-NEXT: PostRA Machine Instruction Scheduler
163163
; CHECK-NEXT: Analyze Machine Code For Garbage Collection
164164
; CHECK-NEXT: Machine Block Frequency Analysis
165165
; CHECK-NEXT: MachinePostDominator Tree Construction

llvm/test/CodeGen/RISCV/macro-fusion-lui-addi.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ define void @foo(i32 signext %0, i32 signext %1) {
2525
;
2626
; FUSION-POSTRA-LABEL: foo:
2727
; FUSION-POSTRA: # %bb.0:
28-
; FUSION-POSTRA-NEXT: lui a0, %hi(.L.str)
2928
; FUSION-POSTRA-NEXT: fcvt.s.w fa0, a1
29+
; FUSION-POSTRA-NEXT: lui a0, %hi(.L.str)
3030
; FUSION-POSTRA-NEXT: addi a0, a0, %lo(.L.str)
3131
; FUSION-POSTRA-NEXT: tail bar@plt
3232
%3 = sitofp i32 %1 to float

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-buildvec-of-binop.ll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,3 +442,15 @@ define <4 x i32> @add_general_splat(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) {
442442
%v3 = insertelement <4 x i32> %v2, i32 %e3, i32 3
443443
ret <4 x i32> %v3
444444
}
445+
446+
; This test previously failed with an assertion failure because constant shift
447+
; amounts are type legalized early.
448+
define void @buggy(i32 %0) #0 {
449+
entry:
450+
%mul.us.us.i.3 = shl i32 %0, 1
451+
%1 = insertelement <4 x i32> zeroinitializer, i32 %mul.us.us.i.3, i64 0
452+
%2 = or <4 x i32> %1, <i32 1, i32 1, i32 1, i32 1>
453+
%3 = shufflevector <4 x i32> %2, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer
454+
store <4 x i32> %3, ptr null, align 16
455+
ret void
456+
}

0 commit comments

Comments
 (0)