Skip to content

Commit

Permalink
Merged master:714402147da into amd-gfx:833246485c5
Browse files Browse the repository at this point in the history
Local branch amd-gfx 8332464 Merged master:b6732056a44 into amd-gfx:81c26571b86
Remote branch master 7144021 [X86][SSE1] Add support for logic+movmsk patterns (PR42870)
  • Loading branch information
Sw authored and Sw committed Mar 24, 2020
2 parents 8332464 + 7144021 commit 19c8570
Show file tree
Hide file tree
Showing 59 changed files with 1,493 additions and 496 deletions.
26 changes: 26 additions & 0 deletions clang/include/clang/AST/DependenceFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,32 @@ inline ExprDependence turnTypeToValueDependence(ExprDependence D) {
// type dependency.
return D & ~ExprDependence::Type;
}
inline ExprDependence turnValueToTypeDependence(ExprDependence D) {
// Type-dependent expressions are always be value-dependent.
if (D & ExprDependence::Value)
D |= ExprDependence::Type;
return D;
}

// Returned type-dependence will never have VariablyModified set.
inline TypeDependence toTypeDependence(ExprDependence D) {
// Supported bits all have the same representation.
return static_cast<TypeDependence>(D & (ExprDependence::UnexpandedPack |
ExprDependence::Instantiation |
ExprDependence::Type));
}
inline TypeDependence toTypeDependence(NestedNameSpecifierDependence D) {
// Supported bits all have the same representation.
return static_cast<TypeDependence>(D);
}
inline TypeDependence toTypeDependence(TemplateNameDependence D) {
// Supported bits all have the same representation.
return static_cast<TypeDependence>(D);
}
inline TypeDependence toTypeDependence(TemplateArgumentDependence D) {
// Supported bits all have the same representation.
return static_cast<TypeDependence>(D);
}

inline NestedNameSpecifierDependence
toNestedNameSpecifierDependendence(TypeDependence D) {
Expand Down
5 changes: 1 addition & 4 deletions clang/include/clang/AST/LocInfoType.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ class LocInfoType : public Type {
TypeSourceInfo *DeclInfo;

LocInfoType(QualType ty, TypeSourceInfo *TInfo)
: Type((TypeClass)LocInfo, ty, ty->isDependentType(),
ty->isInstantiationDependentType(), ty->isVariablyModifiedType(),
ty->containsUnexpandedParameterPack()),
DeclInfo(TInfo) {
: Type((TypeClass)LocInfo, ty, ty->getDependence()), DeclInfo(TInfo) {
assert(getTypeClass() == (TypeClass)LocInfo && "LocInfo didn't fit in TC?");
}
friend class Sema;
Expand Down
245 changes: 65 additions & 180 deletions clang/include/clang/AST/Type.h

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions clang/include/clang/AST/TypeProperties.td
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ let Class = TagType in {
let Class = EnumType in {
def : Creator<[{
QualType result = ctx.getEnumType(cast<EnumDecl>(declaration));
const_cast<Type*>(result.getTypePtr())->setDependent(dependent);
if (dependent)
const_cast<Type *>(result.getTypePtr())
->addDependence(TypeDependence::DependentInstantiation);
return result;
}]>;
}
Expand All @@ -467,7 +469,9 @@ let Class = RecordType in {
def : Creator<[{
auto record = cast<RecordDecl>(declaration);
QualType result = ctx.getRecordType(record);
const_cast<Type*>(result.getTypePtr())->setDependent(dependent);
if (dependent)
const_cast<Type *>(result.getTypePtr())
->addDependence(TypeDependence::DependentInstantiation);
return result;
}]>;
}
Expand Down Expand Up @@ -610,7 +614,9 @@ let Class = TemplateSpecializationType in {
templateArguments,
*underlyingType);
}
const_cast<Type*>(result.getTypePtr())->setDependent(dependent);
if (dependent)
const_cast<Type *>(result.getTypePtr())
->addDependence(TypeDependence::DependentInstantiation);
return result;
}]>;
}
Expand Down
4 changes: 4 additions & 0 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ def Xanalyzer : Separate<["-"], "Xanalyzer">,
HelpText<"Pass <arg> to the static analyzer">, MetaVarName<"<arg>">,
Group<StaticAnalyzer_Group>;
def Xarch__ : JoinedAndSeparate<["-"], "Xarch_">, Flags<[DriverOption]>;
def Xarch_host : Separate<["-"], "Xarch_host">, Flags<[DriverOption]>,
HelpText<"Pass <arg> to the CUDA/HIP host compilation">, MetaVarName<"<arg>">;
def Xarch_device : Separate<["-"], "Xarch_device">, Flags<[DriverOption]>,
HelpText<"Pass <arg> to the CUDA/HIP device compilation">, MetaVarName<"<arg>">;
def Xassembler : Separate<["-"], "Xassembler">,
HelpText<"Pass <arg> to the assembler">, MetaVarName<"<arg>">,
Group<CompileOnly_Group>;
Expand Down
18 changes: 14 additions & 4 deletions clang/include/clang/Driver/ToolChain.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,20 @@ class ToolChain {
SmallVectorImpl<llvm::opt::Arg *> &AllocatedArgs) const;

