Skip to content

Commit 5ac2a34

Browse files
authored
Merge branch 'main' into x86-demandedelts-vpermv-vpermv3
2 parents 30d0d09 + edc22c6 commit 5ac2a34

32 files changed

+183
-35
lines changed

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -311,18 +311,7 @@ ClangTidyDiagnosticConsumer::ClangTidyDiagnosticConsumer(
311311
: Context(Ctx), ExternalDiagEngine(ExternalDiagEngine),
312312
RemoveIncompatibleErrors(RemoveIncompatibleErrors),
313313
GetFixesFromNotes(GetFixesFromNotes),
314-
EnableNolintBlocks(EnableNolintBlocks) {
315-
316-
if (Context.getOptions().HeaderFilterRegex &&
317-
!Context.getOptions().HeaderFilterRegex->empty())
318-
HeaderFilter =
319-
std::make_unique<llvm::Regex>(*Context.getOptions().HeaderFilterRegex);
320-
321-
if (Context.getOptions().ExcludeHeaderFilterRegex &&
322-
!Context.getOptions().ExcludeHeaderFilterRegex->empty())
323-
ExcludeHeaderFilter = std::make_unique<llvm::Regex>(
324-
*Context.getOptions().ExcludeHeaderFilterRegex);
325-
}
314+
EnableNolintBlocks(EnableNolintBlocks) {}
326315

327316
void ClangTidyDiagnosticConsumer::finalizeLastError() {
328317
if (!Errors.empty()) {
@@ -571,17 +560,30 @@ void ClangTidyDiagnosticConsumer::checkFilters(SourceLocation Location,
571560
}
572561

573562
StringRef FileName(File->getName());
574-
LastErrorRelatesToUserCode =
575-
LastErrorRelatesToUserCode || Sources.isInMainFile(Location) ||
576-
(HeaderFilter &&
577-
(HeaderFilter->match(FileName) &&
578-
!(ExcludeHeaderFilter && ExcludeHeaderFilter->match(FileName))));
563+
LastErrorRelatesToUserCode = LastErrorRelatesToUserCode ||
564+
Sources.isInMainFile(Location) ||
565+
(getHeaderFilter()->match(FileName) &&
566+
!getExcludeHeaderFilter()->match(FileName));
579567

580568
unsigned LineNumber = Sources.getExpansionLineNumber(Location);
581569
LastErrorPassesLineFilter =
582570
LastErrorPassesLineFilter || passesLineFilter(FileName, LineNumber);
583571
}
584572

573+
llvm::Regex *ClangTidyDiagnosticConsumer::getHeaderFilter() {
574+
if (!HeaderFilter)
575+
HeaderFilter =
576+
std::make_unique<llvm::Regex>(*Context.getOptions().HeaderFilterRegex);
577+
return HeaderFilter.get();
578+
}
579+
580+
llvm::Regex *ClangTidyDiagnosticConsumer::getExcludeHeaderFilter() {
581+
if (!ExcludeHeaderFilter)
582+
ExcludeHeaderFilter = std::make_unique<llvm::Regex>(
583+
*Context.getOptions().ExcludeHeaderFilterRegex);
584+
return ExcludeHeaderFilter.get();
585+
}
586+
585587
void ClangTidyDiagnosticConsumer::removeIncompatibleErrors() {
586588
// Each error is modelled as the set of intervals in which it applies
587589
// replacements. To detect overlapping replacements, we use a sweep line

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@ class ClangTidyDiagnosticConsumer : public DiagnosticConsumer {
302302
/// context.
303303
llvm::Regex *getHeaderFilter();
304304

305+
/// Returns the \c ExcludeHeaderFilter constructed for the options set in the
306+
/// context.
307+
llvm::Regex *getExcludeHeaderFilter();
308+
305309
/// Updates \c LastErrorRelatesToUserCode and LastErrorPassesLineFilter
306310
/// according to the diagnostic \p Location.
307311
void checkFilters(SourceLocation Location, const SourceManager &Sources);

clang-tools-extra/clang-tidy/ClangTidyOptions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ ClangTidyOptions ClangTidyOptions::getDefaults() {
194194
Options.WarningsAsErrors = "";
195195
Options.HeaderFileExtensions = {"", "h", "hh", "hpp", "hxx"};
196196
Options.ImplementationFileExtensions = {"c", "cc", "cpp", "cxx"};
197-
Options.HeaderFilterRegex = std::nullopt;
198-
Options.ExcludeHeaderFilterRegex = std::nullopt;
197+
Options.HeaderFilterRegex = "";
198+
Options.ExcludeHeaderFilterRegex = "";
199199
Options.SystemHeaders = false;
200200
Options.FormatStyle = "none";
201201
Options.User = std::nullopt;

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ Improvements to clang-tidy
9494
- Improved :program:`clang-tidy-diff.py` script. Add the `-warnings-as-errors`
9595
argument to treat warnings as errors.
9696

97+
- Fixed bug in :program:`clang-tidy` by which `HeaderFilterRegex` did not take
98+
effect when passed via the `.clang-tidy` file.
99+
97100
New checks
98101
^^^^^^^^^^
99102

Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
HeaderFilterRegex: '.*'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// RUN: clang-tidy -checks=-*,google-explicit-constructor %s 2>&1 | FileCheck %s
2+
#include "foo.h"
3+
// CHECK: foo.h:1:12: warning: single-argument constructors must be marked explicit
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
struct X { X(int); };
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
InheritParentConfig: true
2+
HeaderFilterRegex: 'subfolder/.*'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// shell is required for the "dirname" command
2+
// REQUIRES: shell
3+
// RUN: clang-tidy -checks=-*,google-explicit-constructor %s -- -I "$(dirname %S)" 2>&1 | FileCheck %s
4+
#include "foo.h"
5+
// CHECK-NOT: foo.h:1:12: warning: single-argument constructors must be marked explicit
6+
7+
#include "bar.h"
8+
// CHECK: bar.h:1:13: warning: single-argument constructors must be marked explicit
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
struct XX { XX(int); };
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
HeaderFilterRegex: '.*'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// RUN: clang-tidy -checks=-*,google-explicit-constructor %s 2>&1 | FileCheck %s
2+
#include "foo.h"
3+
// CHECK: foo.h:1:12: warning: single-argument constructors must be marked explicit
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
struct X { X(int); };

clang/include/clang/AST/ExternalASTSource.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ class ExternalASTSource : public RefCountedBase<ExternalASTSource> {
191191

192192
virtual ExtKind hasExternalDefinitions(const Decl *D);
193193

194+
/// True if this function declaration was a definition before in its own
195+
/// module.
196+
virtual bool wasThisDeclarationADefinition(const FunctionDecl *FD);
197+
194198
/// Finds all declarations lexically contained within the given
195199
/// DeclContext, after applying an optional filter predicate.
196200
///

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ BUILTIN(__builtin_amdgcn_raw_buffer_load_b64, "V2UiQbiiIi", "n")
163163
BUILTIN(__builtin_amdgcn_raw_buffer_load_b96, "V3UiQbiiIi", "n")
164164
BUILTIN(__builtin_amdgcn_raw_buffer_load_b128, "V4UiQbiiIi", "n")
165165

166+
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_load_lds, "vQbv*3IUiiiIiIi", "t", "vmem-to-lds-load-insts")
167+
166168
//===----------------------------------------------------------------------===//
167169
// Ballot builtins.
168170
//===----------------------------------------------------------------------===//

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13056,6 +13056,6 @@ def err_acc_decl_for_routine
1305613056
: Error<"expected function or lambda declaration for 'routine' construct">;
1305713057

1305813058
// AMDGCN builtins diagnostics
13059-
def err_amdgcn_global_load_lds_size_invalid_value : Error<"invalid size value">;
13060-
def note_amdgcn_global_load_lds_size_valid_value : Note<"size must be %select{1, 2, or 4|1, 2, 4, 12 or 16}0">;
13059+
def err_amdgcn_load_lds_size_invalid_value : Error<"invalid size value">;
13060+
def note_amdgcn_load_lds_size_valid_value : Note<"size must be %select{1, 2, or 4|1, 2, 4, 12 or 16}0">;
1306113061
} // end of sema component.

clang/include/clang/Sema/MultiplexExternalSemaSource.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ class MultiplexExternalSemaSource : public ExternalSemaSource {
9292

9393
ExtKind hasExternalDefinitions(const Decl *D) override;
9494

95+
bool wasThisDeclarationADefinition(const FunctionDecl *FD) override;
96+
9597
/// Find all declarations with the given name in the
9698
/// given context.
9799
bool FindExternalVisibleDeclsByName(const DeclContext *DC,

clang/include/clang/Serialization/ASTReader.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,6 +1392,10 @@ class ASTReader
13921392

13931393
llvm::DenseMap<const Decl *, bool> DefinitionSource;
13941394

1395+
/// Friend functions that were defined but might have had their bodies
1396+
/// removed.
1397+
llvm::DenseSet<const FunctionDecl *> ThisDeclarationWasADefinitionSet;
1398+
13951399
bool shouldDisableValidationForFile(const serialization::ModuleFile &M) const;
13961400

13971401
/// Reads a statement from the specified cursor.
@@ -2374,6 +2378,8 @@ class ASTReader
23742378

23752379
ExtKind hasExternalDefinitions(const Decl *D) override;
23762380

2381+
bool wasThisDeclarationADefinition(const FunctionDecl *FD) override;
2382+
23772383
/// Retrieve a selector from the given module with its local ID
23782384
/// number.
23792385
Selector getLocalSelector(ModuleFile &M, unsigned LocalID);

clang/lib/AST/ExternalASTSource.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ ExternalASTSource::hasExternalDefinitions(const Decl *D) {
3838
return EK_ReplyHazy;
3939
}
4040

41+
bool ExternalASTSource::wasThisDeclarationADefinition(const FunctionDecl *FD) {
42+
return false;
43+
}
44+
4145
void ExternalASTSource::FindFileRegionDecls(FileID File, unsigned Offset,
4246
unsigned Length,
4347
SmallVectorImpl<Decl *> &Decls) {}

clang/lib/Sema/MultiplexExternalSemaSource.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ MultiplexExternalSemaSource::hasExternalDefinitions(const Decl *D) {
107107
return EK_ReplyHazy;
108108
}
109109

110+
bool MultiplexExternalSemaSource::wasThisDeclarationADefinition(
111+
const FunctionDecl *FD) {
112+
for (const auto &S : Sources)
113+
if (S->wasThisDeclarationADefinition(FD))
114+
return true;
115+
return false;
116+
}
117+
110118
bool MultiplexExternalSemaSource::FindExternalVisibleDeclsByName(
111119
const DeclContext *DC, DeclarationName Name,
112120
const DeclContext *OriginalDC) {

clang/lib/Sema/SemaAMDGPU.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ bool SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall(unsigned BuiltinID,
3535
Builtin::evaluateRequiredTargetFeatures("gfx950-insts", CallerFeatureMap);
3636

3737
switch (BuiltinID) {
38+
case AMDGPU::BI__builtin_amdgcn_raw_ptr_buffer_load_lds:
3839
case AMDGPU::BI__builtin_amdgcn_global_load_lds: {
3940
constexpr const int SizeIdx = 2;
4041
llvm::APSInt Size;
@@ -54,11 +55,9 @@ bool SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall(unsigned BuiltinID,
5455
[[fallthrough]];
5556
}
5657
default:
57-
Diag(ArgExpr->getExprLoc(),
58-
diag::err_amdgcn_global_load_lds_size_invalid_value)
58+
Diag(ArgExpr->getExprLoc(), diag::err_amdgcn_load_lds_size_invalid_value)
5959
<< ArgExpr->getSourceRange();
60-
Diag(ArgExpr->getExprLoc(),
61-
diag::note_amdgcn_global_load_lds_size_valid_value)
60+
Diag(ArgExpr->getExprLoc(), diag::note_amdgcn_load_lds_size_valid_value)
6261
<< HasGFX950Insts << ArgExpr->getSourceRange();
6362
return true;
6463
}

clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2604,11 +2604,13 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(
26042604
// Friend function defined withing class template may stop being function
26052605
// definition during AST merges from different modules, in this case decl
26062606
// with function body should be used for instantiation.
2607-
if (isFriend) {
2608-
const FunctionDecl *Defn = nullptr;
2609-
if (D->hasBody(Defn)) {
2610-
D = const_cast<FunctionDecl *>(Defn);
2611-
FunctionTemplate = Defn->getDescribedFunctionTemplate();
2607+
if (ExternalASTSource *Source = SemaRef.Context.getExternalSource()) {
2608+
if (isFriend && Source->wasThisDeclarationADefinition(D)) {
2609+
const FunctionDecl *Defn = nullptr;
2610+
if (D->hasBody(Defn)) {
2611+
D = const_cast<FunctionDecl *>(Defn);
2612+
FunctionTemplate = Defn->getDescribedFunctionTemplate();
2613+
}
26122614
}
26132615
}
26142616

clang/lib/Serialization/ASTReader.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9661,6 +9661,10 @@ ExternalASTSource::ExtKind ASTReader::hasExternalDefinitions(const Decl *FD) {
96619661
return I->second ? EK_Never : EK_Always;
96629662
}
96639663

9664+
bool ASTReader::wasThisDeclarationADefinition(const FunctionDecl *FD) {
9665+
return ThisDeclarationWasADefinitionSet.contains(FD);
9666+
}
9667+
96649668
Selector ASTReader::getLocalSelector(ModuleFile &M, unsigned LocalID) {
96659669
return DecodeSelector(getGlobalSelectorID(M, LocalID));
96669670
}

clang/lib/Serialization/ASTReaderDecl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,9 @@ void ASTDeclReader::ReadFunctionDefinition(FunctionDecl *FD) {
523523
}
524524
// Store the offset of the body so we can lazily load it later.
525525
Reader.PendingBodies[FD] = GetCurrentCursorOffset();
526+
// For now remember ThisDeclarationWasADefinition only for friend functions.
527+
if (FD->getFriendObjectKind())
528+
Reader.ThisDeclarationWasADefinitionSet.insert(FD);
526529
}
527530

528531
void ASTDeclReader::Visit(Decl *D) {

clang/test/CodeGenOpenCL/builtins-amdgcn-raw-buffer-load.cl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,12 @@ v3u32 test_amdgcn_raw_ptr_buffer_load_b96_non_const_soffset(__amdgpu_buffer_rsrc
170170
v4u32 test_amdgcn_raw_ptr_buffer_load_b128_non_const_soffset(__amdgpu_buffer_rsrc_t rsrc, int offset, int soffset) {
171171
return __builtin_amdgcn_raw_buffer_load_b128(rsrc, /*offset=*/0, soffset, /*aux=*/0);
172172
}
173+
174+
// CHECK-LABEL: @test_amdgcn_raw_ptr_buffer_load_lds(
175+
// CHECK-NEXT: entry:
176+
// CHECK-NEXT: tail call void @llvm.amdgcn.raw.ptr.buffer.load.lds(ptr addrspace(8) [[RSRC:%.*]], ptr addrspace(3) [[LDS:%.*]], i32 1, i32 [[OFFSET:%.*]], i32 [[SOFFSET:%.*]], i32 2, i32 3)
177+
// CHECK-NEXT: ret void
178+
//
179+
void test_amdgcn_raw_ptr_buffer_load_lds(__amdgpu_buffer_rsrc_t rsrc, __local void * lds, int offset, int soffset) {
180+
__builtin_amdgcn_raw_ptr_buffer_load_lds(rsrc, lds, 1, offset, soffset, 2, 3);
181+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// RUN: rm -fR %t
2+
// RUN: split-file %s %t
3+
// RUN: cd %t
4+
// RUN: %clang_cc1 -std=c++20 -fmodule-map-file=modules.map -xc++ -emit-module -fmodule-name=foo modules.map -o foo.pcm
5+
// RUN: %clang_cc1 -std=c++20 -fmodule-map-file=modules.map -O1 -emit-obj main.cc -verify -fmodule-file=foo.pcm
6+
7+
//--- modules.map
8+
module "foo" {
9+
export *
10+
module "foo.h" {
11+
export *
12+
header "foo.h"
13+
}
14+
}
15+
16+
//--- foo.h
17+
#pragma once
18+
19+
template <int>
20+
void Create(const void* = nullptr);
21+
22+
template <int>
23+
struct ObjImpl {
24+
template <int>
25+
friend void ::Create(const void*);
26+
};
27+
28+
template <int I>
29+
void Create(const void*) {
30+
(void) ObjImpl<I>{};
31+
}
32+
33+
//--- main.cc
34+
// expected-no-diagnostics
35+
#include "foo.h"
36+
37+
int main() {
38+
Create<42>();
39+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: %clang_cc1 -std=c++20 -verify -emit-llvm-only %s
2+
3+
template <int>
4+
void Create(const void* = nullptr);
5+
6+
template <int>
7+
struct ObjImpl {
8+
template <int>
9+
friend void ::Create(const void*);
10+
};
11+
12+
template <int I>
13+
void Create(const void*) {
14+
(void) ObjImpl<I>{};
15+
}
16+
17+
int main() {
18+
Create<42>();
19+
}
20+
21+
// expected-no-diagnostics
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx90a -S -verify=gfx90a,expected -o - %s
2+
// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx950 -S -verify=gfx950,expected -o - %s
3+
// REQUIRES: amdgpu-registered-target
4+
5+
void test_amdgcn_raw_ptr_buffer_load_lds(__amdgpu_buffer_rsrc_t rsrc, __local void* lds, int offset, int soffset, int x) {
6+
__builtin_amdgcn_raw_ptr_buffer_load_lds(rsrc, lds, x, offset, soffset, 0, 0); //expected-error{{argument to '__builtin_amdgcn_raw_ptr_buffer_load_lds' must be a constant integer}}
7+
__builtin_amdgcn_raw_ptr_buffer_load_lds(rsrc, lds, 4, offset, soffset, x, 0); //expected-error{{argument to '__builtin_amdgcn_raw_ptr_buffer_load_lds' must be a constant integer}}
8+
__builtin_amdgcn_raw_ptr_buffer_load_lds(rsrc, lds, 4, offset, soffset, 0, x); //expected-error{{argument to '__builtin_amdgcn_raw_ptr_buffer_load_lds' must be a constant integer}}
9+
__builtin_amdgcn_raw_ptr_buffer_load_lds(rsrc, lds, 3, offset, soffset, 0, 0); //expected-error{{invalid size value}} gfx950-note{{size must be 1, 2, 4, 12 or 16}} gfx90a-note{{size must be 1, 2, or 4}}
10+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx1100 -S -verify -o - %s
2+
// REQUIRES: amdgpu-registered-target
3+
4+
void test_amdgcn_raw_ptr_buffer_load_lds(__amdgpu_buffer_rsrc_t rsrc, __local void* lds, int offset, int soffset, int x) {
5+
__builtin_amdgcn_raw_ptr_buffer_load_lds(rsrc, lds, 4, offset, soffset, 0, 0); //expected-error{{needs target feature vmem-to-lds-load-insts}}
6+
}

llvm/include/llvm/IR/IntrinsicsAMDGPU.td

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1863,7 +1863,9 @@ class AMDGPURawBufferLoadLDS : Intrinsic <
18631863
ImmArg<ArgIndex<6>>, IntrNoCallback, IntrNoFree], "", [SDNPMemOperand]>, AMDGPURsrcIntrinsic<0>;
18641864
def int_amdgcn_raw_buffer_load_lds : AMDGPURawBufferLoadLDS;
18651865

1866-
class AMDGPURawPtrBufferLoadLDS : Intrinsic <
1866+
class AMDGPURawPtrBufferLoadLDS :
1867+
ClangBuiltin<"__builtin_amdgcn_raw_ptr_buffer_load_lds">,
1868+
Intrinsic <
18671869
[],
18681870
[AMDGPUBufferRsrcTy, // rsrc(SGPR)
18691871
LLVMQualPointerType<3>, // LDS base offset

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6413,9 +6413,7 @@ static bool getFauxShuffleMask(SDValue N, const APInt &DemandedElts,
64136413
case X86ISD::VTRUNC: {
64146414
SDValue Src = N.getOperand(0);
64156415
EVT SrcVT = Src.getValueType();
6416-
// Truncated source must be a simple vector.
6417-
if (!SrcVT.isSimple() || (SrcVT.getSizeInBits() % 128) != 0 ||
6418-
(SrcVT.getScalarSizeInBits() % 8) != 0)
6416+
if (SrcVT.getSizeInBits() != NumSizeInBits)
64196417
return false;
64206418
unsigned NumSrcElts = SrcVT.getVectorNumElements();
64216419
unsigned NumBitsPerSrcElt = SrcVT.getScalarSizeInBits();

llvm/lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6228,7 +6228,6 @@ static bool initializeUniqueCases(SwitchInst *SI, PHINode *&PHI,
62286228
}
62296229
// Find the default result value.
62306230
SmallVector<std::pair<PHINode *, Constant *>, 1> DefaultResults;
6231-
BasicBlock *DefaultDest = SI->getDefaultDest();
62326231
getCaseResults(SI, nullptr, SI->getDefaultDest(), &CommonDest, DefaultResults,
62336232
DL, TTI);
62346233
// If the default value is not found abort unless the default destination

0 commit comments

Comments
 (0)