Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
ebc0e07
[AMDGPU] Use std::variant in ArgDescriptor. (#167992)
topperc Nov 14, 2025
739a5a4
[Flang][OpenMP] Fix defaultmap(none) being overly aggressive with sym…
agozillon Nov 14, 2025
306f49a
[AMDGPU][MC] Disallow nogds in ds_gws_* instructions (#166873)
jwanggit86 Nov 14, 2025
420d56a
Clean up MachTask.mm's handling of m_exception_thread. (#167994)
jimingham Nov 14, 2025
52f2a94
[Support] Prevent loss of file type flags when creating temporary (#1…
tltao Nov 14, 2025
8e4209a
[utils] don't warn when setting rlimit fails on Solaris (#167921)
hnrklssn Nov 14, 2025
3f0ef27
[MLIR][LLVM] Debug info: import debug records directly (#167812)
bcardosolopes Nov 14, 2025
05e94c9
[Xtensa] TableGen-erate SDNode descriptions (#166253)
s-barannikov Nov 14, 2025
bbece4b
[libc] replace for loops with a call to memcpy in File (#165219)
bojle Nov 14, 2025
ac6daa8
[BOLT][print] Add option '--print-only-file' (NFC) (#168023)
yozhu Nov 14, 2025
e7db040
[libc][test] split exit tests into two separate tests (#166355)
bojle Nov 14, 2025
cfce4a6
[libc] Allow user-defined LIBC_ASSERT macro. (#168087)
lntue Nov 14, 2025
8b105cb
Revert "[Clang][OpenMP] Bug fix Default clause variable category" (#1…
SunilKuravinakop Nov 14, 2025
7108b12
[RDF] RegisterRef/RegisterId improvements. NFC (#168030)
topperc Nov 14, 2025
d06a7dd
lldb: Link delayimp on Windows (#168093)
Steelskin Nov 14, 2025
5b798df
Revert "[libc][test] split exit tests into two separate tests" (#168102)
SchrodingerZhu Nov 14, 2025
44b94a4
[AArch64][DebugInfo]Add Target hooks for InstrRef on AArch64 (#165953)
rastogishubham Nov 14, 2025
17789e9
[MemCpyOpt][profcheck] Set `unknown` branch weights for certain selec…
mtrofin Nov 14, 2025
b9c769b
[libc] fix EXPECT_EXIT suspend/timeout for darwin (#166065)
bojle Nov 14, 2025
c29b29b
[libc++][hardening] Allow setting the assertion semantic via CMake. (…
var-const Nov 14, 2025
9d7e341
[libc][POSIX][RISCV] Disabled clock_settime on RV32 (#168006)
amemov Nov 14, 2025
07740fb
[mlir][NVVM][NFC] Remove useless options form run lines (#168098)
clementval Nov 14, 2025
f7a8d20
DeclareRuntimeLibcalls: Use RuntimeLibraryAnalysis (#167995)
arsenm Nov 14, 2025
70b7958
[mlir][tosa] Fix scatter duplicate indices check for int64 (#168085)
lhutton1 Nov 14, 2025
dd7a000
[InstSimplify] Fix crash when optimizing minmax with bitcast constant…
igorban-intel Nov 14, 2025
9fcb675
[docs] Fix llvm-strip -T flag section (#167987)
keith Nov 14, 2025
0bdbf2c
[docs] Fix invalid header length in llvm-ir2vec.rst (#168104)
keith Nov 14, 2025
0190951
[AMDGPU] Update buffer fat pointer docs for gfx1250, fix formatting (…
krzysz00 Nov 14, 2025
3a08e42
Re-land [lldb][NFC] Mark ValueObject library with NO_PLUGIN_DEPENDENC…
bulbazord Nov 14, 2025
590ab43
RuntimeLibcalls: Move VectorLibrary handling into TargetOptions (#167…
arsenm Nov 14, 2025
8b59622
Add the ability to load DWARF64 .debug_str_offsets tables for DWARF32…
clayborg Nov 14, 2025
a407d02
Revert "[Transform][LoadStoreVectorizer] allow redundant in Chain (#1…
cmc-rep Nov 14, 2025
7e7ea9c
[MLIR] Extend vector.scatter to accept tensor as base (#165548)
sakupan102 Nov 14, 2025
862d346
opt: Fix bad merge of #167996 (#168110)
arsenm Nov 14, 2025
dbd97c8
DebugInfo: Relax codeview-empty-dbg-cu-crash test's version check (#1…
arsenm Nov 14, 2025
afd1ffb
[mlir][acc] Check legality of symbols in acc regions (#167957)
razvanlupusoru Nov 14, 2025
77fd6be
[LV] Also cover -force-target-instruction-cost=1 in tests.
fhahn Nov 14, 2025
dc491d9
[flang][acc] Add missing dependency on MLIROpenACCUtils (#168117)
razvanlupusoru Nov 14, 2025
8c74cc5
[mlir] Remove filtering of deprecated rocm-agent-enumerator value gfx…
MixedMatched Nov 14, 2025
88e9a78
[Clang][OpenMP] Bug fix Default clause variable category (#168112)
SunilKuravinakop Nov 14, 2025
0363bd8
[AArch64][FEAT_CMPBR] Codegen for Armv9.6-a CBB and CBH (#164899)
dtellenbach Nov 14, 2025
c40a694
Remove instr-ref-target-hooks-sp-clobber.mir (#168125)
rastogishubham Nov 14, 2025
1429628
[flang][cuf] Add to cuf.alloc/cuf.allocate mem alloc effect (#167414)
SusanTan Nov 14, 2025
ab08fbd
[clang] Switch warning suppression multi-match rule to "last match ta…
vitalybuka Oct 6, 2025
0a58e49
[VE] TableGen-erate SDNode descriptions (#168120)
s-barannikov Nov 14, 2025
4881512
Don't check frame base as varies if registers are available from targ…
clayborg Nov 14, 2025
944278f
Revert "[Clang][OpenMP] Bug fix Default clause variable category" (#1…
Prabhuk Nov 14, 2025
2743543
[mlir][bazel] Add apfloat test library (#168115)
michaelrj-google Nov 14, 2025
825ebef
[NFC][Support] Remove unused getLongestMatch from SpecialCaseList (#1…
vitalybuka Nov 14, 2025
6dad2c2
[lldb] Add a test for capturing stdout/stderr from Python commands (#…
JDevlieghere Nov 14, 2025
72a6ae6
[AMDGPU] Fix wrong MSB encoding for V_FMAMK instructions (#168107)
shiltian Nov 14, 2025
ddf5bb0
[SLP]Check if the copyable element is a sub instruciton with abs in i…
alexey-bataev Nov 14, 2025
459a64b
[lldb] Diagnose unsupported configurations when targeting the Limited…
JDevlieghere Nov 14, 2025
e8cc0d2
Revert "[SLP]Check if the copyable element is a sub instruciton with …
alexey-bataev Nov 14, 2025
4c4ffd3
[ProfCheck] Refactor Select Instrumentation to use Early Exits (#168086)
boomanaiden154 Nov 14, 2025
e02fdf0
[CIR] Upstream CIR codegen for vec_ext x86 builtins (#167942)
Thibault-Monnier Nov 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions bolt/include/bolt/Rewrite/RewriteInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ class RewriteInstance {
void handleRelocation(const object::SectionRef &RelocatedSection,
const RelocationRef &Rel);

/// Collect functions that are specified to be bumped.
void selectFunctionsToPrint();

/// Mark functions that are not meant for processing as ignored.
void selectFunctionsToProcess();

Expand Down
10 changes: 2 additions & 8 deletions bolt/lib/Core/BinaryFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ extern cl::OptionCategory BoltOptCategory;

extern cl::opt<bool> EnableBAT;
extern cl::opt<bool> Instrument;
extern cl::list<std::string> PrintOnly;
extern cl::opt<std::string> PrintOnlyFile;
extern cl::opt<bool> StrictMode;
extern cl::opt<bool> UpdateDebugSections;
extern cl::opt<unsigned> Verbosity;
Expand Down Expand Up @@ -133,14 +135,6 @@ PrintDynoStatsOnly("print-dyno-stats-only",
cl::Hidden,
cl::cat(BoltCategory));

static cl::list<std::string>
PrintOnly("print-only",
cl::CommaSeparated,
cl::desc("list of functions to print"),
cl::value_desc("func1,func2,func3,..."),
cl::Hidden,
cl::cat(BoltCategory));

cl::opt<bool>
TimeBuild("time-build",
cl::desc("print time spent constructing binary functions"),
Expand Down
27 changes: 18 additions & 9 deletions bolt/lib/Rewrite/RewriteInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ extern cl::opt<bool> Hugify;
extern cl::opt<bool> Instrument;
extern cl::opt<bool> KeepNops;
extern cl::opt<bool> Lite;
extern cl::list<std::string> PrintOnly;
extern cl::opt<std::string> PrintOnlyFile;
extern cl::list<std::string> ReorderData;
extern cl::opt<bolt::ReorderFunctions::ReorderType> ReorderFunctions;
extern cl::opt<bool> TerminalHLT;
Expand Down Expand Up @@ -730,6 +732,8 @@ Error RewriteInstance::run() {
<< "\n";
BC->outs() << "BOLT-INFO: BOLT version: " << BoltRevision << "\n";

selectFunctionsToPrint();

if (Error E = discoverStorage())
return E;
if (Error E = readSpecialSections())
Expand Down Expand Up @@ -3100,17 +3104,22 @@ static BinaryFunction *getInitFunctionIfStaticBinary(BinaryContext &BC) {
return BC.getBinaryFunctionAtAddress(BD->getAddress());
}

static void populateFunctionNames(cl::opt<std::string> &FunctionNamesFile,
cl::list<std::string> &FunctionNames) {
if (FunctionNamesFile.empty())
return;
std::ifstream FuncsFile(FunctionNamesFile, std::ios::in);
std::string FuncName;
while (std::getline(FuncsFile, FuncName))
FunctionNames.push_back(FuncName);
}

void RewriteInstance::selectFunctionsToPrint() {
populateFunctionNames(opts::PrintOnlyFile, opts::PrintOnly);
}

void RewriteInstance::selectFunctionsToProcess() {
// Extend the list of functions to process or skip from a file.
auto populateFunctionNames = [](cl::opt<std::string> &FunctionNamesFile,
cl::list<std::string> &FunctionNames) {
if (FunctionNamesFile.empty())
return;
std::ifstream FuncsFile(FunctionNamesFile, std::ios::in);
std::string FuncName;
while (std::getline(FuncsFile, FuncName))
FunctionNames.push_back(FuncName);
};
populateFunctionNames(opts::FunctionNamesFile, opts::ForceFunctionNames);
populateFunctionNames(opts::SkipFunctionNamesFile, opts::SkipFunctionNames);
populateFunctionNames(opts::FunctionNamesFileNR, opts::ForceFunctionNamesNR);
Expand Down
10 changes: 10 additions & 0 deletions bolt/lib/Utils/CommandLineOpts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,16 @@ cl::opt<bool> PrintCacheMetrics(
cl::desc("calculate and print various metrics for instruction cache"),
cl::cat(BoltOptCategory));

cl::list<std::string> PrintOnly("print-only", cl::CommaSeparated,
cl::desc("list of functions to print"),
cl::value_desc("func1,func2,func3,..."),
cl::Hidden, cl::cat(BoltCategory));

cl::opt<std::string>
PrintOnlyFile("print-only-file",
cl::desc("file with list of functions to print"), cl::Hidden,
cl::cat(BoltCategory));

cl::opt<bool> PrintSections("print-sections",
cl::desc("print all registered sections"),
cl::Hidden, cl::cat(BoltCategory));
Expand Down
25 changes: 25 additions & 0 deletions bolt/test/print-only.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Verify if `--print-only` and `--print-only-files` work fine.

# REQUIRES: system-linux

# RUN: %clang %cflags -x c %p/Inputs/bolt_icf.cpp -o %t -Wl,-q
# RUN: llvm-bolt %t -o %t.bolt --icf=none --print-cfg \
# RUN: --print-only=foo.*,bar.*,main.* 2>&1 | FileCheck %s

# RUN: echo "bar.*" > %t.pof
# RUN: echo "main.*" >> %t.pof
# RUN: llvm-bolt %t -o %t.bolt --icf=none --print-cfg \
# RUN: --print-only=foo.* --print-only-file=%t.pof \
# RUN: 2>&1 | FileCheck %s

# RUN: echo "foo.*" >> %t.pof
# RUN: llvm-bolt %t -o %t.bolt --icf=none --print-cfg \
# RUN: --print-only-file=%t.pof 2>&1 | FileCheck %s

# CHECK-NOT: Binary Function "fiz" after building cfg
# CHECK-NOT: Binary Function "faz" after building cfg
# CHECK-NOT: Binary Function "zip" after building cfg
# CHECK-NOT: Binary Function "zap" after building cfg
# CHECK: Binary Function "foo" after building cfg
# CHECK: Binary Function "bar" after building cfg
# CHECK: Binary Function "main" after building cfg
2 changes: 2 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ Potentially Breaking Changes
call the member ``operator delete`` instead of the expected global
delete operator. The old behavior is retained under ``-fclang-abi-compat=21``
flag.
- Clang warning suppressions file, ``--warning-suppression-mappings=``, now will
use the last matching entry instead of the longest one.
- Trailing null statements in GNU statement expressions are no longer
ignored by Clang; they now result in a void type. Clang previously
matched GCC's behavior, which was recently clarified to be incorrect.
Expand Down
4 changes: 2 additions & 2 deletions clang/docs/WarningSuppressionMappings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Format
Warning suppression mappings uses the same format as
:doc:`SanitizerSpecialCaseList`.

Sections describe which diagnostic group's behaviour to change, e.g.
Sections describe which diagnostic group's behavior to change, e.g.
``[unused]``. When a diagnostic is matched by multiple sections, the latest
section takes precedence.

Expand All @@ -76,7 +76,7 @@ Source files are matched against these globs either:
- as paths relative to the current working directory
- as absolute paths.

When a source file matches multiple globs in a section, the longest one takes
When a source file matches multiple globs in a section, the last one takes
precedence.

.. code-block:: bash
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/Diagnostic.h
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
/// diagnostics in specific files.
/// Mapping file is expected to be a special case list with sections denoting
/// diagnostic groups and `src` entries for globs to suppress. `emit` category
/// can be used to disable suppression. Longest glob that matches a filepath
/// can be used to disable suppression. The last glob that matches a filepath
/// takes precedence. For example:
/// [unused]
/// src:clang/*
Expand Down
14 changes: 5 additions & 9 deletions clang/lib/Basic/Diagnostic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,7 @@ std::unique_ptr<WarningsSpecialCaseList>
WarningsSpecialCaseList::create(const llvm::MemoryBuffer &Input,
std::string &Err) {
auto WarningSuppressionList = std::make_unique<WarningsSpecialCaseList>();
if (!WarningSuppressionList->createInternal(&Input, Err,
/*OrderBySize=*/true))
if (!WarningSuppressionList->createInternal(&Input, Err))
return nullptr;
return WarningSuppressionList;
}
Expand Down Expand Up @@ -588,15 +587,12 @@ bool WarningsSpecialCaseList::isDiagSuppressed(diag::kind DiagId,

StringRef F = llvm::sys::path::remove_leading_dotslash(PLoc.getFilename());

StringRef LongestSup = DiagSection->getLongestMatch("src", F, "");
if (LongestSup.empty())
unsigned LastSup = DiagSection->getLastMatch("src", F, "");
if (LastSup == 0)
return false;

StringRef LongestEmit = DiagSection->getLongestMatch("src", F, "emit");
if (LongestEmit.empty())
return true;

return LongestSup.size() > LongestEmit.size();
unsigned LastEmit = DiagSection->getLastMatch("src", F, "emit");
return LastSup > LastEmit;
}

bool DiagnosticsEngine::isSuppressedViaMapping(diag::kind DiagId,
Expand Down
6 changes: 4 additions & 2 deletions clang/lib/CIR/CodeGen/CIRGenBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,10 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
return getConstantInt(loc, getUInt32Ty(), c);
}
cir::ConstantOp getSInt64(uint64_t c, mlir::Location loc) {
cir::IntType sInt64Ty = getSInt64Ty();
return cir::ConstantOp::create(*this, loc, cir::IntAttr::get(sInt64Ty, c));
return getConstantInt(loc, getSInt64Ty(), c);
}
cir::ConstantOp getUInt64(uint64_t c, mlir::Location loc) {
return getConstantInt(loc, getUInt64Ty(), c);
}

mlir::Value createNeg(mlir::Value value) {
Expand Down
16 changes: 16 additions & 0 deletions clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,22 @@ CIRGenFunction::emitTargetBuiltinExpr(unsigned builtinID, const CallExpr *e,
getTarget().getTriple().getArch());
}

mlir::Value CIRGenFunction::emitScalarOrConstFoldImmArg(
const unsigned iceArguments, const unsigned idx, const Expr *argExpr) {
mlir::Value arg = {};
if ((iceArguments & (1 << idx)) == 0) {
arg = emitScalarExpr(argExpr);
} else {
// If this is required to be a constant, constant fold it so that we
// know that the generated intrinsic gets a ConstantInt.
const std::optional<llvm::APSInt> result =
argExpr->getIntegerConstantExpr(getContext());
assert(result && "Expected argument to be a constant");
arg = builder.getConstInt(getLoc(argExpr->getSourceRange()), *result);
}
return arg;
}

/// Given a builtin id for a function like "__builtin_fabsf", return a Function*
/// for "fabsf".
cir::FuncOp CIRGenModule::getBuiltinLibFunction(const FunctionDecl *fd,
Expand Down
25 changes: 21 additions & 4 deletions clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "clang/Basic/Builtins.h"
#include "clang/Basic/TargetBuiltins.h"
#include "clang/CIR/MissingFeatures.h"
#include "llvm/IR/IntrinsicsX86.h"

using namespace clang;
using namespace clang::CIRGen;
Expand Down Expand Up @@ -66,9 +65,8 @@ mlir::Value CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID,
getContext().GetBuiltinType(builtinID, error, &iceArguments);
assert(error == ASTContext::GE_None && "Error while getting builtin type.");

for (auto [idx, arg] : llvm::enumerate(e->arguments())) {
for (auto [idx, arg] : llvm::enumerate(e->arguments()))
ops.push_back(emitScalarOrConstFoldImmArg(iceArguments, idx, arg));
}

CIRGenBuilderTy &builder = getBuilder();
mlir::Type voidTy = builder.getVoidTy();
Expand Down Expand Up @@ -98,6 +96,10 @@ mlir::Value CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID,
case X86::BI__builtin_ia32_undef128:
case X86::BI__builtin_ia32_undef256:
case X86::BI__builtin_ia32_undef512:
cgm.errorNYI(e->getSourceRange(),
std::string("unimplemented X86 builtin call: ") +
getContext().BuiltinInfo.getName(builtinID));
return {};
case X86::BI__builtin_ia32_vec_ext_v4hi:
case X86::BI__builtin_ia32_vec_ext_v16qi:
case X86::BI__builtin_ia32_vec_ext_v8hi:
Expand All @@ -107,7 +109,22 @@ mlir::Value CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID,
case X86::BI__builtin_ia32_vec_ext_v32qi:
case X86::BI__builtin_ia32_vec_ext_v16hi:
case X86::BI__builtin_ia32_vec_ext_v8si:
case X86::BI__builtin_ia32_vec_ext_v4di:
case X86::BI__builtin_ia32_vec_ext_v4di: {
unsigned numElts = cast<cir::VectorType>(ops[0].getType()).getSize();

uint64_t index =
ops[1].getDefiningOp<cir::ConstantOp>().getIntValue().getZExtValue();

index &= numElts - 1;

cir::ConstantOp indexVal =
builder.getUInt64(index, getLoc(e->getExprLoc()));

// These builtins exist so we can ensure the index is an ICE and in range.
// Otherwise we could just do this in the header file.
return cir::VecExtractOp::create(builder, getLoc(e->getExprLoc()), ops[0],
indexVal);
}
case X86::BI__builtin_ia32_vec_set_v4hi:
case X86::BI__builtin_ia32_vec_set_v16qi:
case X86::BI__builtin_ia32_vec_set_v8hi:
Expand Down
22 changes: 0 additions & 22 deletions clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1442,28 +1442,6 @@ mlir::Value CIRGenFunction::emitPromotedScalarExpr(const Expr *e,
return ScalarExprEmitter(*this, builder).Visit(const_cast<Expr *>(e));
}

mlir::Value CIRGenFunction::emitScalarOrConstFoldImmArg(unsigned iceArguments,
unsigned index,
const Expr *arg) {
mlir::Value result{};

// The bit at the specified index indicates whether the argument is required
// to be a constant integer expression.
bool isArgRequiredToBeConstant = (iceArguments & (1 << index));

if (!isArgRequiredToBeConstant) {
result = emitScalarExpr(arg);
} else {
// If this is required to be a constant, constant fold it so that we
// know that the generated intrinsic gets a ConstantInt.
std::optional<llvm::APSInt> iceOpt =
arg->getIntegerConstantExpr(getContext());
assert(iceOpt && "Expected argument to be a constant");
result = builder.getConstInt(getLoc(arg->getSourceRange()), *iceOpt);
}
return result;
}

[[maybe_unused]] static bool mustVisitNullValue(const Expr *e) {
// If a null pointer expression's type is the C++0x nullptr_t and
// the expression is not a simple literal, it must be evaluated
Expand Down
6 changes: 3 additions & 3 deletions clang/lib/CIR/CodeGen/CIRGenFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -1546,9 +1546,6 @@ class CIRGenFunction : public CIRGenTypeCache {
mlir::Value emitScalarExpr(const clang::Expr *e,
bool ignoreResultAssign = false);

mlir::Value emitScalarOrConstFoldImmArg(unsigned iceArguments, unsigned index,
const Expr *arg);

mlir::Value emitScalarPrePostIncDec(const UnaryOperator *e, LValue lv,
cir::UnaryOpKind kind, bool isPre);

Expand Down Expand Up @@ -1721,6 +1718,9 @@ class CIRGenFunction : public CIRGenTypeCache {
void emitScalarInit(const clang::Expr *init, mlir::Location loc,
LValue lvalue, bool capturedByInit = false);

mlir::Value emitScalarOrConstFoldImmArg(unsigned iceArguments, unsigned idx,
const Expr *argExpr);

void emitStaticVarDecl(const VarDecl &d, cir::GlobalLinkageKind linkage);

void emitStoreOfComplex(mlir::Location loc, mlir::Value v, LValue dest,
Expand Down
31 changes: 31 additions & 0 deletions clang/lib/CodeGen/BackendUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,36 @@ static bool initTargetOptions(const CompilerInstance &CI,
Options.JMCInstrument = CodeGenOpts.JMCInstrument;
Options.XCOFFReadOnlyPointers = CodeGenOpts.XCOFFReadOnlyPointers;

switch (CodeGenOpts.getVecLib()) {
case llvm::driver::VectorLibrary::NoLibrary:
Options.VecLib = llvm::VectorLibrary::NoLibrary;
break;
case llvm::driver::VectorLibrary::Accelerate:
Options.VecLib = llvm::VectorLibrary::Accelerate;
break;
case llvm::driver::VectorLibrary::Darwin_libsystem_m:
Options.VecLib = llvm::VectorLibrary::DarwinLibSystemM;
break;
case llvm::driver::VectorLibrary::LIBMVEC:
Options.VecLib = llvm::VectorLibrary::LIBMVEC;
break;
case llvm::driver::VectorLibrary::MASSV:
Options.VecLib = llvm::VectorLibrary::MASSV;
break;
case llvm::driver::VectorLibrary::SVML:
Options.VecLib = llvm::VectorLibrary::SVML;
break;
case llvm::driver::VectorLibrary::SLEEF:
Options.VecLib = llvm::VectorLibrary::SLEEFGNUABI;
break;
case llvm::driver::VectorLibrary::ArmPL:
Options.VecLib = llvm::VectorLibrary::ArmPL;
break;
case llvm::driver::VectorLibrary::AMDLIBM:
Options.VecLib = llvm::VectorLibrary::AMDLIBM;
break;
}

switch (CodeGenOpts.getSwiftAsyncFramePointer()) {
case CodeGenOptions::SwiftAsyncFramePointerKind::Auto:
Options.SwiftAsyncFramePointer =
Expand Down Expand Up @@ -584,6 +614,7 @@ static void setCommandLineOpts(const CodeGenOptions &CodeGenOpts,
BackendArgs.push_back("-limit-float-precision");
BackendArgs.push_back(CodeGenOpts.LimitFloatPrecision.c_str());
}

// Check for the default "clang" invocation that won't set any cl::opt values.
// Skip trying to parse the command line invocation to avoid the issues
// described below.
Expand Down
6 changes: 3 additions & 3 deletions clang/lib/Sema/SemaOpenMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1364,15 +1364,15 @@ DSAStackTy::DSAVarData DSAStackTy::getDSA(const_iterator &Iter,
DefaultDataSharingAttributes IterDA = Iter->DefaultAttr;
switch (Iter->DefaultVCAttr) {
case DSA_VC_aggregate:
if (!D->getType()->isAggregateType())
if (!VD->getType()->isAggregateType())
IterDA = DSA_none;
break;
case DSA_VC_pointer:
if (!D->getType()->isPointerType())
if (!VD->getType()->isPointerType())
IterDA = DSA_none;
break;
case DSA_VC_scalar:
if (!D->getType()->isScalarType())
if (!VD->getType()->isScalarType())
IterDA = DSA_none;
break;
case DSA_VC_all:
Expand Down
Loading
Loading