/// Append the argument following \p A to \p DAL assuming \p A is an Xarch
/// argument.
virtual void TranslateXarchArgs(const llvm::opt::DerivedArgList &Args,
llvm::opt::Arg *&A,
llvm::opt::DerivedArgList *DAL) const;
/// argument. If \p AllocatedArgs is null pointer, synthesized arguments are
/// added to \p DAL, otherwise they are appended to \p AllocatedArgs.
virtual void TranslateXarchArgs(
const llvm::opt::DerivedArgList &Args, llvm::opt::Arg *&A,
llvm::opt::DerivedArgList *DAL,
SmallVectorImpl<llvm::opt::Arg *> *AllocatedArgs = nullptr) const;

/// Translate -Xarch_ arguments. If there are no such arguments, return
/// a null pointer, otherwise return a DerivedArgList containing the
/// translated arguments.
virtual llvm::opt::DerivedArgList *
TranslateXarchArgs(const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
Action::OffloadKind DeviceOffloadKind,
SmallVectorImpl<llvm::opt::Arg *> *AllocatedArgs) const;

/// Choose a tool to use to handle the action \p JA.
///
Expand Down
19 changes: 12 additions & 7 deletions clang/lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "clang/AST/DeclOpenMP.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/DependenceFlags.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprConcepts.h"
Expand Down Expand Up @@ -5125,8 +5126,12 @@ ASTContext::getAutoType(QualType DeducedType, AutoTypeKeyword Keyword,
void *Mem = Allocate(sizeof(AutoType) +
sizeof(TemplateArgument) * TypeConstraintArgs.size(),
TypeAlignment);
auto *AT = new (Mem) AutoType(DeducedType, Keyword, IsDependent, IsPack,
TypeConstraintConcept, TypeConstraintArgs);
auto *AT = new (Mem) AutoType(
DeducedType, Keyword,
(IsDependent ? TypeDependence::DependentInstantiation
: TypeDependence::None) |
(IsPack ? TypeDependence::UnexpandedPack : TypeDependence::None),
TypeConstraintConcept, TypeConstraintArgs);
Types.push_back(AT);
if (InsertPos)
AutoTypes.InsertNode(AT, InsertPos);
Expand Down Expand Up @@ -5186,11 +5191,11 @@ QualType ASTContext::getAtomicType(QualType T) const {
/// getAutoDeductType - Get type pattern for deducing against 'auto'.
QualType ASTContext::getAutoDeductType() const {
if (AutoDeductTy.isNull())
AutoDeductTy = QualType(
new (*this, TypeAlignment) AutoType(QualType(), AutoTypeKeyword::Auto,
/*dependent*/false, /*pack*/false,
/*concept*/nullptr, /*args*/{}),
0);
AutoDeductTy = QualType(new (*this, TypeAlignment)
AutoType(QualType(), AutoTypeKeyword::Auto,
TypeDependence::None,
/*concept*/ nullptr, /*args*/ {}),
0);
return AutoDeductTy;
}

Expand Down
Loading

0 comments on commit 19c8570

Please sign in to comment.