Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenMP 5.1 omp_target_is_accessible #12

Open
jdenny-ornl opened this issue Apr 6, 2021 · 0 comments
Open

OpenMP 5.1 omp_target_is_accessible #12

jdenny-ornl opened this issue Apr 6, 2021 · 0 comments
Assignees
Labels
clacc Related to the Clacc project (OpenACC support for C/C++) runtime Related to a runtime (e.g., LLVM's openmp subproject) upstreamable Identifies work that is ready to be considered for LLVM upstream

Comments

@jdenny-ornl
Copy link

Clacc has a prototype of OpenMP 5.1's omp_target_is_accessible to support OpenACC's acc_is_present. The initial Clacc commit is 198fde1. This feature should be considered for upstreaming to LLVM as described in #10.

@jdenny-ornl jdenny-ornl added clacc Related to the Clacc project (OpenACC support for C/C++) upstreamable Identifies work that is ready to be considered for LLVM upstream labels Apr 6, 2021
@jdenny-ornl jdenny-ornl self-assigned this Apr 6, 2021
@jdenny-ornl jdenny-ornl added the runtime Related to a runtime (e.g., LLVM's openmp subproject) label Apr 7, 2021
jdenny-ornl pushed a commit that referenced this issue Apr 20, 2021
ADDI often has a frameindex in operand 1, but consumers of this
interface, such as MachineSink, tend to call getReg() on the Destination
and Source operands, leading to the following crash when building
FreeBSD after this implementation was added in 8cf6778:

```
clang: llvm/include/llvm/CodeGen/MachineOperand.h:359: llvm::Register llvm::MachineOperand::getReg() const: Assertion `isReg() && "This is not a register operand!"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
 #0 0x00007f4286f9b4d0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) llvm/lib/Support/Unix/Signals.inc:563:0
 #1 0x00007f4286f9b587 PrintStackTraceSignalHandler(void*) llvm/lib/Support/Unix/Signals.inc:630:0
 #2 0x00007f4286f9926b llvm::sys::RunSignalHandlers() llvm/lib/Support/Signals.cpp:71:0
 #3 0x00007f4286f9ae52 SignalHandler(int) llvm/lib/Support/Unix/Signals.inc:405:0
 #4 0x00007f428646ffd0 (/lib/x86_64-linux-gnu/libc.so.6+0x3efd0)
 #5 0x00007f428646ff47 raise /build/glibc-2ORdQG/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #6 0x00007f42864718b1 abort /build/glibc-2ORdQG/glibc-2.27/stdlib/abort.c:81:0
 #7 0x00007f428646142a __assert_fail_base /build/glibc-2ORdQG/glibc-2.27/assert/assert.c:89:0
 #8 0x00007f42864614a2 (/lib/x86_64-linux-gnu/libc.so.6+0x304a2)
 #9 0x00007f428d4078e2 llvm::MachineOperand::getReg() const llvm/include/llvm/CodeGen/MachineOperand.h:359:0
#10 0x00007f428d8260e7 attemptDebugCopyProp(llvm::MachineInstr&, llvm::MachineInstr&) llvm/lib/CodeGen/MachineSink.cpp:862:0
#11 0x00007f428d826442 performSink(llvm::MachineInstr&, llvm::MachineBasicBlock&, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, llvm::SmallVectorImpl<llvm::MachineInstr*>&) llvm/lib/CodeGen/MachineSink.cpp:918:0
#12 0x00007f428d826e27 (anonymous namespace)::MachineSinking::SinkInstruction(llvm::MachineInstr&, bool&, std::map<llvm::MachineBasicBlock*, llvm::SmallVector<llvm::MachineBasicBlock*, 4u>, std::less<llvm::MachineBasicBlock*>, std::allocator<std::pair<llvm::MachineBasicBlock* const, llvm::SmallVector<llvm::MachineBasicBlock*, 4u> > > >&) llvm/lib/CodeGen/MachineSink.cpp:1073:0
#13 0x00007f428d824a2c (anonymous namespace)::MachineSinking::ProcessBlock(llvm::MachineBasicBlock&) llvm/lib/CodeGen/MachineSink.cpp:410:0
#14 0x00007f428d824513 (anonymous namespace)::MachineSinking::runOnMachineFunction(llvm::MachineFunction&) llvm/lib/CodeGen/MachineSink.cpp:340:0
```

Thus, check that operand 1 is also a register in the condition.

Reviewed By: arichardson, luismarques

Differential Revision: https://reviews.llvm.org/D89090
clementval pushed a commit that referenced this issue Jun 21, 2021
Rust's v0 name mangling scheme [1] is easy to disambiguate from other
name mangling schemes because symbols always start with `_R`. The llvm
Demangle library supports demangling the Rust v0 scheme. Use it to
demangle Rust symbols.

Added unit tests that check simple symbols. Ran LLDB built with this
patch to debug some Rust programs compiled with the v0 name mangling
scheme. Confirmed symbol names were demangled as expected.

Note: enabling the new name mangling scheme requires a nightly
toolchain:

```
$ cat main.rs
fn main() {
    println!("Hello world!");
}
$ $(rustup which --toolchain nightly rustc) -Z symbol-mangling-version=v0 main.rs -g
$ /home/asm/hacking/llvm/build/bin/lldb ./main --one-line 'b main.rs:2'
(lldb) target create "./main"
Current executable set to '/home/asm/hacking/llvm/rust/main' (x86_64).
(lldb) b main.rs:2
Breakpoint 1: where = main`main::main + 4 at main.rs:2:5, address = 0x00000000000076a4
(lldb) r
Process 948449 launched: '/home/asm/hacking/llvm/rust/main' (x86_64)
warning: (x86_64) /lib64/libgcc_s.so.1 No LZMA support found for reading .gnu_debugdata section
Process 948449 stopped
* thread #1, name = 'main', stop reason = breakpoint 1.1
    frame #0: 0x000055555555b6a4 main`main::main at main.rs:2:5
   1    fn main() {
-> 2        println!("Hello world!");
   3    }
(lldb) bt
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0
* thread #1, name = 'main', stop reason = breakpoint 1.1
  * frame #0: 0x000055555555b6a4 main`main::main at main.rs:2:5
    frame #1: 0x000055555555b78b main`<fn() as core::ops::function::FnOnce<()>>::call_once((null)=(main`main::main at main.rs:1), (null)=<unavailable>) at function.rs:227:5
    frame #2: 0x000055555555b66e main`std::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>(f=(main`main::main at main.rs:1)) at backtrace.rs:125:18
    frame #3: 0x000055555555b851 main`std::rt::lang_start::<()>::{closure#0} at rt.rs:49:18
    frame #4: 0x000055555556c9f9 main`std::rt::lang_start_internal::hc51399759a90501a [inlined] core::ops::function::impls::_$LT$impl$u20$core..ops..function..FnOnce$LT$A$GT$$u20$for$u20$$RF$F$GT$::call_once::h04259e4a34d07c2f at function.rs:259:13
    frame #5: 0x000055555556c9f2 main`std::rt::lang_start_internal::hc51399759a90501a [inlined] std::panicking::try::do_call::hb8da45704d5cfbbf at panicking.rs:401:40
    frame #6: 0x000055555556c9f2 main`std::rt::lang_start_internal::hc51399759a90501a [inlined] std::panicking::try::h4beadc19a78fec52 at panicking.rs:365:19
    frame #7: 0x000055555556c9f2 main`std::rt::lang_start_internal::hc51399759a90501a [inlined] std::panic::catch_unwind::hc58016cd36ba81a4 at panic.rs:433:14
    frame #8: 0x000055555556c9f2 main`std::rt::lang_start_internal::hc51399759a90501a at rt.rs:34:21
    frame #9: 0x000055555555b830 main`std::rt::lang_start::<()>(main=(main`main::main at main.rs:1), argc=1, argv=0x00007fffffffcb18) at rt.rs:48:5
    frame #10: 0x000055555555b6fc main`main + 28
    frame #11: 0x00007ffff73f2493 libc.so.6`__libc_start_main + 243
    frame #12: 0x000055555555b59e main`_start + 46
(lldb)
```

[1]: rust-lang/rust#60705

Reviewed By: clayborg, teemperor

Differential Revision: https://reviews.llvm.org/D104054
clementval pushed a commit that referenced this issue Jun 28, 2021
For now, the source variable locations are printed at about the same
space as the comments for disassembled code, which can make some ranges
for variables disappear if a line contains comments, for example:

                                        ┠─ bar = W1
0:  add x0, x2, #2, lsl #12     // =8192┃
4:  add z31.d, z31.d, llvm#65280    // =0xff00
8:  nop                                 ┻

The patch shifts the report a bit to allow printing comments up to
approximately 16 characters without interferences.

Differential Revision: https://reviews.llvm.org/D104700
clementval pushed a commit that referenced this issue Jul 30, 2021
There is a SIGSEGV at `DeduceTemplateArgumentsByTypeMatch`. The bug [llvm#51171](https://bugs.llvm.org/show_bug.cgi?id=51171) was filled. The reproducer can be found at the bug description.

LIT test for the issue was added:
```
./bin/llvm-lit -v ../clang/test/SemaCXX/pr51171-crash.cpp
```

The debug stack trace is below:
```
 #0 0x00000000055afcb9 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/ivanmurashko/local/llvm-project/llvm/lib/Support/Unix/Signals.inc:565:22
 #1 0x00000000055afd70 PrintStackTraceSignalHandler(void*) /home/ivanmurashko/local/llvm-project/llvm/lib/Support/Unix/Signals.inc:632:1
 #2 0x00000000055add2d llvm::sys::RunSignalHandlers() /home/ivanmurashko/local/llvm-project/llvm/lib/Support/Signals.cpp:97:20
 #3 0x00000000055af701 SignalHandler(int) /home/ivanmurashko/local/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1
 #4 0x00007ffff7bc2b20 __restore_rt sigaction.c:0:0
 #5 0x00007ffff66a337f raise (/lib64/libc.so.6+0x3737f)
 #6 0x00007ffff668ddb5 abort (/lib64/libc.so.6+0x21db5)
 #7 0x00007ffff668dc89 _nl_load_domain.cold.0 loadmsgcat.c:0:0
 #8 0x00007ffff669ba76 .annobin___GI___assert_fail.end assert.c:0:0
 #9 0x000000000594b210 clang::QualType::getCommonPtr() const /home/ivanmurashko/local/llvm-project/clang/include/clang/AST/Type.h:684:5
#10 0x0000000005a12ca6 clang::QualType::getCanonicalType() const /home/ivanmurashko/local/llvm-project/clang/include/clang/AST/Type.h:6467:36
#11 0x0000000005a137a6 clang::ASTContext::getCanonicalType(clang::QualType) const /home/ivanmurashko/local/llvm-project/clang/include/clang/AST/ASTContext.h:2433:58
#12 0x0000000009204584 DeduceTemplateArgumentsByTypeMatch(clang::Sema&, clang::TemplateParameterList*, clang::QualType, clang::QualType, clang::sema::TemplateDeductionInfo&, llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int, bool, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp:1355:54
#13 0x000000000920df0d clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*, clang::TemplateArgumentListInfo*, clang::QualType, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp:4354:47
#14 0x0000000009012b09 (anonymous namespace)::AddressOfFunctionResolver::AddMatchingTemplateFunction(clang::FunctionTemplateDecl*, clang::DeclAccessPair const&) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:12026:38
#15 0x0000000009013030 (anonymous namespace)::AddressOfFunctionResolver::FindAllFunctionsThatMatchTargetTypeExactly() /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:12119:9
#16 0x0000000009012679 (anonymous namespace)::AddressOfFunctionResolver::AddressOfFunctionResolver(clang::Sema&, clang::Expr*, clang::QualType const&, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:11931:5
#17 0x0000000009013c91 clang::Sema::ResolveAddressOfOverloadedFunction(clang::Expr*, clang::QualType, bool, clang::DeclAccessPair&, bool*) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:12286:42
#18 0x0000000008fed85d IsStandardConversion(clang::Sema&, clang::Expr*, clang::QualType, bool, clang::StandardConversionSequence&, bool, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:1712:49
#19 0x0000000008fec8ea TryImplicitConversion(clang::Sema&, clang::Expr*, clang::QualType, bool, clang::Sema::AllowedExplicit, bool, bool, bool, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:1433:27
#20 0x0000000008ff90ba TryCopyInitialization(clang::Sema&, clang::Expr*, clang::QualType, bool, bool, bool, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:5273:71
#21 0x00000000090024fb clang::Sema::AddBuiltinCandidate(clang::QualType*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, unsigned int) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:7755:32
#22 0x000000000900513f (anonymous namespace)::BuiltinOperatorOverloadBuilder::addGenericBinaryArithmeticOverloads() /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:8633:30
#23 0x0000000009007624 clang::Sema::AddBuiltinOperatorCandidates(clang::OverloadedOperatorKind, clang::SourceLocation, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:9205:51
#24 0x0000000009018734 clang::Sema::LookupOverloadedBinOp(clang::OverloadCandidateSet&, clang::OverloadedOperatorKind, clang::UnresolvedSetImpl const&, llvm::ArrayRef<clang::Expr*>, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:13469:1
#25 0x0000000009018d56 clang::Sema::CreateOverloadedBinOp(clang::SourceLocation, clang::BinaryOperatorKind, clang::UnresolvedSetImpl const&, clang::Expr*, clang::Expr*, bool, bool, clang::FunctionDecl*) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaOverload.cpp:13568:24
#26 0x0000000008b24797 BuildOverloadedBinOp(clang::Sema&, clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaExpr.cpp:14606:65
#27 0x0000000008b24ed5 clang::Sema::BuildBinOp(clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaExpr.cpp:14691:73
llvm#28 0x0000000008b245d4 clang::Sema::ActOnBinOp(clang::Scope*, clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) /home/ivanmurashko/local/llvm-project/clang/lib/Sema/SemaExpr.cpp:14566:1
llvm#29 0x00000000085bfafb clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*, true>, clang::prec::Level) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/ParseExpr.cpp:630:71
llvm#30 0x00000000085bd922 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/ParseExpr.cpp:177:1
llvm#31 0x00000000085cbbcd clang::Parser::ParseExpressionList(llvm::SmallVectorImpl<clang::Expr*>&, llvm::SmallVectorImpl<clang::SourceLocation>&, llvm::function_ref<void ()>) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/ParseExpr.cpp:3368:40
llvm#32 0x000000000857f49c clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/ParseDecl.cpp:2416:5
llvm#33 0x000000000857df16 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/ParseDecl.cpp:2092:65
llvm#34 0x000000000855f07b clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/Parser.cpp:1138:1
llvm#35 0x000000000855f136 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/Parser.cpp:1153:57
llvm#36 0x000000000855e644 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/Parser.cpp:975:58
llvm#37 0x000000000855d717 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/Parser.cpp:720:42
llvm#38 0x0000000008558e01 clang::ParseAST(clang::Sema&, bool, bool) /home/ivanmurashko/local/llvm-project/clang/lib/Parse/ParseAST.cpp:158:37
llvm#39 0x000000000627a221 clang::ASTFrontendAction::ExecuteAction() /home/ivanmurashko/local/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1058:11
llvm#40 0x0000000006bdcc31 clang::CodeGenAction::ExecuteAction() /home/ivanmurashko/local/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1045:5
llvm#41 0x0000000006279b4d clang::FrontendAction::Execute() /home/ivanmurashko/local/llvm-project/clang/lib/Frontend/FrontendAction.cpp:955:38
llvm#42 0x00000000061c3fe9 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/ivanmurashko/local/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:974:42
llvm#43 0x00000000063f9c5e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/ivanmurashko/local/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:278:38
llvm#44 0x0000000002603a03 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/ivanmurashko/local/llvm-project/clang/tools/driver/cc1_main.cpp:246:40
llvm#45 0x00000000025f8a39 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) /home/ivanmurashko/local/llvm-project/clang/tools/driver/driver.cpp:338:20
llvm#46 0x00000000025f9107 main /home/ivanmurashko/local/llvm-project/clang/tools/driver/driver.cpp:415:26
llvm#47 0x00007ffff668f493 __libc_start_main (/lib64/libc.so.6+0x23493)
llvm#48 0x00000000025f729e _start (/data/users/ivanmurashko/llvm-project/build/bin/clang-13+0x25f729e)
```

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D106583
clementval pushed a commit that referenced this issue Aug 3, 2021
…shifted

Add a comment when there is a shifted value,
    add x9, x0, llvm#291, lsl #12 ; =1191936
but not when the immediate value is unshifted,
    subs x9, x0, llvm#256 ; =256
when the comment adds nothing additional to the reader.

Differential Revision: https://reviews.llvm.org/D107196
jdenny-ornl pushed a commit that referenced this issue Sep 2, 2021
This reverts commit a2768b4.

Breaks sanitizer-x86_64-linux-fast buildbot:
https://lab.llvm.org/buildbot/#/builders/5/builds/11334

Log snippet:
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80
FAIL: LLVM :: Transforms/SampleProfile/early-inline.ll (65549 of 78729)
******************** TEST 'LLVM :: Transforms/SampleProfile/early-inline.ll' FAILED ********************
Script:
--
: 'RUN: at line 1';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/early-inline.ll -instcombine -sample-profile -sample-profile-file=/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/Inputs/einline.prof -S | /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/early-inline.ll
--
Exit Code: 2
Command Output (stderr):
--
/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1309:53: runtime error: member call on null pointer of type 'llvm::sampleprof::FunctionSamples'
    #0 0x5a730f8 in shouldInlineCandidate /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1309:53
    #1 0x5a730f8 in (anonymous namespace)::SampleProfileLoader::tryInlineCandidate((anonymous namespace)::InlineCandidate&, llvm::SmallVector<llvm::CallBase*, 8u>*) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1178:21
    #2 0x5a6cda6 in inlineHotFunctions /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1105:13
    #3 0x5a6cda6 in (anonymous namespace)::SampleProfileLoader::emitAnnotations(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1633:16
    #4 0x5a5fcbe in runOnFunction /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:2008:12
    #5 0x5a5fcbe in (anonymous namespace)::SampleProfileLoader::runOnModule(llvm::Module&, llvm::AnalysisManager<llvm::Module>*, llvm::ProfileSummaryInfo*, llvm::CallGraph*) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1922:15
    #6 0x5a5de55 in llvm::SampleProfileLoaderPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:2038:21
    #7 0x6552a01 in llvm::detail::PassModel<llvm::Module, llvm::SampleProfileLoaderPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:88:17
    #8 0x57f807c in llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/IR/PassManager.h:526:21
    #9 0x37c8522 in llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::StringRef>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/opt/NewPMDriver.cpp:489:7
    #10 0x37e7c11 in main /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/opt/opt.cpp:830:12
    #11 0x7fbf4de4009a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    #12 0x379e519 in _start (/b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt+0x379e519)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1309:53 in
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/early-inline.ll
--
********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80
FAIL: LLVM :: Transforms/SampleProfile/inline-cold.ll (65643 of 78729)
******************** TEST 'LLVM :: Transforms/SampleProfile/inline-cold.ll' FAILED ********************
Script:
--
: 'RUN: at line 4';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll -sample-profile -sample-profile-file=/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/Inputs/inline-cold.prof -S | /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck -check-prefix=NOTINLINE /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll
: 'RUN: at line 5';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll -passes=sample-profile -sample-profile-file=/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/Inputs/inline-cold.prof -S | /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck -check-prefix=NOTINLINE /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll
: 'RUN: at line 8';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll -sample-profile -sample-profile-file=/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/Inputs/inline-cold.prof -sample-profile-inline-size -S | /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck -check-prefix=INLINE /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll
: 'RUN: at line 11';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll -passes=sample-profile -sample-profile-file=/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/Inputs/inline-cold.prof -sample-profile-inline-size -sample-profile-cold-inline-threshold=9999999 -S | /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck -check-prefix=INLINE /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll
: 'RUN: at line 14';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll -passes=sample-profile -sample-profile-file=/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/Inputs/inline-cold.prof -sample-profile-inline-size -sample-profile-cold-inline-threshold=-500 -S | /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck -check-prefix=NOTINLINE /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll
--
Exit Code: 2
Command Output (stderr):
--
/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1309:53: runtime error: member call on null pointer of type 'llvm::sampleprof::FunctionSamples'
    #0 0x5a730f8 in shouldInlineCandidate /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1309:53
    #1 0x5a730f8 in (anonymous namespace)::SampleProfileLoader::tryInlineCandidate((anonymous namespace)::InlineCandidate&, llvm::SmallVector<llvm::CallBase*, 8u>*) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1178:21
    #2 0x5a6cda6 in inlineHotFunctions /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1105:13
    #3 0x5a6cda6 in (anonymous namespace)::SampleProfileLoader::emitAnnotations(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1633:16
    #4 0x5a5fcbe in runOnFunction /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:2008:12
    #5 0x5a5fcbe in (anonymous namespace)::SampleProfileLoader::runOnModule(llvm::Module&, llvm::AnalysisManager<llvm::Module>*, llvm::ProfileSummaryInfo*, llvm::CallGraph*) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1922:15
    #6 0x5a5de55 in llvm::SampleProfileLoaderPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:2038:21
    #7 0x6552a01 in llvm::detail::PassModel<llvm::Module, llvm::SampleProfileLoaderPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:88:17
    #8 0x57f807c in llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/IR/PassManager.h:526:21
    #9 0x37c8522 in llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::StringRef>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/opt/NewPMDriver.cpp:489:7
    #10 0x37e7c11 in main /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/opt/opt.cpp:830:12
    #11 0x7fcd534a209a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    #12 0x379e519 in _start (/b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt+0x379e519)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Transforms/IPO/SampleProfile.cpp:1309:53 in
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /b/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/FileCheck -check-prefix=INLINE /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/Transforms/SampleProfile/inline-cold.ll
--
********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
********************
Failed Tests (2):
  LLVM :: Transforms/SampleProfile/early-inline.ll
  LLVM :: Transforms/SampleProfile/inline-cold.ll
jdenny-ornl pushed a commit that referenced this issue Oct 8, 2021
Although THREADLOCAL variables are supported on Darwin they cannot be
used very early on during process init (before dyld has set it up).

Unfortunately the checked lock is used before dyld has setup TLS leading
to an abort call (`_tlv_boostrap()` is never supposed to be called at
runtime).

To avoid this problem `SANITIZER_CHECK_DEADLOCKS` is now disabled on
Darwin platforms. This fixes running TSan tests (an possibly other
Sanitizers) when `COMPILER_RT_DEBUG=ON`.

For reference the crashing backtrace looks like this:

```
* thread #1, stop reason = signal SIGABRT
  * frame #0: 0x00000002044da0ae dyld`__abort_with_payload + 10
    frame #1: 0x00000002044f01af dyld`abort_with_payload_wrapper_internal + 80
    frame #2: 0x00000002044f01e1 dyld`abort_with_payload + 9
    frame #3: 0x000000010c989060 dyld_sim`abort_with_payload + 26
    frame #4: 0x000000010c94908b dyld_sim`dyld4::halt(char const*) + 375
    frame #5: 0x000000010c988f5c dyld_sim`abort + 16
    frame #6: 0x000000010c96104f dyld_sim`dyld4::APIs::_tlv_bootstrap() + 9
    frame #7: 0x000000010cd8d6d2 libclang_rt.tsan_iossim_dynamic.dylib`__sanitizer::CheckedMutex::LockImpl(this=<unavailable>, pc=<unavailable>) at sanitizer_mutex.cpp:218:58 [opt]
    frame #8: 0x000000010cd8a0f7 libclang_rt.tsan_iossim_dynamic.dylib`__sanitizer::Mutex::Lock() [inlined] __sanitizer::CheckedMutex::Lock(this=0x000000010d733c90) at sanitizer_mutex.h:124:5 [opt]
    frame #9: 0x000000010cd8a0ee libclang_rt.tsan_iossim_dynamic.dylib`__sanitizer::Mutex::Lock(this=0x000000010d733c90) at sanitizer_mutex.h:162:19 [opt]
    frame #10: 0x000000010cd8a0bf libclang_rt.tsan_iossim_dynamic.dylib`__sanitizer::GenericScopedLock<__sanitizer::Mutex>::GenericScopedLock(this=0x000000030c7479a8, mu=<unavailable>) at sanitizer_mutex.h:364:10 [opt]
    frame #11: 0x000000010cd89819 libclang_rt.tsan_iossim_dynamic.dylib`__sanitizer::GenericScopedLock<__sanitizer::Mutex>::GenericScopedLock(this=0x000000030c7479a8, mu=<unavailable>) at sanitizer_mutex.h:363:67 [opt]
    frame #12: 0x000000010cd8985b libclang_rt.tsan_iossim_dynamic.dylib`__sanitizer::LibIgnore::OnLibraryLoaded(this=0x000000010d72f480, name=0x0000000000000000) at sanitizer_libignore.cpp:39:8 [opt]
    frame #13: 0x000000010cda7aaa libclang_rt.tsan_iossim_dynamic.dylib`__tsan::InitializeLibIgnore() at tsan_interceptors_posix.cpp:219:16 [opt]
    frame #14: 0x000000010cdce0bb libclang_rt.tsan_iossim_dynamic.dylib`__tsan::Initialize(thr=0x0000000110141400) at tsan_rtl.cpp:403:3 [opt]
    frame #15: 0x000000010cda7b8e libclang_rt.tsan_iossim_dynamic.dylib`__tsan::ScopedInterceptor::ScopedInterceptor(__tsan::ThreadState*, char const*, unsigned long) [inlined] __tsan::LazyInitialize(thr=0x0000000110141400) at tsan_rtl.h:665:5 [opt]
    frame #16: 0x000000010cda7b86 libclang_rt.tsan_iossim_dynamic.dylib`__tsan::ScopedInterceptor::ScopedInterceptor(this=0x000000030c747af8, thr=0x0000000110141400, fname=<unavailable>, pc=4568918787) at tsan_interceptors_posix.cpp:247:3 [opt]
    frame #17: 0x000000010cda7bb9 libclang_rt.tsan_iossim_dynamic.dylib`__tsan::ScopedInterceptor::ScopedInterceptor(this=0x000000030c747af8, thr=<unavailable>, fname=<unavailable>, pc=<unavailable>) at tsan_interceptors_posix.cpp:246:59 [opt]
    frame #18: 0x000000010cdb72b7 libclang_rt.tsan_iossim_dynamic.dylib`::wrap_strlcpy(dst="\xd2", src="0xd1d398d1bb0a007b", size=20) at sanitizer_common_interceptors.inc:7386:3 [opt]
    frame #19: 0x0000000110542b03 libsystem_c.dylib`__guard_setup + 140
    frame #20: 0x00000001104f8ab4 libsystem_c.dylib`_libc_initializer + 65
    ...
```

rdar://83723445

Differential Revision: https://reviews.llvm.org/D111243
jdenny-ornl pushed a commit that referenced this issue Oct 16, 2021
Optimize ([add|sub] r, imm) -> ([ADD|SUB] ([ADD|SUB] r, #imm0, lsl #12), #imm1),
if imm == (imm0<<12)+imm1. and both imm0 and imm1 are non-zero 12-bit unsigned
integers.

Optimize ([add|sub] r, imm) -> ([SUB|ADD] ([SUB|ADD] r, #imm0, lsl #12), #imm1),
if imm == -(imm0<<12)-imm1, and both imm0 and imm1 are non-zero 12-bit unsigned
integers.

Reviewed By: jaykang10, dmgreen

Differential Revision: https://reviews.llvm.org/D111034
jdenny-ornl pushed a commit that referenced this issue Oct 23, 2021
…tor"

This reverts commit cac8808.

 #5 0x00007f28ec629859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x25859)
 #6 0x00007f28ec629729 (/lib/x86_64-linux-gnu/libc.so.6+0x25729)
 #7 0x00007f28ec63af36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #8 0x00007f28ecc2cc46 llvm::APInt::compareSigned(llvm::APInt const&) const (libLLVMSupport.so.14git+0xeac46)
 #9 0x00007f28e7bbf957 (anonymous namespace)::SymbolicRangeInferrer::VisitBinaryOperator(clang::ento::RangeSet, clang::BinaryOperatorKind, clang::ento::RangeSet, clang::QualType) (libclangStaticAnalyzerCore.so.14git+0x1df957)
 #10 0x00007f28e7bbf2db (anonymous namespace)::SymbolicRangeInferrer::infer(clang::ento::SymExpr const*) (libclangStaticAnalyzerCore.so.14git+0x1df2db)
 #11 0x00007f28e7bb2b5e (anonymous namespace)::RangeConstraintManager::assumeSymNE(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*, llvm::APSInt const&, llvm::APSInt const&) (libclangStaticAnalyzerCore.so.14git+0x1d2b5e)
 #12 0x00007f28e7bc67af clang::ento::RangedConstraintManager::assumeSymUnsupported(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*, bool) (libclangStaticAnalyzerCore.so.14git+0x1e67af)
 #13 0x00007f28e7be3578 clang::ento::SimpleConstraintManager::assumeAux(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::NonLoc, bool) (libclangStaticAnalyzerCore.so.14git+0x203578)
 #14 0x00007f28e7be33d8 clang::ento::SimpleConstraintManager::assume(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::NonLoc, bool) (libclangStaticAnalyzerCore.so.14git+0x2033d8)
 #15 0x00007f28e7be32fb clang::ento::SimpleConstraintManager::assume(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::DefinedSVal, bool) (libclangStaticAnalyzerCore.so.14git+0x2032fb)
 #16 0x00007f28e7b15dbc clang::ento::ConstraintManager::assumeDual(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::DefinedSVal) (libclangStaticAnalyzerCore.so.14git+0x135dbc)
 #17 0x00007f28e7b4780f clang::ento::ExprEngine::evalEagerlyAssumeBinOpBifurcation(clang::ento::ExplodedNodeSet&, clang::ento::ExplodedNodeSet&, clang::Expr const*) (libclangStaticAnalyzerCore.so.14git+0x16780f)

This is known to be triggered on curl, tinyxml2, tmux, twin and on xerces.
But @bjope also reported similar crashes.
So, I'm reverting it to make our internal bots happy again.

Differential Revision: https://reviews.llvm.org/D106102
stelleg pushed a commit that referenced this issue Oct 28, 2021
commit 9eef73e8b7b5dab5d8e04a0fa584fd765e5b1d13
Author: TB Schardl <[email protected]>
Date:   Fri Aug 4 01:43:13 2017 +0000

    [TRE] Fix bug with Tapir modification of TRE that was causing unit tests to fail.

commit 92b16128f980b6683cb53a324480d7305f4327d4
Author: TB Schardl <[email protected]>
Date:   Thu Aug 3 13:10:01 2017 +0000

    [README] Attempting to clean up README file.

commit fa242e0f01133707c3a483cfabedf3ee28abba7a
Merge: a8e2b795fb3 f55a27066ac
Author: TB Schardl <[email protected]>
Date:   Thu Aug 3 12:52:13 2017 +0000

    Merge branch 'master' of github.com:wsmoses/Parallel-IR

commit a8e2b795fb34c87cd2c884235c3b50be0c17c3e7
Author: TB Schardl <[email protected]>
Date:   Thu Aug 3 12:49:10 2017 +0000

    [README] Updated README.

commit f55a27066ac03e39e6a01ca30e86bc48df76fa7e
Author: William S. Moses <[email protected]>
Date:   Tue Aug 1 20:17:47 2017 +0200

    Add CircleCI

commit 964b5bea84c59cdc7e27bc07e98f12edc821c4fc
Author: TB Schardl <[email protected]>
Date:   Wed Aug 2 21:35:11 2017 +0000

    [LoopSpawning] Correctly handle Tapir loops where the loop body uses the variable storing the number of loop iterations.  Fixes #13

commit 8d4f443d9c9b78478279d598c4eb9abd79db1e59
Merge: 452aac7e148 ef122d645a8
Author: TB Schardl <[email protected]>
Date:   Wed Aug 2 21:35:22 2017 +0000

    Merge branch 'master' of github.com:wsmoses/Parallel-IR

commit 452aac7e14852491121f7ca26f24f420414a5245
Author: TB Schardl <[email protected]>
Date:   Wed Aug 2 21:35:11 2017 +0000

    [LoopSpawning] Correctly handle Tapir loops where the loop body uses the variable storing the number of loop iterations.  Fixes #13

commit ef122d645a83c9ad9ee743329208ee001071a4f2
Author: William S. Moses <[email protected]>
Date:   Tue Aug 1 20:17:47 2017 +0200

    Add CircleCI

commit 9be75a22ad015c307665d277994651671a15ae60
Author: TB Schardl <[email protected]>
Date:   Mon Jul 10 15:57:49 2017 +0000

    [CSI] Bug fixes and refactoring of the CSI instrumentation pass.

commit 6ce5f2f27b1bc2d92e48420376c2a37d1608f3a1
Author: TB Schardl <[email protected]>
Date:   Mon Jul 10 13:37:39 2017 +0000

    [Tapir] Allow Tapir lowering to Cilk to fill in missing definitions of internal Cilk types, including __cilkrts_worker and __cilkrts_pedigree.

commit 631e4626d2ba614eaf8a68113c2fdf02f9f8e246
Author: TB Schardl <[email protected]>
Date:   Fri Jun 30 21:33:54 2017 +0000

    [DetachSSA] Initial implementation of an analysis pass that tracks the creation and synchronization of detached tasks.  This analysis is based on MemorySSA.

commit 923a9052c95c43df1405fad56f2cb1ef12a47412
Author: TB Schardl <[email protected]>
Date:   Tue Jun 27 21:54:51 2017 +0000

    [Tapir] Adding support for sync regions.

    A sync region is designated by a token emitted by a call to
    @llvm.syncregion.start.  The detach, reattach, and sync instructions
    all take this token as a parameter.  A sync instruction in a sync
    region SR only waits on computations detached from detach instructions
    in the same sync region or in a detached descendant thereof.  By
    convention, a call to @llvm.syncregion.start occurs in an entry block,
    that is, either the entry block of a function or the entry block of a
    detached sub-CFG.

    For Cilk programs, a sync region is started for any function that
    performs a _Cilk_spawn or _Cilk_sync.  A separate sync region is
    also started for each _Cilk_for in the function.

    Sync regions address two issues with sync instructions.  First, with
    sync regions, the implicit sync at the end of a _Cilk_for only waits
    on the parallel iterations of that _Cilk_for, not on any other spawned
    computation within the function.  Second, when a function is inlined,
    any _Cilk_sync performed by that function will not erroneously wait on
    detached computations in its caller.

    This commit includes simple cleanup passes involving sync regions.
    One form of cleanup removes sync instructions in sync regions that
    contain no detach instructions.  Another form removes empty sync
    regions, i.e., calls to @llvm.syncregion.start whose produced token is
    never used.  Future work will analyze sync regions more carefully and
    combine them when it is deemed safe.

commit 9b55aac80aca2a520ba7627a020af413be18a29f
Merge: 9b5abba8e85 eece7bcb178
Author: TB Schardl <[email protected]>
Date:   Sat Jun 3 12:42:01 2017 +0000

    Merge branch 'master' of github.com:llvm-mirror/llvm

commit 9b5abba8e85b01c08d49885fdc6d871ed0e522e9
Merge: 51a4df5f3e5 6ef5e10ad7e
Author: TB Schardl <[email protected]>
Date:   Wed May 31 02:07:52 2017 +0000

    Merge branch 'master' of github.com:llvm-mirror/llvm

commit 51a4df5f3e536a65c0a926ee7c87eb47c80aec7f
Merge: 6f69cdf478c 0559b4fa45c
Author: TB Schardl <[email protected]>
Date:   Tue May 30 18:19:52 2017 +0000

    Merge branch 'master' of github.com:llvm-mirror/llvm

commit 6f69cdf478cc2801c74964e3a233ad46d16245cc
Author: William S. Moses <[email protected]>
Date:   Mon May 15 01:15:30 2017 -0400

    remove Rhino print

commit d719d172fd8967cccb6625ff1ec54e439cdfe989
Merge: d2b4d301879 2db0ffd4753
Author: William S. Moses <[email protected]>
Date:   Mon May 15 01:04:30 2017 -0400

    Merge branch '6898' of github.com:wsmoses/Parallel-IR into 6898

commit d2b4d301879c0a75cbbd9d7c49e51581543ff08b
Author: William S. Moses <[email protected]>
Date:   Mon May 15 01:04:14 2017 -0400

    pushing rhino flag

commit 2db0ffd47534ee35deaea877d73d8484cb94c01f
Author: Douglas Kogut <[email protected]>
Date:   Mon May 15 00:24:54 2017 -0400

    spawn unswitch

commit 8f57e0739bf9fc6736472c89f91a533630efd5c3
Merge: 9660ce4abc0 be7eafc7179
Author: William S. Moses <[email protected]>
Date:   Sun May 14 17:36:17 2017 -0400

    Merge branch 'master' of github.com:wsmoses/Parallel-IR into 6898

commit 9660ce4abc060598a20b7c5d30a217bdc3af569e
Merge: 002fb57bb06 780934e4b6a
Author: William S. Moses <[email protected]>
Date:   Sun May 14 17:35:58 2017 -0400

    Merge branch 'master' into 6898

commit 002fb57bb069f18319ceab0d287c22166999a766
Merge: 35669cce54f acefa6d5a77
Author: William S. Moses <[email protected]>
Date:   Sun May 14 15:32:41 2017 -0400

    Merge branch '6898' of github.com:wsmoses/Parallel-IR into 6898

commit acefa6d5a77cad0cb2da8f5c6cfe3af1ca15129e
Author: Douglas Kogut <[email protected]>
Date:   Sun May 14 14:58:08 2017 -0400

    spawn unswitch

commit be7eafc7179b8591b0007a25a2e3aae31cfc7818
Author: TB Schardl <[email protected]>
Date:   Tue May 9 21:34:49 2017 +0000

    [Mem2Reg] Updated Mem2Reg to find the entry blocks of the function and all detached sub-CFG's more efficiently.

commit 12f929ae136d57fd9e744bc2dac8c072d01e2053
Author: TB Schardl <[email protected]>
Date:   Tue May 9 21:15:58 2017 +0000

    [CilkABI] Marked additional loads and stores to CilkRTS stack frames as volatile.  Fixed bug in extracting exception-handling exit blocks for detached CFG's.

commit 9bf9a4d58c9f3a09164b8a86202bcee2f5abf553
Author: TB Schardl <[email protected]>
Date:   Tue May 9 21:14:33 2017 +0000

    [InstCombine] Fixed bug to prevent InstructionCombining pass from sinking operations that read memory across Tapir instructions.

commit 719872be7ce9d8cdbc7036c6eb7d3d77ebeff5cf
Merge: f63b0fed940 10826f2652f
Author: Douglas Kogut <[email protected]>
Date:   Fri Apr 28 20:39:49 2017 -0400

    Merge branch '6898' of github.com:wsmoses/Parallel-IR into 6898

commit f63b0fed9406ac9f5f8b54626a9c6ef965cceaba
Author: Douglas Kogut <[email protected]>
Date:   Fri Apr 28 20:39:34 2017 -0400

    pushing measuring scripts

commit 991ca791848c9936677a0b7184a77cf0eaf6734d
Author: TB Schardl <[email protected]>
Date:   Wed Apr 26 12:17:07 2017 +0000

    [LoopSpawning] Cleaning up code for handling exceptional exits.

commit 10826f2652fea87d11ec166954c2d7b02917c21d
Author: Jiahao Li <[email protected]>
Date:   Tue Apr 25 23:24:56 2017 -0400

    Alters sync elimination pfor microbenchmark.

commit 9d5172300fcd2528dc4db210beccfa6cecb7816f
Author: Jiahao Li <[email protected]>
Date:   Tue Apr 25 23:07:07 2017 -0400

    Makes LoopFusePass work.

commit 46720980313325bf80262b8fd447db8e90f1c307
Author: TB Schardl <[email protected]>
Date:   Wed Apr 26 00:10:42 2017 +0000

    [LoopSpawning] Bug fix to find all exception-handling exit blocks of a Tapir loop.

commit 48e7791f51c0a3b0fc27cc280e458892dac30fbd
Author: TB Schardl <[email protected]>
Date:   Tue Apr 25 01:30:48 2017 +0000

    [Tapir] Preliminary support for C++ exceptions on Linux.

commit 4613a6461de60516a6242270e4c6cd7beb1c5bec
Author: TB Schardl <[email protected]>
Date:   Tue Apr 25 01:28:09 2017 +0000

    [CSI] Updated CSI pass to support separate property types per IR object.

commit d5331895cb2d1437b7788469ac72c731b65a949b
Author: Jiahao Li <[email protected]>
Date:   Sat Apr 22 15:21:03 2017 -0400

    Have makefile for sync_elimination_pfor_mb emit .ll for the sync eliminated version.

commit 3b2b3c3429af3f1a173970cef45844639d35361b
Author: Jiahao Li <[email protected]>
Date:   Sat Apr 22 15:09:04 2017 -0400

    Cleans up makefile for sync_elimination_pfor_mb.

commit 21aa2bbee01f1dbc86681a7ed78b7cfd8fd611d5
Author: Bojan Serafimov <[email protected]>
Date:   Sat Apr 22 14:57:32 2017 -0400

    Fix compile error

commit 0c5e6d15f12288dc29e9f08ff9d011c1204f69ba
Author: Jiahao Li <[email protected]>
Date:   Sat Apr 22 14:45:38 2017 -0400

    Fixes sync_elimination_pfor_mb micro benchmark.

commit a387e9f3e16ab5253eec663bbb56c246e4dbda55
Author: Jiahao Li <[email protected]>
Date:   Sat Apr 22 14:26:06 2017 -0400

    Fixes SyncElimination blow up with function calls.

commit 44e8409f071578546b572b6dd807a83092867bfa
Author: Bojan Serafimov <[email protected]>
Date:   Mon Apr 10 12:06:51 2017 -0400

    Fix tests

commit adeb3eaaf5af3d9c816db1a704324c9f715a0277
Author: Jiahao Li <[email protected]>
Date:   Mon Apr 10 11:46:36 2017 -0400

    Handles instructions with null call sites.

commit 96f24b65e5a4634c8a78ac0e53dd552fe46d185d
Author: Bojan Serafimov <[email protected]>
Date:   Mon Apr 10 10:19:42 2017 -0400

    Ignore sync instruction in rosetta

commit d874567d6e6cdfc88c0faab3122975046162ec09
Author: Bojan Serafimov <[email protected]>
Date:   Tue Apr 4 19:14:29 2017 -0400

    Add nested loop test

commit 8f7734960776d31ddcb0cf690da837c3f7ee9229
Author: Bojan Serafimov <[email protected]>
Date:   Fri Mar 17 17:39:58 2017 -0400

    Fix bug in FindRosetta

commit e0bac90f990423a17e245cd6cb2d9f9f2b387951
Author: Bojan Serafimov <[email protected]>
Date:   Fri Mar 17 17:03:16 2017 -0400

    Add test cases

commit 7ccc4c9454b80ef03f14a0c03d86fceea2309581
Author: Jiahao Li <[email protected]>
Date:   Fri Mar 17 16:57:54 2017 -0400

    Fixes sync elimination test.

commit b5f16cfaf2ce8c9311104f356522c527cfe0b8ba
Author: Jiahao Li <[email protected]>
Date:   Fri Mar 17 16:51:37 2017 -0400

    Removes incomplete sync elimination test.

commit 344d075d08c6d23be99373b1b65a94fb6f92701d
Author: Jiahao Li <[email protected]>
Date:   Fri Mar 17 16:47:29 2017 -0400

    Removes function renaming in sync elimination.

commit 4045b1f2bd1d4e1ff6527bdc4349d9938e188463
Author: Jiahao Li <[email protected]>
Date:   Fri Mar 17 16:15:20 2017 -0400

    Fixes loop condition error in sync elimination.

commit 7eab317e1436d2fc456f0f625ef4888577c53bec
Author: Bojan Serafimov <[email protected]>
Date:   Fri Mar 17 16:33:40 2017 -0400

    Fix tests

commit 2c6412e1a4bb92a5fc86f63803a52ea22c43aa05
Author: Jiahao Li <[email protected]>
Date:   Fri Mar 17 14:54:13 2017 -0400

    Implements legality check for sync elimination.

commit a57ac4cafdfe845f0c90cc0611705c38f87f1905
Author: Bojan Serafimov <[email protected]>
Date:   Fri Mar 17 16:05:14 2017 -0400

    Add basic SyncElimination tests

commit a7c6bdec1a3562a9333e06497e362ab5e8e45613
Author: Bojan Serafimov <[email protected]>
Date:   Mon Mar 13 11:09:06 2017 -0400

    Implement sync removing

commit 271c65cf91c5a2223ebac864cb55d6137d6d00c4
Author: Jiahao Li <[email protected]>
Date:   Thu Mar 9 16:59:16 2017 -0500

    Implements Vegas-set finding for SyncElimination pass.

commit 72827d0cc4ef8b3fb556bdb4660c6b0891849b4f
Author: Jiahao Li <[email protected]>
Date:   Thu Mar 9 15:58:45 2017 -0500

    Implements Rosetta-finding part of SyncElimination pass.

commit df4c672499f76bcbfdf93806755e6f9ff15035f6
Author: Jiahao Li <[email protected]>
Date:   Thu Mar 9 15:08:28 2017 -0500

    Cosmetic cleanup.

commit 2682b3bf34c4efd7fc86e0af26d3a0b1dffc108f
Author: Bojan Serafimov <[email protected]>
Date:   Wed Mar 8 00:52:22 2017 -0500

    Add SyncElimination pass

commit 3856a31e3af623255498bc878b750e82c90a34b7
Author: Jiahao Li <[email protected]>
Date:   Sat Apr 22 16:27:38 2017 -0400

    Enables LoopFuse by default.

commit 6017d8b2a125a66cb418d247281433a5665ab249
Author: Jiahao Li <[email protected]>
Date:   Sat Apr 22 16:27:26 2017 -0400

    Rebases LoopFuse to compile on the current code base.

commit 367d9d916cbaf9d2433d267bf9c70be772fe8af7
Author: Jiahao Li <[email protected]>
Date:   Sat Apr 22 16:04:20 2017 -0400

    Replaces LoopAccessAnalysis with LoopAccessLegacyAnalysis in LoopFuse.

commit bb0b29851651bc1d122b7aed839a58edb4e656ce
Author: Jiahao Li <[email protected]>
Date:   Sat Apr 22 15:40:47 2017 -0400

    Applies https://reviews.llvm.org/D17386 for Loop Fusion Pass.

commit 3ce522e822ad2a0b047c0cc905cf59b8f4247d26
Author: Douglas Kogut <[email protected]>
Date:   Sat Apr 22 14:11:36 2017 -0400

    pushing spawn work

commit 0dd0df9b42bac64d82ffe5035f6d4f5d7b2dd2b0
Author: TB Schardl <[email protected]>
Date:   Thu Mar 30 12:40:37 2017 +0000

    [PassManager] Re-enabling passes that happen after optimizations when Cilk is not enabled.

commit 511ba02c8ccb2bf15a0791007229389352bffef9
Author: TB Schardl <[email protected]>
Date:   Thu Mar 16 14:25:49 2017 +0000

    [Tapir] When outlining, propagate available alignment information to the parameters of the outined function.

commit 4722cecdb2cef0b0ab84c08f65ae296bb4c01a2f
Merge: 285ff461789 780934e4b6a
Author: TB Schardl <[email protected]>
Date:   Fri Mar 10 20:18:23 2017 +0000

    Merge branch 'master' of github.com:wsmoses/Parallel-IR

commit 285ff4617892da4132f4a0aded992dcc4c5af6d5
Author: TB Schardl <[email protected]>
Date:   Fri Mar 10 20:17:05 2017 +0000

    [Tapir] Fix to properly maintain allocas in the entry block of a detached context.  These changes ensure that every detached context has an entry block with just one predecessor.  These changes also move allocas among entry blocks during function inlining and the outlining process for lowering Tapir.  These changes also remove syncs associated with parallel loops after outlining.

commit 489f0a4673d2b0364556382569e421fed347d301
Author: TB Schardl <[email protected]>
Date:   Fri Mar 10 20:14:03 2017 +0000

    [Local] Bug fix to make the GetDetachedCtx routine to properly return the detached BB at the start of a detached context.

commit cd7e9f3c2d840182ab82830218703b78c657d1b0
Author: TB Schardl <[email protected]>
Date:   Fri Mar 10 20:11:56 2017 +0000

    [SimplifyCFGPass] Code cleanup and comments.

commit 35669cce54f33447d1f12423e71536ab31cf02e5
Merge: 1fae2a923fb 52889bc3118
Author: William S. Moses <[email protected]>
Date:   Wed Mar 8 11:33:46 2017 -0500

    Merge branch '6898' of github.com:wsmoses/Parallel-IR into 6898

commit 780934e4b6a8054900b774d9405c0dd426bd23be
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 18:08:44 2017 -0500

    Parallelize / Shorten compilation

commit 4cc8071621e2c159a755a594bdb5dde9fbdfe74d
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 17:37:28 2017 -0500

    Fix optimized llvm build

commit 26007676a05e6c0445a0971f5bbfb0a2b2e9c47b
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 17:31:40 2017 -0500

    Updated binary

commit 6917c16e028fb03a608ba2e2f33ce48c68900b92
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 17:21:27 2017 -0500

    Faster cmake and autobuild matrix

commit 088941d05808f63865028347f4fcd3cbc849ce08
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 16:56:44 2017 -0500

    Remove old cmake

commit c558e05a3917b7be37490cd45b6c2d9fc153adbc
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 16:55:17 2017 -0500

    Print directories for debugging script

commit 074121e15927e674b16e2656913ecd08d557a422
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 16:45:52 2017 -0500

    Leave directory in autobuild after cmake

commit 30a221e0a04ae4dae0575a092800799e7aa7792f
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 16:38:07 2017 -0500

    Build without parallel option

commit 7a7d719c26e78e049093f1869eb6573e7cb3e529
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 16:32:07 2017 -0500

    Build newer cmake from source

commit 24f129bf4857357c90f8458c2ce09b60ab112b36
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 16:24:00 2017 -0500

    Correct ppa

commit e2bc0fc2d7edc08fb427b6f0a30862c602e57dfb
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 16:21:28 2017 -0500

    Change CMake to sourceline

commit c6249f0bce0d9906f5d669c6d44d15f5977e09d3
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 16:16:37 2017 -0500

    Attempt newer CMake

commit fe47a0078d432ee911504fa05c1af0652122dce7
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 16:08:27 2017 -0500

    Build PClang along with Tapir

commit 8ee564cae3bbb672546427bab5137b90ce2fdc17
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 16:07:36 2017 -0500

    Build intel runtime using the Tapir compiler

commit 6750684c7007e0e6ea0300498e7196cf68c52176
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 16:00:50 2017 -0500

    Add configure to cilk runtime building

commit 3f3b46840218f1629f1183b1ef0772414ca145c2
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 15:57:18 2017 -0500

    Add make to dependency list

commit bd6f8df75f130bcf260fc4a3102d73341d21dc1b
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 15:54:50 2017 -0500

    Add cilk runtime building

commit 6372499258146bf9da15f0153c9e4f4d288578cc
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 15:42:22 2017 -0500

    Change autobuild cmake version

commit 9fec173620bf1c3c964292485f007a69fc05ca72
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 15:39:43 2017 -0500

    Change autobuild distribution

commit 1fae2a923fb632a6eb1dabc4826e3b2533735273
Author: William S. Moses <[email protected]>
Date:   Tue Mar 7 15:35:20 2017 -0500

    Relist as package

commit 52889bc31182f3faebcfce24918670967b5b96f6
Author: Douglas Kogut <[email protected]>
Date:   Mon Mar 6 12:11:10 2017 -0500

    pushing example opt pass

commit fe692e250aa8a78435200882ebb89c17f881c4d3
Author: TB Schardl <[email protected]>
Date:   Fri Mar 3 13:25:57 2017 +0000

    Ignoring debug build directory.

commit 69fa592b7e889be513f1004b1f13dd450a1be378
Merge: 3c56ed06c17 df445de9e82
Author: TB Schardl <[email protected]>
Date:   Fri Mar 3 13:20:52 2017 +0000

    Merge branch 'master' of github.com:wsmoses/Parallel-IR

commit 3c56ed06c17f764e2c1221df60e8ee45199b1577
Merge: 4611d796dea 2d562fe758b
Author: TB Schardl <[email protected]>
Date:   Fri Mar 3 13:19:05 2017 +0000

    Merge branch 'master' of github.com:llvm-mirror/llvm

commit df445de9e8252e5aff8a6d7645128df71b3bd45f
Author: William S. Moses <[email protected]>
Date:   Thu Mar 2 00:37:50 2017 -0500

    Correct CI build script

commit efa60d2d710c5697f6be5737898897cfb56b4509
Author: William S. Moses <[email protected]>
Date:   Wed Mar 1 16:07:01 2017 -0500

    Force travis-ci to rebuild

commit 66ed989e47c276699462c761b0e4f2b68ef5d951
Author: William S. Moses <[email protected]>
Date:   Tue Feb 28 16:18:35 2017 -0500

    Initial attempt at adding Travis autobuilder

commit b8a1f3fb7874d52fedb6db8a786695521a846709
Merge: 518873a5b44 a3bd7557fb6
Author: William Moses <[email protected]>
Date:   Tue Feb 28 11:49:18 2017 -0500

    Merge pull request #12 from YingVictor/master

    [LowerToCilk] Fix memory leak.

commit a3bd7557fb661ef0980599d430e7cd0a52f7f385
Author: Victor A. Ying <[email protected]>
Date:   Tue Feb 28 11:41:08 2017 -0500

    [LowerToCilk] Fix memory leak.

    SmallVector of NewHelpers needs to be deleted.

commit 518873a5b44c8ffc37282cb3887a1518525eca7f
Merge: 645daf3405c fb71c4aa6b4
Author: William Moses <[email protected]>
Date:   Sun Feb 26 17:29:34 2017 -0500

    Merge pull request #11 from YingVictor/master

    Two minor fixes

commit fb71c4aa6b408ce59e095b3d770ba01ab4eb9f51
Author: Victor A. Ying <[email protected]>
Date:   Sun Feb 26 16:53:55 2017 -0500

    [include/llvm-c/Transforms/Tapir.h] Fix function name mentioned in comment.

commit 2e658275b9935e536f86aec6b7f911b6c5e374cc
Author: Victor A. Ying <[email protected]>
Date:   Sun Feb 26 16:46:18 2017 -0500

    Properly remove traces of clang submodule.

    Removing a git submodule requires more than just deleting the the entry
    in the .gitmodules file, as was done in the previous commit. It also
    requires deleting the special directory entry from the git index,
    which should be done using some variation of "git rm", such as:
    git rm --cached path/to/submodule
    Which is what I did in this commit.

commit 645daf3405c01f6e262373a6c849466f09162f44
Author: William S. Moses <[email protected]>
Date:   Fri Feb 24 15:35:50 2017 -0500

    Remove clang submodule

commit c9830e69c572885f6bfc7a74179a8e7efb6c851e
Merge: 3ad6c9cb76e 4611d796dea
Author: William S. Moses <[email protected]>
Date:   Fri Feb 24 15:33:45 2017 -0500

    Merge branch 'master' of github.com:wsmoses/Parallel-IR

commit 3ad6c9cb76eba2c5fbf7a5c8416ac28793d6455e
Author: William S. Moses <[email protected]>
Date:   Fri Feb 24 14:10:50 2017 -0500

    Update clang to stable

commit 4611d796dea964dea884c34cadcef14b256fbe56
Author: TB Schardl <[email protected]>
Date:   Tue Feb 21 19:46:22 2017 +0000

    [CodeExtractor] Removed unused function from CodeExtractor.

commit 73b2a05f9106a888ae92fbd9d89fd36be310bcce
Author: TB Schardl <[email protected]>
Date:   Sun Jan 15 14:19:32 2017 +0000

    [LoopSpawning] Restored warnings when LoopSpawning fails to transform a marked loop.

commit 710c06b2ffad2727ff751113b90b9905f4a3c845
Author: TB Schardl <[email protected]>
Date:   Sun Jan 15 14:18:54 2017 +0000

    [CodeExtractor] Removing old code for dealing with debug symbols.

commit ab75cf00f520c07d4dafa58328fa809780ac146b
Author: TB Schardl <[email protected]>
Date:   Fri Jan 13 22:25:29 2017 +0000

    [LowerToCilk] Renaming Detach2Cilk to LowerToCilk, as part of some code cleanup.

commit 2748779e158be086e9fa52300ccd5fcded978044
Author: TB Schardl <[email protected]>
Date:   Wed Jan 11 13:59:02 2017 +0000

    Updated associated version of Clang.

commit 738a76c83c83017faaeeaf959fb0c45b4586b08f
Author: TB Schardl <[email protected]>
Date:   Wed Jan 11 13:31:23 2017 +0000

    [test] Adding some simple regression tests for Tapir.

commit 5b63394d73f1d65ec6e338ed9ba8063895d8ef4e
Author: TB Schardl <[email protected]>
Date:   Mon Jan 9 19:11:44 2017 +0000

    [Tapir/Outline] Fix debug build.

commit df3dcb657228c40bff3ee7cab30944ed9e116021
Author: TB Schardl <[email protected]>
Date:   Mon Jan 9 02:31:01 2017 +0000

    [Tapir/Outline] Minor code cleanup.

commit facf7c87283b30b139fe75fbd4caacfc32c0fb37
Author: TB Schardl <[email protected]>
Date:   Mon Jan 9 02:29:07 2017 +0000

    [Detach2Cilk] Inline __cilk functions into generated helper functions.

commit c32adbf10f18c9a52e10de2e046329f67f635699
Author: TB Schardl <[email protected]>
Date:   Sun Jan 8 22:48:22 2017 +0000

    [LoopSpawning] Code cleanup for release build.

commit 3b460341f6a21344ddbc11100cd75ef079bcd8ee
Author: TB Schardl <[email protected]>
Date:   Sun Jan 8 22:41:02 2017 +0000

    [Detach2Cilk] Fixed creation of Cilk stack frames for release build.

commit 4bcdb952154d0daf4f18384cceda7f72e7b2542d
Author: TB Schardl <[email protected]>
Date:   Sun Jan 8 20:42:48 2017 +0000

    [SROA] Minor code cleanup.

commit 3c73fb9bf4d241c96c31f10c3a89074ffbf30774
Merge: 0d6f0aad70a 18687546b92
Author: TB Schardl <[email protected]>
Date:   Tue Jan 3 19:24:51 2017 +0000

    Merge branch 'new_lowering'

commit 18687546b9276fcb76c619193ee46b93f05a7001
Author: TB Schardl <[email protected]>
Date:   Tue Jan 3 17:18:12 2017 +0000

    [Detach2Cilk] Code cleanup.

commit 2a7c78c09452762cc784ac4cf92381340830a90c
Author: TB Schardl <[email protected]>
Date:   Tue Jan 3 16:59:48 2017 +0000

    [LoopSpawning] Added support for Tapir loops with exit blocks terminated by unreachable.

commit a1af329428f71f12decbe8776e2d9b4d9b377c63
Author: TB Schardl <[email protected]>
Date:   Sat Dec 31 17:06:01 2016 +0000

    [CSI] Fix formatting of CSI pass.

commit 08b3602ddb14e7bbe7fe78faa7a12c4fbd43e431
Author: TB Schardl <[email protected]>
Date:   Sat Dec 31 17:05:07 2016 +0000

    [CSI] Add function names to FED tables.

commit 1672db6417856784850c9aaa5f879c1bb5f6f539
Merge: a22c19d21b9 56516028d8b
Author: TB Schardl <[email protected]>
Date:   Sat Dec 31 14:59:27 2016 +0000

    Merge branch 'master' of github.com:llvm-mirror/llvm into new_lowering

commit a22c19d21b991cd92e7f64103166f66f0f89eabd
Merge: 04b71642665 7f580b605b2
Author: TB Schardl <[email protected]>
Date:   Tue Dec 20 14:25:09 2016 +0000

    Merge branch 'master' of github.com:llvm-mirror/llvm into new_lowering

commit 04b716426657e5cf52c69e6e6953492e1e3b7434
Author: TB Schardl <[email protected]>
Date:   Tue Dec 20 14:09:15 2016 +0000

    [LoopSpawning] Switching LoopSpawning back to implementing divide-and-conquer scheduling directly.

commit c03b7f076ab44c6e37edb033cf1b16950740fca7
Merge: 0cc6919dafd eaf3712d06e
Author: TB Schardl <[email protected]>
Date:   Mon Dec 19 21:47:05 2016 +0000

    Merge branch 'master' of github.com:llvm-mirror/llvm into new_lowering

commit 0cc6919dafdf326efdfa275f66556ad1a9abfe67
Author: TB Schardl <[email protected]>
Date:   Mon Dec 19 20:34:25 2016 +0000

    [Outline] Cleaning up the code.

commit 747d1e8211d2c6ce8eeee40a79d3f684e9747e1c
Author: TB Schardl <[email protected]>
Date:   Mon Dec 19 20:30:37 2016 +0000

    [LICENSE] Updated license to add copyright for changes to implement Tapir.

commit 0d6f0aad70ae0b75a4f71567bd098703070c3c56
Author: William S. Moses <[email protected]>
Date:   Sat Dec 17 23:15:13 2016 -0500

    add clang submodule

commit 463af403bf33e14b759a60377c95ffe3d1f74382
Author: TB Schardl <[email protected]>
Date:   Tue Dec 13 02:28:54 2016 +0000

    [LoopSpawning] Keeping two versions of divide-and-conquer loop spawning around.

commit fcae33a06441a48081c463f74d12fc5f6b9ce68a
Author: TB Schardl <[email protected]>
Date:   Tue Dec 13 02:21:17 2016 +0000

    [PassManagerBuilder] Modification to support more faithful reference pipeline for PPoPP.

commit 6a8c5d26ad24a6f35ca8afcc17f18ea89f790f09
Author: TB Schardl <[email protected]>
Date:   Sun Dec 11 22:29:25 2016 +0000

    [LoopSpawning] Fixed bug in computing loop count for using Cilk ABI call.

commit b8af887cac2f664ae780631cd14ea2a194ea042c
Author: Ubuntu <[email protected]>
Date:   Sun Dec 11 08:19:56 2016 +0000

    cilk abi loopspawning

commit 217f4eafa2694468cb3817fb65e05b95ddd1d0b3
Author: TB Schardl <[email protected]>
Date:   Sat Dec 10 20:39:12 2016 +0000

    [CilkABI] Bug fix to allow proper lowering of when a loop is the entry of a detached CFG.

commit 82cb28db1a9877d923da8a038c8f33a9079b6121
Merge: 8a4ac0d5d6e 05bdd2ebfe8
Author: TB Schardl <[email protected]>
Date:   Mon Nov 28 21:20:47 2016 +0000

    Merge branch 'master' of github.com:llvm-mirror/llvm into new_lowering

commit 8a4ac0d5d6ee455a6000fd60cd37018642a2b5ba
Author: TB Schardl <[email protected]>
Date:   Mon Nov 28 15:58:29 2016 +0000

    [LoopSpawning] Refactored to be a FunctionPass, instead of a LoopPass.  More work is needed for this pass to legally add functions to the current Module.

commit 7f96f2c38f8233502a50c6bfd66257be0915ea41
Author: TB Schardl <[email protected]>
Date:   Mon Nov 28 15:55:11 2016 +0000

    [LoopSimplify] Modified to ensure that the preheader of a loop is not terminated by a sync.

commit f84012859a7fd293377b87a2c0d95d2cbd75aee0
Author: TB Schardl <[email protected]>
Date:   Mon Nov 28 15:53:05 2016 +0000

    [Tapir/Outline] Cleaning up commented-out code.

commit 2e932359c6f63a76e6a040bdf577ca9f162ddd8f
Author: TB Schardl <[email protected]>
Date:   Mon Nov 28 15:52:22 2016 +0000

    [BasicBlockUtils] Modified SplitEdge to keep sync instruction in original block.

commit 32aeb36a6f76b69247231a1b57a9b66a32627ed1
Author: TB Schardl <[email protected]>
Date:   Mon Nov 28 15:50:19 2016 +0000

    [Detach2Cilk] Making Detach2Cilk a ModulePass, instead of a FunctionPass, so it can safely add functions to the module.

commit 6ab23d5f49ab42f2d3074523570cf72cd7ee6d02
Merge: 56598980fc5 52894d83e1a
Author: TB Schardl <[email protected]>
Date:   Sat Nov 26 17:23:45 2016 +0000

    Merge branch 'master' of github.com:llvm-mirror/llvm into new_lowering

commit e189e6c97da75849d75b512dd5513c0ec5a09af4
Merge: 6952888faaa c3bdfe57eb1
Author: Ubuntu <[email protected]>
Date:   Thu Nov 24 17:07:50 2016 +0000

    Bring up to date with most recent llvm

commit 56598980fc58d0bd68e2957eb45371eb23245995
Merge: 6a33185a05c 3e65807a6f1
Author: TB Schardl <[email protected]>
Date:   Wed Nov 23 18:31:46 2016 +0000

    Merge branch 'master' of github.com:llvm-mirror/llvm into new_lowering

commit 6952888faaaf797beb00934eee0c99f85fbfeea5
Merge: e79c0d93864 e372554cd73
Author: TB Schardl <[email protected]>
Date:   Fri Nov 11 21:42:16 2016 +0000

    Merge branch 'master' of github.com:wsmoses/Parallel-IR

commit e79c0d93864a579bf6b865802e182a7b80d9ea48
Author: TB Schardl <[email protected]>
Date:   Fri Nov 11 21:34:37 2016 +0000

    [PassManager] Ensure that extensions to the pass manager that are intended to run last only run once on Tapir programs.

commit 6a33185a05c72739458a92e13a103ed4b3ae4b97
Author: TB Schardl <[email protected]>
Date:   Fri Nov 11 21:34:37 2016 +0000

    [PassManager] Ensure that extensions to the pass manager that are intended to run last only run once on Tapir programs.

commit 6f2c14afe41e2bb9729976b52734d98f3c99bae3
Author: TB Schardl <[email protected]>
Date:   Fri Nov 11 21:18:30 2016 +0000

    [LoopSpawning] Ensure that calculation of a Tapir loop limit is inserted at the end of the loop's preheader.

commit e372554cd7396b1facc00f6d5df7d51f89553e31
Author: William S. Moses <[email protected]>
Date:   Thu Nov 3 23:57:38 2016 -0400

    Remove some debug prints

commit 6baad834b9903206be5830e9a5d81cb8c118dc80
Author: William S. Moses <[email protected]>
Date:   Thu Nov 3 23:54:44 2016 -0400

    Remove some debug prints

commit 782593d7bcd41736b148b6b128890d31f0d49f10
Author: TB Schardl <[email protected]>
Date:   Tue Nov 1 14:40:47 2016 +0000

    [LoopSpawning] Cleaning up code and debug output.

commit f604273ecf927017dc48afdae928477f8708e0d5
Author: TB Schardl <[email protected]>
Date:   Tue Nov 1 14:39:42 2016 +0000

    [Detach2Cilk] Should not need to inline detached helper functions anymore, because Detach2Cilk should properly handle debug symbols.

commit 20d299f2d2839b1f45b6716970f5a99ee821cec3
Author: TB Schardl <[email protected]>
Date:   Tue Nov 1 14:37:40 2016 +0000

    [PassManagerBuilder] Run SimplifyCFG after Detach2Cilk to clean up cruft left by Detach2Cilk.

commit 1610d83dd9f26a9f47004634f83b7e5a614f46f6
Author: TB Schardl <[email protected]>
Date:   Tue Nov 1 14:36:49 2016 +0000

    [Detach2Cilk] Fix to ensure that Phi nodes in the continuation of a detach are still valid after lowering the detach to Cilk runtime calls.

commit ea14d8bd01adccba902cdae883625698319b7d61
Author: TB Schardl <[email protected]>
Date:   Tue Nov 1 04:42:24 2016 +0000

    [CilkABI] Converting Detach2Cilk pass to use new Tapir outlining methods, in order to handle debug symbols more correctly.

commit 1f30c735f929c5821cf575aeea59ee1b6eef3164
Author: TB Schardl <[email protected]>
Date:   Mon Oct 31 21:56:25 2016 +0000

    [LoopSpawning] Fixed bugs to properly erase loops after performing transformation and to handle preheaders terminated by syncs.

commit a86651dd973a6f0743b4a360396dba6360fc5bdf
Author: TB Schardl <[email protected]>
Date:   Mon Oct 31 21:54:45 2016 +0000

    [Outline] Cleaning up CreateHelper Tapir outlining method.

commit 31691cd15ae0f76c40420339849f652888294863
Author: TB Schardl <[email protected]>
Date:   Mon Oct 31 15:38:08 2016 +0000

    [LoopSpawning] Cleaning up LoopSpawning code, and adding output to loop-spawning reports.

commit 51220e44f007bb6b5be02ecbbf2e20840634daba
Author: TB Schardl <[email protected]>
Date:   Mon Oct 31 15:34:55 2016 +0000

    [Tapir] Renaming TapirOutline to Outline.

commit 6950ba60b07973d535c06f288e0ed30b14d43aa9
Author: TB Schardl <[email protected]>
Date:   Sun Oct 30 19:19:15 2016 +0000

    [TargetLoweringBase] Dealing with compile warning on TargeetLoweringBase.

commit 581677b179aa2ed89134c8034ac491fae68595f0
Author: TB Schardl <[email protected]>
Date:   Sun Oct 30 19:18:10 2016 +0000

    [LoopSpawning] Replacing Loop2Cilk with LoopSpawning.

commit 39d404b1998c4c2d3635939c27f85c70e987d70f
Author: TB Schardl <[email protected]>
Date:   Sun Oct 30 18:54:23 2016 +0000

    [DiagnosticInfo] New method for emitting warning messages for the LoopSpawning pass.

commit 3d834b9e67f2779d2acd2bfd65d0b192561597d1
Author: TB Schardl <[email protected]>
Date:   Thu Oct 27 21:27:33 2016 +0000

    Updating passes to run around new Loop2Cilk implementation.

commit 35ec023f57f3a240f598d2a9822ec29aedcaf48c
Author: TB Schardl <[email protected]>
Date:   Thu Oct 27 21:25:43 2016 +0000

    Moving Tapir-specific transformations to a separate subdirectory under Transforms.

commit 3aae9e2c7b3402a3816f5b31a70a9326674c7a9f
Author: TB Schardl <[email protected]>
Date:   Sat Oct 22 14:40:05 2016 +0000

    [Cilk] Refactoring components for lowering Tapir to Cilk runtime calls.

commit 0a92f963f5978e3f7cd91a1f77a9b3040b4a2baf
Merge: 54f16a4669d fe05c97a9eb
Author: TB Schardl <[email protected]>
Date:   Sat Oct 22 14:33:05 2016 +0000

    Merge branch 'master' of github.com:wsmoses/Parallel-IR

commit 54f16a4669deaefc6a92a6f098485ee2d02d608b
Author: TB Schardl <[email protected]>
Date:   Sat Oct 22 14:30:27 2016 +0000

    [Local] Cleaned up formatting to get rid of tabs.

commit a8fade288fdbc1e194b7b0adba5ebdf61f05cb38
Author: TB Schardl <[email protected]>
Date:   Sat Oct 22 14:28:18 2016 +0000

    [Local] Fix to SerializeDetachedCFG to preserve debug symbols.

commit 5cc10ed3110941799eb681ad00833028ca692193
Author: TB Schardl <[email protected]>
Date:   Sat Oct 22 14:17:40 2016 +0000

    [Instrumentation] Adding CSI instrumentation pass, copied from https://github.com/CSI-LLVM/.

commit fe05c97a9eb98c01cfaa7a1a5129b0d002e2db70
Author: William S. Moses <[email protected]>
Date:   Sat Oct 22 10:00:23 2016 -0400

    Resolve issue 7

commit 4664388bb8c70312e21d321196942924a23955ff
Author: TB Schardl <[email protected]>
Date:   Wed Oct 19 16:01:28 2016 +0000

    [emacs] Added detach, reattach, and sync as control instructions in LLVM's emacs mode.

commit c0e8f4fe8db4bdac7f84bbf2ce6cb8a73a9252bd
Author: TB Schardl <[email protected]>
Date:   Mon Oct 17 04:14:35 2016 +0000

    [SSAUpdater] Derive the correct value from detached predecessors.

commit 2abd121b4c25579045347105a56b8383d0cefb9d
Author: TB Schardl <[email protected]>
Date:   Fri Oct 14 21:46:24 2016 +0000

    [LICM] Fixing compiler crash when LICM attempts to move a store outside of a Tapir loop.

commit 28606d0fb2e4e2bcaf37959292c2a89cedaf7a1e
Author: TB Schardl <[email protected]>
Date:   Thu Oct 13 02:12:43 2016 +0000

    [AliasAnalysis] Minor formatting change.

commit e5e04d08d7ddad2e021d0744ef52c52048955a2c
Author: TB Schardl <[email protected]>
Date:   Thu Oct 13 02:08:30 2016 +0000

    [InlineFunction] Preventing InlineFunction from moving alloca's out of their detached context after inlining.

commit 14719bb0513004960e3c8b0571b82981cc2b1239
Merge: 84848c51548 7f4bee18532
Author: William S. Moses <[email protected]>
Date:   Thu Oct 6 13:53:55 2016 -0400

    Merge branch 'master' of github.com:wsmoses/Parallel-IR

commit 84848c51548b59b6beafa5c90615f36e64500199
Author: William S. Moses <[email protected]>
Date:   Thu Oct 6 13:53:50 2016 -0400

    Allow full unrolling of cilk for loops

commit 7f4bee185325eebc78533ef450a45e43926da694
Author: TB Schardl <[email protected]>
Date:   Thu Oct 6 16:51:37 2016 +0000

    [AliasAnalysis] Force AliasAnalysis to fail fast if it finds a detached CFG that reaches its own Detach instruction.

commit a2c6e22dd11c4212dbb64ce15020f677d77ed479
Author: TB Schardl <[email protected]>
Date:   Tue Oct 4 22:44:38 2016 +0000

    [Loop2Cilk] Fix splitting of loop preheaders that are terminated by sync instructions.

commit 1d1bdcf375abd2e0e83a8500278acc6124bf16f2
Author: William S. Moses <[email protected]>
Date:   Sun Oct 2 23:19:30 2016 -0400

    minor modref fix

commit 9ca914a946ee787fa8750a0a622d0f901641f2cf
Author: William S. Moses <[email protected]>
Date:   Fri Sep 23 16:12:32 2016 -0400

    fix line info

commit 16395e5ae2ab1cbc17de82c0127680aeccecedc1
Author: William S. Moses <[email protected]>
Date:   Thu Sep 22 09:08:42 2016 -0400

    Additional clean up

commit af36e03c8282f4c431260dbfe16e3c323c72b82d
Author: William S. Moses <[email protected]>
Date:   Wed Sep 21 16:56:01 2016 -0400

    clean up unrollinng

commit 87d19e853f283cf9fac9c1e71239e34227fad27c
Author: William S. Moses <[email protected]>
Date:   Wed Sep 21 16:48:27 2016 -0400

    resolve move to clang 4

commit 79323f66683946df1702005e3071f7fed23f0c3d
Author: William S. Moses <[email protected]>
Date:   Thu Sep 15 15:06:36 2016 -0400

    fix tre

commit 574835b96b09f8d9b496f17c303b7a3457cd2e1f
Author: William S. Moses <[email protected]>
Date:   Thu Sep 15 12:01:49 2016 -0400

    Fix mem2reg bug

commit 88cccc72240abd17a1dec0b2d238686919db7e81
Author: William S. Moses <[email protected]>
Date:   Tue Sep 13 17:14:44 2016 -0400

    fix running bugs

commit f449ac224baed049d3a4eecaccaeef7ac0954e36
Author: William S. Moses <[email protected]>
Date:   Mon Sep 12 14:10:31 2016 -0400

    fmt

commit 1d618f6fc664f473131fa11d3b5ba495e3d1cbbd
Author: William S. Moses <[email protected]>
Date:   Mon Sep 12 14:08:22 2016 -0400

    fmt

commit 05d2fe180fe4980474f8e7317936b312b749e048
Author: William S. Moses <[email protected]>
Date:   Mon Sep 12 14:07:24 2016 -0400

    fmt

commit cb166968bc4f79b54e24272b59f935e3239109c6
Author: William S. Moses <[email protected]>
Date:   Wed Aug 17 22:11:31 2016 -0400

    solid

commit 1be62909730984141b5afbec84c48823735c4429
Merge: c3eb1b7594a e65e275cf2f
Author: William S. Moses <[email protected]>
Date:   Wed Aug 17 18:01:27 2016 -0400

    Merge remote-tracking branch 'llvm/master'

commit c3eb1b7594a5953a324015aa08f745e31fb0ec65
Author: William S. Moses <[email protected]>
Date:   Wed Aug 17 18:00:22 2016 -0400

    cleanup

commit 925a26d33e5aa664ed2a950bfac6f123832d28f1
Author: William S. Moses <[email protected]>
Date:   Wed Aug 17 17:55:49 2016 -0400

    cleanup

commit 8a4aa28bc1ac48d2073507eb365e2461b206f524
Merge: 9ee354913cb 7177ff558c7
Author: William S. Moses <[email protected]>
Date:   Wed Aug 17 02:54:17 2016 -0400

    merge to mainline

commit 9ee354913cb1d00c79b0173d87e8259db193d73f
Author: William S. Moses <[email protected]>
Date:   Mon Aug 15 01:43:52 2016 -0400

    Add race detector

commit 9b7715ebfc3bdd80382cbce7ca724868789c9cd6
Author: William S. Moses <[email protected]>
Date:   Wed Aug 10 00:04:31 2016 -0400

    cmake fixes

commit b66e56629e6ddd6895342d281ed510b011cecff1
Author: Ubuntu <[email protected]>
Date:   Fri Jul 29 21:11:20 2016 +0000

    LICM fix

commit c1aabfb01f044642dc9fb4317313d408c3cc39fc
Author: William S. Moses <[email protected]>
Date:   Wed Jul 27 21:22:20 2016 -0400

    add merge functions

commit 72b025f6f0d254ab7e37e7cabb42e9e27f01ede8
Author: William S. Moses <[email protected]>
Date:   Wed Jul 20 13:40:34 2016 -0400

    fix dt

commit 39c33184af36efb1af71591940caf1924ace5ac8
Author: William S. Moses <[email protected]>
Date:   Wed Jul 20 13:34:33 2016 -0400

    fix dt

commit af099d0ad6a6c263f969e2c8b577d8a6c80bd685
Author: William S. Moses <[email protected]>
Date:   Wed Jul 20 13:14:30 2016 -0400

    fix dt

commit 920d83fc1bed8c82c0f2ccf58379371445206469
Author: William S. Moses <[email protected]>
Date:   Wed Jul 20 12:12:44 2016 -0400

    fix ph issue

commit b0abbc37c6e836acf46b8703b54a0881fd499b96
Author: William S. Moses <[email protected]>
Date:   Wed Jul 20 11:49:12 2016 -0400

    resolve print

commit d7aa05a4ebf5866d9fe70dd3733e9e20df4fdd76
Author: William S. Moses <[email protected]>
Date:   Tue Jul 19 18:10:57 2016 -0400

    major pbbs bugfix

commit f470066edb8b7a8d8db7cef0b9a7b65f8fd8090a
Author: William S. Moses <[email protected]>
Date:   Tue Jul 19 14:31:06 2016 -0400

    fix ppbs bug

commit e1ac630d820ec2a7455392f4ddc9c4c620ea26c2
Author: William S. Moses <[email protected]>
Date:   Mon Jul 18 21:35:07 2016 -0400

    mod graint position

commit 0e725b855f90f63703d71a8761f717697912b65c
Author: William S. Moses <[email protected]>
Date:   Mon Jul 18 21:14:16 2016 -0400

    mod graint position

commit 83e0982370d9a89d4f0b0b33636511568d8eda40
Author: William S. Moses <[email protected]>
Date:   Mon Jul 18 16:17:40 2016 -0400

    cilk abi fixes

commit 63738d884d78c5297d1c781da81b6599e9cdeba3
Author: William S. Moses <[email protected]>
Date:   Mon Jul 18 13:07:38 2016 -0400

    fix recursive idx

commit 45ca520784a38bbc13b0d00597310d931c757e4b
Author: William S. Moses <[email protected]>
Date:   Mon Jul 18 02:25:34 2016 -0400

    fix issues with d2c extraction

commit 0e9c93c9d38a035d1ea88c2fbfbff6d6144cde0f
Author: William S. Moses <[email protected]>
Date:   Sun Jul 17 22:21:06 2016 -0400

    add reopt

commit ec8c23de30635cb0969514bd18068d4e2bd77ec9
Author: William S. Moses <[email protected]>
Date:   Sun Jul 17 22:18:39 2016 -0400

    prevent rerunning passes

commit 8d6bd63be4a6c8ebf61be02b9d2d8535de3b9484
Author: William S. Moses <[email protected]>
Date:   Thu Jul 14 13:19:44 2016 -0700

    fix asm errors

commit f83bdc1fab9bf732ea0be8b134cea617e4f85500
Author: William S. Moses <[email protected]>
Date:   Tue Jul 12 08:18:01 2016 -0700

    fix unreachable merge domtree bug

commit 662b5a7e0018b659b08dc9256dfd61f94d756f56
Author: William S. Moses <[email protected]>
Date:   Mon Jul 11 16:04:43 2016 -0400

    Resolve issues with bounds detection in loop2cilk

commit 4866c5da1c28d2c67dc168edf119cc4adfbc07f3
Author: William S. Moses <[email protected]>
Date:   Thu Jul 7 09:28:14 2016 -0400

    minor attr fix

commit 1f4c43c41f109f82859a88525a851f00b2e1b5e4
Author: William S. Moses <[email protected]>
Date:   Thu Jun 30 15:05:11 2016 -0400

    fix bounds error

commit 0caf3f63eb873abb93e06080eb875f0945c5c2df
Author: William S. Moses <[email protected]>
Date:   Thu Jun 30 14:13:54 2016 -0400

    speedup fix

commit 5cf555f901601c76bc416f7ef94dc77b375bcf84
Author: William S. Moses <[email protected]>
Date:   Thu Jun 30 12:41:46 2016 -0400

    resolve linker issues

commit 25e91bfc5f42f6eb1977cefe90336e85994d65d3
Author: William S. Moses <[email protected]>
Date:   Thu Jun 30 12:37:47 2016 -0400

    prevent l2c recursive loops

commit 325bce7bb19e0e4828e6f7eba6ba6420a1f59f7a
Author: William S. Moses <[email protected]>
Date:   Wed Jun 29 22:41:14 2016 -0400

    fix issue with loop parents

commit 8e0997cb4b85e14c83783d81a7e3815d64fc6056
Author: William S. Moses <[email protected]>
Date:   Wed Jun 29 21:10:51 2016 -0400

    more efficient loops

commit f302f9480f94a4e7f816707e5224c85e0bf07218
Author: William S. Moses <[email protected]>
Date:   Wed Jun 29 01:05:05 2016 -0400

    l2c computes grain size

commit 1dbd257083c5d5e95fa662cc99da0b150aed94e2
Author: William S. Moses <[email protected]>
Date:   Tue Jun 28 16:47:52 2016 -0400

    more error info for bad return state

commit ec4340b4cee3951abf49ad1636bff07cb77fb80f
Author: William S. Moses <[email protected]>
Date:   Mon Jun 27 17:57:49 2016 -0400

    fix accidental breakage

commit 88ceb1203926d59578e2c0dba02bf3b38f374120
Author: William S. Moses <[email protected]>
Date:   Mon Jun 27 14:39:50 2016 -0400

    fix loop2cilk indvar incr adding issue

commit 0a1cbbf7dff910f348713a88108169e03dabf3de
Author: William S. Moses <[email protected]>
Date:   Fri Jun 24 13:43:53 2016 -0400

    Better Parallel TRE

commit bc96f0b3f141176d1667b1700be945aed7520e9c
Author: William S. Moses <[email protected]>
Date:   Fri Jun 24 01:38:46 2016 -0400

    Parallel TRE

commit 579d39d8efab448cacf9c41aea8197226c64bfe4
Author: William S. Moses <[email protected]>
Date:   Thu Jun 23 13:47:13 2016 -0400

    more secure sync detect for loop2cilk

commit c06f49770a26c971efe66356b90a0a1ef7f2a301
Author: William S. Moses <[email protected]>
Date:   Wed Jun 22 16:57:07 2016 -0400

    Fix alloca issues for detached code

commit 150056edc4a2bb03c0bbe94923cfa189ce44f052
Author: William S. Moses <[email protected]>
Date:   Tue Jun 21 19:17:47 2016 -0400

    minor opt diff

commit 497c3b498bc8ce71ad913dff063853204810f402
Author: William S. Moses <[email protected]>
Date:   Tue Jun 21 15:02:58 2016 -0400

    modify pass

commit 01e49c3727f69e2da875989b4e61ab10fc058327
Author: William S. Moses <[email protected]>
Date:   Tue Jun 21 01:14:31 2016 -0400

    fix loop2cilk recog issue

commit 1c52cbf136f247110b7c9e4cac0a5a0d73ad63f7
Author: William S. Moses <[email protected]>
Date:   Tue Jun 21 00:35:03 2016 -0400

    remove pre sroa

commit 510bfacf5154f48e729c159c95c965acf4eef120
Author: William S. Moses <[email protected]>
Date:   Mon Jun 20 20:36:34 2016 -0400

    loop2cilk fixes to indvar

commit ef34ac80086a10e3ae04b9fd2ce4d99436eaa69e
Author: Ubuntu <[email protected]>
Date:   Mon Jun 20 19:00:07 2016 +0000

    Resolve linker errors

commit 4387eb25bb6e36f0e5f8d04c9d9d3f710864044a
Author: William S. Moses <[email protected]>
Date:   Mon Jun 20 14:47:48 2016 -0400

    Loop2cilk new indvar calculation

commit d4e44d43b5c6e40883975e87aa2c4c46759a8eb8
Author: William S. Moses <[email protected]>
Date:   Mon Jun 20 04:10:48 2016 -0400

    loop2cilk without opts

commit 9164742231eb140864e17562dd7e79161685e293
Author: William S. Moses <[email protected]>
Date:   Mon Jun 20 03:48:51 2016 -0400

    correct loop bounds calculation

commit d0d80c596491f3d8b7b9f2479f996f9345e9f059
Author: William S. Moses <[email protected]>
Date:   Sun Jun 19 00:43:55 2016 -0400

    clean up compile

commit 26beb619a1384b470ca0e668c1a838ee85b78b75
Author: William S. Moses <[email protected]>
Date:   Fri Jun 17 14:37:46 2016 -0400

    remove debug message

commit 76a163ddffdb916de1bee5fef34298e676266bff
Author: Ubuntu <[email protected]>
Date:   Wed Jun 15 20:58:36 2016 +0000

    nomem

commit 126c754b4f8e553e6b9ff33f899afaaf4182ee04
Author: William S. Moses <[email protected]>
Date:   Wed Jun 15 15:41:57 2016 -0400

    fixes and less print

commit cd037d2993381148f11954f51ff89c6b5e599086
Author: William S. Moses <[email protected]>
Date:   Tue Jun 14 23:33:28 2016 -0400

    restore cilkabi

commit 5964e893682feec3a63d17999d32c2125486e879
Author: William S. Moses <[email protected]>
Date:   Tue Jun 14 23:19:52 2016 -0400

    fix inline bug

commit b5a22ebc589fc25b72f513eb16ccbedc6482e9f2
Author: William S. Moses <[email protected]>
Date:   Tue Jun 14 14:32:41 2016 -0400

    cleanup dumps

commit 2ab9f07b81a7fb04c33926c2899c4af1753d6175
Author: William S. Moses <[email protected]>
Date:   Tue Jun 14 14:30:04 2016 -0400

    cleanup dumps

commit 56d8d0f052de051328c2077bcd47e75f34d9f034
Author: William S. Moses <[email protected]>
Date:   Tue Jun 14 12:35:26 2016 -0400

    cleanup dumps

commit d95ce1575159c12135952b3fa39a092bc77ad298
Author: William S. Moses <[email protected]>
Date:   Tue Jun 14 12:29:38 2016 -0400

    addl sroa fixes

commit 2754c0b40a4ca26d3201005a1d2796b840bdcce7
Author: William S. Moses <[email protected]>
Date:   Tue Jun 14 12:16:02 2016 -0400

    loop2cilk ordering issue for ind var calculation fixed

commit bebf5cc0565d9060e78a3caeb880b2ce8f43b36c
Author: William S. Moses <[email protected]>
Date:   Tue Jun 14 11:27:20 2016 -0400

    Fix SROA for detached allocas

commit 222ecb6dfd053282d450cbe9cffc7cea4d98fa5d
Author: William S. Moses <[email protected]>
Date:   Tue Jun 14 00:36:00 2016 -0400

    minor bugfix

commit 446ad1a3bad89a44dd2c361cc0d9417a0a07eb2b
Author: William S. Moses <[email protected]>
Date:   Mon Jun 13 21:59:25 2016 -0400

    bugfixes

commit bc37ee11a97c23b0576d45bcc94e7a597ff30a39
Author: William S. Moses <[email protected]>
Date:   Thu Jun 9 10:43:21 2016 -0400

    Fix odd LICM error

commit abfc103a0f06248526972ddd6f6057e372d56383
Author: William S. Moses <[email protected]>
Date:   Wed Jun 8 01:04:49 2016 -0400

    parallel opt levels and fix codegen pt 1

commit cab96d82f5d94a4a6745983953f43850d3a80f7d
Author: William S. Moses <[email protected]>
Date:   Fri Jun 3 01:43:13 2016 -0400

    fix compile script

commit 6284487a349fe982d5d24d2ff45d8ff5c8d25708
Author: William S. Moses <[email protected]>
Date:   Fri Jun 3 01:41:01 2016 -0400

    fix l2c

commit 3783dfebd1a8d94ab40b958e03ffb99ac54e3f5b
Author: William S. Moses <[email protected]>
Date:   Thu Jun 2 23:50:39 2016 -0400

    Fix allocation issues

commit fc2042d6a1331df9a55148208d27b2c2d4834ef7
Author: William S. Moses <[email protected]>
Date:   Mon May 30 15:20:22 2016 -0400

    add unique block debug info

commit cd3303d769327d50bcf3a422496190ed349cbaac
Author: William S. Moses <[email protected]>
Date:   Mon May 30 15:17:18 2016 -0400

    fix exit block detection l2c

commit 4865203b50d0ad69531b6459a35d557908db3ffe
Author: William S. Moses <[email protected]>
Date:   Mon May 30 15:02:11 2016 -0400

    fix sync l2c detection issue

commit e95a55ae8775dfe21c0ce10e0ea32332bc3d973a
Author: William S. Moses <[email protected]>
Date:   Sun May 29 23:31:59 2016 -0400

    allow switch and better cmp block

commit b17417485a42308842840748c73c76953302dc30
Author: William S. Moses <[email protected]>
Date:   Sun May 29 22:09:34 2016 -0400

    fix issues in multiple phi nodes for l2c

commit f64fca467066650bdab351a55ec38943d360fced
Author: William S. Moses <[email protected]>
Date:   Sun May 29 17:29:00 2016 -0400

    add addl check for loop2cilk

commit 8d9ac096f9beda10ff400631aae3336b5cb0982e
Author: William S. Moses <[email protected]>
Date:   Sat May 28 22:36:56 2016 -0400

    minor script fix

commit 748021ae6a76b9d6e2ecb85b3e247455d5e9bdb9
Author: William S. Moses <[email protected]>
Date:   Sat May 28 22:24:41 2016 -0400

    lots of minor cilk error fixes

commit 0132cc1ce667fd8c21adaf5b3abd5dfadac80c09
Author: William S. Moses <[email protected]>
Date:   Wed May 25 11:52:28 2016 -0400

    fix bug in l2c about branching into

commit 9f921005730c6c92fbdf19b36714488c72c0975e
Author: William S. Moses <[email protected]>
Date:   Tue May 24 23:40:12 2016 -0400

    fix bug in loop2cilk

commit a9d9cd9529c20022fd5ca0600042065cfee21d8f
Author: William S. Moses <[email protected]>
Date:   Sun Apr 10 14:32:22 2016 -0400

    resolve block seg

commit 7410b7bcfbf610b34a0f42c0966cbdbd2e9b2e97
Author: William S. Moses <[email protected]>
Date:   Sun Apr 10 13:55:01 2016 -0400

    fixes

commit 11a77b870e734e617b00e4b55f09526cf2ac37d4
Author: William S. Moses <[email protected]>
Date:   Thu Apr 7 03:04:30 2016 -0400

    add compile

commit f2ec969a1965da3224fdffed035b9d39114d2b9a
Author: William S. Moses <[email protected]>
Date:   Thu Apr 7 03:04:17 2016 -0400

    pre detach merging / loop unroll fixes

commit 9c00e9b80d865cf478607a4ddb90ca018ad2978c
Author: William S. Moses <[email protected]>
Date:   Thu Apr 7 00:27:15 2016 -0400

    sync fix

commit 1f3c6dcb9d48ba519fde34c66b657571949428f7
Author: William S. Moses <[email protected]>
Date:   Thu Apr 7 00:12:58 2016 -0400

    bug fixes

commit 0f1b1cf061ab790622c6498e0df9c5487a8d610c
Author: William S. Moses <[email protected]>
Date:   Tue Apr 5 18:44:04 2016 -0400

    resolve delete issues

commit 86cd5870f9d667ff36b2c10971216e8f6d0977d0
Author: William S. Moses <[email protected]>
Date:   Tue Apr 5 13:10:36 2016 -0400

    resolve delete issues

commit 06defa794acaf1f13ecdd63d57b38a49e2561492
Merge: 2f7e6ec4fa6 8b47c17a53d
Author: William S. Moses <[email protected]>
Date:   Tue Apr 5 11:57:10 2016 -0400

    Merge remote-tracking branch 'llvm/release_38'

commit 8b47c17a53d683f313eaaa93c4a53de26d8fcba5
Author: Dimitry Andric <[email protected]>
Date:   Tue Apr 5 06:58:21 2016 +0000

    Merging r264335:
    ------------------------------------------------------------------------
    r264335 | dim | 2016-03-24 21:39:17 +0100 (Thu, 24 Mar 2016) | 17 lines

    Add <atomic> to ThreadPool.h, since std::atomic is used

    Summary:
    Apparently, when compiling with gcc 5.3.2 for powerpc64, the order of
    headers is such that it gets an error about std::atomic<> use in
    ThreadPool.h, since this header is not included explicitly.  See also:

    https://llvm.org/bugs/show_bug.cgi?id=27058

    Fix this by including <atomic>.  Patch by Bryan Drewery.

    Reviewers: chandlerc, joker.eph

    Subscribers: bdrewery, llvm-commits

    Differential Revision: http://reviews.llvm.org/D18460

    ------------------------------------------------------------------------

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@265380 91177308-0d34-0410-b5e6-96231b3b80d8

commit 295c7a62d88d363361198766ce95900441727da9
Author: Renato Golin <[email protected]>
Date:   Sat Apr 2 20:36:55 2016 +0000

    Merging r263714: ARM: Revert SVN r253865, 254158, fix windows division

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@265245 91177308-0d34-0410-b5e6-96231b3b80d8

commit 2a2d901e3c55aff48990de5e415c429c4cfeb6d8
Author: Renato Golin <[email protected]>
Date:   Sat Apr 2 20:32:54 2016 +0000

    Merging r263123: ARM: follow up improvements for SVN r263118

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@265244 91177308-0d34-0410-b5e6-96231b3b80d8

commit 97a35e605ab417f11be4ccb532fcc9015ebb2ca8
Author: Renato Golin <[email protected]>
Date:   Sat Apr 2 20:31:15 2016 +0000

    Merging r263118: ARM: correct __builtin_longjmp on WoA

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@265243 91177308-0d34-0410-b5e6-96231b3b80d8

commit dec3a22cf5b8f8e6c6d1bf898f3a14bc4c54e0b4
Author: Tom Stellard <[email protected]>
Date:   Mon Mar 28 18:13:48 2016 +0000

    Bump version to 3.8.1

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@264605 91177308-0d34-0410-b5e6-96231b3b80d8

commit 2f7e6ec4fa663dff11ba3dff5f74468e79c042d9
Author: TB Schardl <[email protected]>
Date:   Thu Mar 17 08:15:50 2016 +0000

    Cleaning up CilkABI.

commit 88a51fc0886146600e14173a0878b6567b29e3bc
Author: TB Schardl <[email protected]>
Date:   Thu Mar 17 08:15:05 2016 +0000

    Fixing Loop2Cilk CMakeLists entries to fix cmake build.

commit 0d0d243f395a4192bf4d85817c8ac14f5d9d8b2f
Author: TB Schardl <[email protected]>
Date:   Thu Mar 17 08:14:16 2016 +0000

    Fixing Loop2Cilk for merge with 'release_38'

commit 277ca2c63350507bf3ba5cd075f204e4b356fc5f
Merge: 008aa9d2441 ad5750369cc
Author: TB Schardl <[email protected]>
Date:   Thu Mar 17 08:09:16 2016 +0000

    Merge branch 'release_38' of http://llvm.org/git/llvm into tb-scratch

commit 008aa9d24417420734027b5072ea48cc86b428d2
Author: William S. Moses <[email protected]>
Date:   Sat Mar 12 17:32:11 2016 -0500

    loop2cilk working happily

commit ea5e316db15804df27dcfaf6b790f07c8e7bd2b2
Merge: 9b3fc2538fd 1526147c0ad
Author: William S. Moses <[email protected]>
Date:   Thu Mar 10 13:16:18 2016 -0500

    Merge branch 'tb-scratch' of ssh://github.com/taekwonbilly/Parallel-IR into tb-scratch

commit 9b3fc2538fdd9218bcb1a91b954028652579c6e4
Author: William S. Moses <[email protected]>
Date:   Thu Mar 10 13:15:45 2016 -0500

    loop2cilk mods

commit ad5750369cc5b19f36c149f7b13151c99c7be47a
Author: Hans Wennborg <[email protected]>
Date:   Wed Mar 2 23:38:03 2016 +0000

    ReleaseNotes: tidy up

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@262542 91177308-0d34-0410-b5e6-96231b3b80d8

commit 0805780408c97128dc9164d4dbb8604882f5588e
Author: Hans Wennborg <[email protected]>
Date:   Wed Mar 2 23:10:55 2016 +0000

    Remove 'if you are using a released version' warning

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@262537 91177308-0d34-0410-b5e6-96231b3b80d8

commit f26161e8b05360841a1a3a4a2204ed761d6a2e04
Author: Hans Wennborg <[email protected]>
Date:   Wed Mar 2 18:19:22 2016 +0000

    ReleaseNotes: C API policy; by Eric Christopher

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@262496 91177308-0d34-0410-b5e6-96231b3b80d8

commit 27c964e2ae0b573cf1e6551a3da255539db03d3c
Author: Hans Wennborg <[email protected]>
Date:   Fri Feb 26 21:37:52 2016 +0000

    ReleaseNotes: PowerPC; by Kit Barton

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@262074 91177308-0d34-0410-b5e6-96231b3b80d8

commit bb6f14e3581c78509405a3d415e72821db8a2066
Author: Quentin Colombet <[email protected]>
Date:   Mon Feb 22 22:27:47 2016 +0000

    [AArch64] Fix bug in prolog clobbering live reg when shrink wrapping.

    This adapts r261349 to the release branch.

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@261586 91177308-0d34-0410-b5e6-96231b3b80d8

commit e970b795a27d16c720bf4e3ff030eea241784eb4
Author: Hans Wennborg <[email protected]>
Date:   Mon Feb 22 21:05:14 2016 +0000

    Merging r261441, r261447, and r261546:

    ------------------------------------------------------------------------
    r261441 | nemanjai | 2016-02-20 10:16:25 -0800 (Sat, 20 Feb 2016) | 12 lines

    Fix for PR 26500

    This patch corresponds to review:
    http://reviews.llvm.org/D17294

    It ensures that whatever block we are emitting the prologue/epilogue into, we
    have the necessary scratch registers. It takes away the hard-coded register
    numbers for use as scratch registers as registers that are guaranteed to be
    available in the function prologue/epilogue are not guaranteed to be available
    within the function body. Since we shrink-wrap, the prologue/epilogue may end
    up in the function body.
    ------------------------------------------------------------------------

    ------------------------------------------------------------------------
    r261447 | nemanjai | 2016-02-20 12:45:37 -0800 (Sat, 20 Feb 2016) | 6 lines

    Fix the build bot break caused by rL261441.

    The patch has a necessary call to a function inside an assert. Which is fine
    when you have asserts turned on. Not so much when they're off. Sorry about
    the regression.
    ------------------------------------------------------------------------

    ------------------------------------------------------------------------
    r261546 | nemanjai | 2016-02-22 10:04:00 -0800 (Mon, 22 Feb 2016) | 6 lines

    Fix for PR26690 take 2

    This is what was meant to be in the initial commit to fix this bug. The
    parens were missing. This commit also adds a test case for the bug and
    has undergone full testing on PPC and X86.
    ------------------------------------------------------------------------

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@261572 91177308-0d34-0410-b5e6-96231b3b80d8

commit f65e46be097186d748836d42c38a6dc7f30e6c3b
Author: Hans Wennborg <[email protected]>
Date:   Mon Feb 22 17:51:28 2016 +0000

    Merging r261387:
    ------------------------------------------------------------------------
    r261387 | davide | 2016-02-19 16:44:47 -0800 (Fri, 19 Feb 2016) | 8 lines

    [X86ISelLowering] Fix TLSADDR lowering when shrink-wrapping is enabled.

    TLSADDR nodes are lowered into actuall calls inside MC. In order to prevent
    shrink-wrapping from pushing prologue/epilogue past them (which result
    in TLS variables being accessed before the stack frame is set up), we
    put markers, so that the stack gets adjusted properly.
    Thanks to Quentin Colombet for guidance/help on how to fix this problem!

    ------------------------------------------------------------------------

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@261542 91177308-0d34-0410-b5e6-96231b3b80d8

commit e3b2bd1e79c9c9d24490b6ddb2341afcf4210691
Author: Hans Wennborg <[email protected]>
Date:   Mon Feb 22 17:47:10 2016 +0000

    Merging r261384:
    ------------------------------------------------------------------------
    r261384 | qcolombet | 2016-02-19 16:32:29 -0800 (Fri, 19 Feb 2016) | 4 lines

    [RegAllocFast] Properly track the physical register definitions on calls.

    PR26485

    ------------------------------------------------------------------------

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@261539 91177308-0d34-0410-b5e6-96231b3b80d8

commit c63a0fe41b81bac1ea6e1a053d2a8939e02edf17
Author: Hans Wennborg <[email protected]>
Date:   Fri Feb 19 21:42:57 2016 +0000

    Merging r261368:
    ------------------------------------------------------------------------
    r261368 | hans | 2016-02-19 13:40:12 -0800 (Fri, 19 Feb 2016) | 3 lines

    Revert r255691 "[LoopVectorizer] Refine loop vectorizer's register usage calculator by ignoring specific instructions."

    It caused PR26509.
    ------------------------------------------------------------------------

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@261369 91177308-0d34-0410-b5e6-96231b3b80d8

commit 78e9cd40a2ea27cc9300d900a7dccc75940f9eb0
Author: Hans Wennborg <[email protected]>
Date:   Fri Feb 19 21:35:00 2016 +0000

    Merging r261360:
    ------------------------------------------------------------------------
    r261360 | dim | 2016-02-19 12:14:11 -0800 (Fri, 19 Feb 2016) | 19 lines

    Fix incorrect selection of AVX512 sqrt when OptForSize is on

    Summary:
    When optimizing for size, sqrt calls can be incorrectly selected as
    AVX512 VSQRT instructions.  This is because X86InstrAVX512.td has a
    `Requires<[OptForSize]>` in its `avx512_sqrt_scalar` multiclass
    definition.  Even if the target does not support AVX512, the class can
    apparently still be chosen, leading to an incorrect selection of
    `vsqrtss`.

    In PR26625, this lead to an assertion: Reg >= X86::FP0 && Reg <=
    X86::FP6 && "Expected FP register!", because the `vsqrtss` instruction
    requires an XMM register, which is not available on i686 CPUs.

    Reviewers: grosbach, resistor, joker.eph

    Subscribers: spatel, emaste, llvm-commits

    Differential Revision: http://reviews.llvm.org/D17414
    ------------------------------------------------------------------------

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@261367 91177308-0d34-0410-b5e6-96231b3b80d8

commit fdf40bea4fc416643210790fff4345be98d97245
Author: Hans Wennborg <[email protected]>
Date:   Fri Feb 19 21:28:08 2016 +0000

    Merging r261365:
    ------------------------------------------------------------------------
    r261365 | hans | 2016-02-19 13:26:31 -0800 (Fri, 19 Feb 2016) | 3 lines

    Revert r253557 "Alternative to long nops for X86 CPUs, by Andrey Turetsky"

    Turns out the new nop sequences aren't actually nops on x86_64 (PR26554).
    ------------------------------------------------------------------------

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@261366 91177308-0d34-0410-b5e6-96231b3b80d8

commit 413ee9f101de92d75fc11334ffeb6a054d67a18c
Author: Renato Golin <[email protected]>
Date:   Fri Feb 19 17:35:27 2016 +0000

    Merge r261331: avoid out of bounds loads for interleaved access vectorization

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@261341 91177308-0d34-0410-b5e6-96231b3b80d8

commit 124d2bc4dc3298d2b669be23a5b640d985319b65
Author: Hans Wennborg <[email protected]>
Date:   Fri Feb 19 17:13:16 2016 +0000

    Merging r261306:
    ------------------------------------------------------------------------
    r261306 | matze | 2016-02-18 20:44:19 -0800 (Thu, 18 Feb 2016) | 1 line

    LegalizeDAG: Fix ExpandFCOPYSIGN assuming the same type on both inputs
    ------------------------------------------------------------------------

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@261334 91177308-0d34-0410-b5e6-96231b3b80d8

commit 6f28d52e9d3f87875732a0f2c1f3b03ef56be2db
Author: Hans Wennborg <[email protected]>
Date:   Fri Feb 19 00:08:56 2016 +0000

    Merging r261258:
    ------------------------------------------------------------------------
    r261258 | rnk | 2016-02-18 12:57:41 -0800 (Thu, 18 Feb 2016) | …
jdenny-ornl pushed a commit that referenced this issue Nov 3, 2021
Optimize ([add|sub] r, imm) -> ([ADD|SUB] ([ADD|SUB] r, #imm0, lsl #12), #imm1),
if imm == (imm0<<12)+imm1. and both imm0 and imm1 are non-zero 12-bit unsigned
integers.

Optimize ([add|sub] r, imm) -> ([SUB|ADD] ([SUB|ADD] r, #imm0, lsl #12), #imm1),
if imm == -(imm0<<12)-imm1, and both imm0 and imm1 are non-zero 12-bit unsigned
integers.

Reviewed By: jaykang10, dmgreen

Differential Revision: https://reviews.llvm.org/D111034
jdenny-ornl pushed a commit that referenced this issue Nov 9, 2021
Fixes a CHECK-failure caused by glibc's pthread_getattr_np
implementation calling realloc.  Essentially, Thread::GenerateRandomTag
gets called during Thread::Init and before Thread::InitRandomState:

  HWAddressSanitizer: CHECK failed: hwasan_thread.cpp:134 "((random_buffer_)) != (0)" (0x0, 0x0) (tid=314)
    #0 0x55845475a662 in __hwasan::CheckUnwind()
    #1 0x558454778797 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long)
    #2 0x558454766461 in __hwasan::Thread::GenerateRandomTag(unsigned long)
    #3 0x55845475c58b in __hwasan::HwasanAllocate(__sanitizer::StackTrace*, unsigned long, unsigned long, bool)
    #4 0x55845475c80a in __hwasan::hwasan_realloc(void*, unsigned long, __sanitizer::StackTrace*)
    #5 0x5584547608aa in realloc
    #6 0x7f6f3a3d8c2c in pthread_getattr_np
    #7 0x5584547790dc in __sanitizer::GetThreadStackTopAndBottom(bool, unsigned long*, unsigned long*)
    #8 0x558454779651 in __sanitizer::GetThreadStackAndTls(bool, unsigned long*, unsigned long*, unsigned long*, unsigned long*)
    #9 0x558454761bca in __hwasan::Thread::InitStackAndTls(__hwasan::Thread::InitState const*)
    #10 0x558454761e5c in __hwasan::HwasanThreadList::CreateCurrentThread(__hwasan::Thread::InitState const*)
    #11 0x55845476184f in __hwasan_thread_enter
    #12 0x558454760def in HwasanThreadStartFunc(void*)
    #13 0x7f6f3a3d6fa2 in start_thread
    #14 0x7f6f3a15b4ce in __clone

Also reverts 7a3fb71, as it's now
unneeded.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D113045
jdenny-ornl pushed a commit that referenced this issue Jan 17, 2022
Fixes the build issue with D111034, whose goal was to optimize
add/sub with long immediates.

Optimize ([add|sub] r, imm) -> ([ADD|SUB] ([ADD|SUB] r, #imm0, lsl #12), #imm1),
if imm == (imm0<<12)+imm1. and both imm0 and imm1 are non-zero 12-bit unsigned
integers.

Optimize ([add|sub] r, imm) -> ([SUB|ADD] ([SUB|ADD] r, #imm0, lsl #12), #imm1),
if imm == -(imm0<<12)-imm1, and both imm0 and imm1 are non-zero 12-bit unsigned
integers.

The change which fixed the build issue in D111034 was the use of new virtual
registers so that SSA form is maintained until deleting MI.

Differential Revision: https://reviews.llvm.org/D117429
jdenny-ornl pushed a commit that referenced this issue Jan 22, 2022
Fixes the build issue with D111034, whose goal was to optimize
add/sub with long immediates.

Optimize ([add|sub] r, imm) -> ([ADD|SUB] ([ADD|SUB] r, #imm0, lsl #12), #imm1),
if imm == (imm0<<12)+imm1. and both imm0 and imm1 are non-zero 12-bit unsigned
integers.

Optimize ([add|sub] r, imm) -> ([SUB|ADD] ([SUB|ADD] r, #imm0, lsl #12), #imm1),
if imm == -(imm0<<12)-imm1, and both imm0 and imm1 are non-zero 12-bit unsigned
integers.

The change which fixed the build issue in D111034 was the use of new virtual
registers so that SSA form is maintained until deleting MI.

Differential Revision: https://reviews.llvm.org/D117429
jdenny-ornl pushed a commit that referenced this issue Feb 2, 2022
We experienced some deadlocks when we used multiple threads for logging
using `scan-builds` intercept-build tool when we used multiple threads by
e.g. logging `make -j16`

```
(gdb) bt
#0  0x00007f2bb3aff110 in __lll_lock_wait () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007f2bb3af70a3 in pthread_mutex_lock () from /lib/x86_64-linux-gnu/libpthread.so.0
#2  0x00007f2bb3d152e4 in ?? ()
#3  0x00007ffcc5f0cc80 in ?? ()
#4  0x00007f2bb3d2bf5b in ?? () from /lib64/ld-linux-x86-64.so.2
#5  0x00007f2bb3b5da27 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#6  0x00007f2bb3b5dbe0 in exit () from /lib/x86_64-linux-gnu/libc.so.6
#7  0x00007f2bb3d144ee in ?? ()
#8  0x746e692f706d742f in ?? ()
#9  0x692d747065637265 in ?? ()
#10 0x2f653631326b3034 in ?? ()
#11 0x646d632e35353532 in ?? ()
#12 0x0000000000000000 in ?? ()
```

I think the gcc's exit call caused the injected `libear.so` to be unloaded
by the `ld`, which in turn called the `void on_unload() __attribute__((destructor))`.
That tried to acquire an already locked mutex which was left locked in the
`bear_report_call()` call, that probably encountered some error and
returned early when it forgot to unlock the mutex.

All of these are speculation since from the backtrace I could not verify
if frames 2 and 3 are in fact corresponding to the `libear.so` module.
But I think it's a fairly safe bet.

So, hereby I'm releasing the held mutex on *all paths*, even if some failure
happens.

PS: I would use lock_guards, but it's C.

Reviewed-by: NoQ

Differential Revision: https://reviews.llvm.org/D118439
jdenny-ornl pushed a commit that referenced this issue Feb 12, 2022
Implements ADDS/SUBS 24-bit immediate optimization using the
MIPeepholeOpt pass. This follows the pattern:

Optimize ([adds|subs] r, imm) -> ([ADDS|SUBS] ([ADD|SUB] r, #imm0, lsl #12), #imm1),
if imm == (imm0<<12)+imm1. and both imm0 and imm1 are non-zero 12-bit unsigned
integers.

Optimize ([adds|subs] r, imm) -> ([SUBS|ADDS] ([SUB|ADD] r, #imm0, lsl #12), #imm1),
if imm == -(imm0<<12)-imm1, and both imm0 and imm1 are non-zero 12-bit unsigned
integers.

The SplitAndOpcFunc type had to change the return type to an Opcode pair so that
the first add/sub is the regular instruction and the second is the flag setting
instruction. This required updating the code in the AND case.

Testing:

I ran a two stage bootstrap with this code.
Using the second stage compiler, I verified that the negation of an ADDS to SUBS
or vice versa is a valid optimization. Example V == -0x111111.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D118663
jdenny-ornl pushed a commit that referenced this issue Feb 19, 2022
Implements ADDS/SUBS 24-bit immediate optimization using the
MIPeepholeOpt pass. This follows the pattern:

Optimize ([adds|subs] r, imm) -> ([ADDS|SUBS] ([ADD|SUB] r, #imm0, lsl #12), #imm1),
if imm == (imm0<<12)+imm1. and both imm0 and imm1 are non-zero 12-bit unsigned
integers.

Optimize ([adds|subs] r, imm) -> ([SUBS|ADDS] ([SUB|ADD] r, #imm0, lsl #12), #imm1),
if imm == -(imm0<<12)-imm1, and both imm0 and imm1 are non-zero 12-bit unsigned
integers.

The SplitAndOpcFunc type had to change the return type to an Opcode pair so that
the first add/sub is the regular instruction and the second is the flag setting
instruction. This required updating the code in the AND case.

Testing:

I ran a two stage bootstrap with this code.
Using the second stage compiler, I verified that the negation of an ADDS to SUBS
or vice versa is a valid optimization. Example V == -0x111111.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D118663
jdenny-ornl pushed a commit that referenced this issue Apr 19, 2022
Currently for the branch insn like
   "if $dst "#OpcodeStr#" $imm goto $BrDst"
The $BrDst range needs to be in the range of [INT16_MIN, INT16_MAX].

When running bpf selftest with latest llvm, I found
pyperf600.o generated insn with range outside
of [INT16_MIN, INT16_MAX], which caused verifier failure.
See below insn #12.

  0000000000000000 <on_event>:
  ; {
         0:       7b 1a 00 ff 00 00 00 00 *(u64 *)(r10 - 256) = r1
  ;       uint64_t pid_tgid = bpf_get_current_pid_tgid();
         1:       85 00 00 00 0e 00 00 00 call 14
         2:       bf 06 00 00 00 00 00 00 r6 = r0
  ;       pid_t pid = (pid_t)(pid_tgid >> 32);
         3:       bf 61 00 00 00 00 00 00 r1 = r6
         4:       77 01 00 00 20 00 00 00 r1 >>= 32
         5:       63 1a fc ff 00 00 00 00 *(u32 *)(r10 - 4) = r1
         6:       bf a2 00 00 00 00 00 00 r2 = r10
         7:       07 02 00 00 fc ff ff ff r2 += -4
  ;       PidData* pidData = bpf_map_lookup_elem(&pidmap, &pid);
         8:       18 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 r1 = 0 ll
        10:       85 00 00 00 01 00 00 00 call 1
        11:       bf 08 00 00 00 00 00 00 r8 = r0
  ;       if (!pidData)
        12:       15 08 15 e8 00 00 00 00 if r8 == 0 goto -6123 <LBB0_27588+0xffffffffffdae100>
        13:       b4 01 00 00 00 00 00 00 w1 = 0

We may need to add new insn to extend the range of $BrDst.
This patch added a fatal error if out of range so compiler can warn
the otherwise incorrect code generation.

Differential Revision: https://reviews.llvm.org/D123877
jdenny-ornl pushed a commit that referenced this issue Jun 2, 2022
For functions that require restoring SP from FP (e.g. that need to
align the stack, or that have variable sized allocations), the prologue
and epilogue previously used to look like this:

    push {r4-r5, r11, lr}
    add r11, sp, #8
    ...
    sub r4, r11, #8
    mov sp, r4
    pop {r4-r5, r11, pc}

This is problematic, because this unwinding operation (restoring sp
from r11 - offset) can't be expressed with the SEH unwind opcodes
(probably because this unwind procedure doesn't map exactly to
individual instructions; note the detour via r4 in the epilogue too).

To make unwinding work, the GPR push is split into two; the first one
pushing all other registers, and the second one pushing r11+lr, so that
r11 can be set pointing at this spot on the stack:

    push {r4-r5}
    push {r11, lr}
    mov r11, sp
    ...
    mov sp, r11
    pop {r11, lr}
    pop {r4-r5}
    bx lr

For the same setup, MSVC generates code that uses two registers;
r11 still pointing at the {r11,lr} pair, but a separate register
used for restoring the stack at the end:

    push {r4-r5, r7, r11, lr}
    add r11, sp, #12
    mov r7, sp
    ...
    mov sp, r7
    pop {r4-r5, r7, r11, pc}

For cases with clobbered float/vector registers, they are pushed
after the GPRs, before the {r11,lr} pair.

Differential Revision: https://reviews.llvm.org/D125649
jdenny-ornl pushed a commit that referenced this issue Jun 3, 2022
Previously, the "add sp, #12" ended up inserted after "bx lr".

Differential Revision: https://reviews.llvm.org/D126872
jdenny-ornl pushed a commit that referenced this issue Sep 21, 2022
Commit de3445e (https://reviews.llvm.org/D132096) made
changes to isVectorPromotionViable basically doing

  // Create Vector with size of V, and each element of type Ty
  ...
  uint64_t ElementSize = DL.getTypeStoreSizeInBits(Ty).getFixedSize();
  uint64_t VectorSize = DL.getTypeSizeInBits(V).getFixedSize();
  ...
  VectorType *VTy = VectorType::get(Ty, VectorSize / ElementSize, false);

Not quite sure why it uses the TypeStoreSize for the ElementSize,
but the new vector would only match in size with the old vector in
situations when the TypeStoreSize equals the TypeSize for Ty.
Therefore this patch adds a typeSizeEqualsStoreSize check as yet
another condition for allowing the the new type as a promotion
candidate.

Without this fix the new @test15 test would fail with an assert
like this:

opt: ../lib/Transforms/Scalar/SROA.cpp:1966:
  auto isVectorPromotionViable(llvm::sroa::Partition &,
                               const llvm::DataLayout &)
       ::(anonymous class)::operator()(llvm::VectorType *,
                                       llvm::VectorType *) const:
  Assertion `DL.getTypeSizeInBits(RHSTy).getFixedSize() ==
             DL.getTypeSizeInBits(LHSTy).getFixedSize() &&
             "Cannot have vector types of different sizes!"' failed.
 ...
 #8  isVectorPromotionViable(...)::$_10::operator()...
 #9  llvm::SROAPass::rewritePartition(...)
#10  llvm::SROAPass::splitAlloca(...)
#11  llvm::SROAPass::runOnAlloca(...)
#12  llvm::SROAPass::runImpl(...)
#13  llvm::SROAPass::run(...)

Reviewed By: MatzeB

Differential Revision: https://reviews.llvm.org/D134032
jdenny-ornl pushed a commit that referenced this issue Oct 25, 2022
The low-level decoder might fall into an infinite decoding loop for
various reasons, the simplest being an infinite direct loop reached due
to wrong handling of self-modified code in the kernel, e.g. it might
reach

```
0x0A: pause
0x0C: jump to 0x0A
```

In this case, all the code is sequential and requires no packets to be
decoded. The low-level decoder would produce an output like the
following

```
0x0A: pause
0x0C: jump to 0x0A
0x0A: pause
0x0C: jump to 0x0A
0x0A: pause
0x0C: jump to 0x0A
... infinite amount of times
```

These cases require stopping the decoder to avoid infinite work and signal this
at least as a trace error.

- Add a check that breaks decoding of a single PSB once 500k instructions have been decoded since the last packet was processed.
- Add a check that looks for infinite loops after certain amount of instructions have been decoded since the last packet was processed.
- Add some `settings` properties for tweaking the thresholds of the checks above. This is also nice because it does the basic work needed for future settings.
- Add an AnomalyDetector class that inspects the DecodedThread and the libipt decoder in search for anomalies. These anomalies are then signaled as fatal errors in the trace.
- Add an ErrorStats class that keeps track of all the errors in a DecodedThread, with a special counter for fatal errors.
- Add an entry for decoded thread errors in the `dump info` command.

Some notes are added in the code and in the documention of the settings,
so please read them.

Besides that, I haven't been unable to create a test case in LLVM style, but
I've found an anomaly in the thread #12 of the trace
72533820-3eb8-4465-b8e4-4e6bf0ccca99 at Meta. We have to figure out how to
artificially create traces with this kind of anomalies in LLVM style.

With this change, that anomalous thread now shows:

```
(lldb)thread trace dump instructions 12 -e -i 23101

thread #12: tid = 8
    ...missing instructions
    23101: (error) anomalous trace: possible infinite loop detected of size 2
  vmlinux-5.12.0-0_fbk8_clang_6656_gc85768aa64da`panic_smp_self_stop + 5 [inlined] rep_nop at processor.h:13:2
    23100: 0xffffffff81342785    pause
  vmlinux-5.12.0-0_fbk8_clang_6656_gc85768aa64da`panic_smp_self_stop + 7 at panic.c:87:2
    23099: 0xffffffff81342787    jmp    0xffffffff81342785        ; <+5> [inlined] rep_nop at processor.h:13:2
  vmlinux-5.12.0-0_fbk8_clang_6656_gc85768aa64da`panic_smp_self_stop + 5 [inlined] rep_nop at processor.h:13:2
    23098: 0xffffffff81342785    pause
  vmlinux-5.12.0-0_fbk8_clang_6656_gc85768aa64da`panic_smp_self_stop + 7 at panic.c:87:2
    23097: 0xffffffff81342787    jmp    0xffffffff81342785        ; <+5> [inlined] rep_nop at processor.h:13:2
  vmlinux-5.12.0-0_fbk8_clang_6656_gc85768aa64da`panic_smp_self_stop + 5 [inlined] rep_nop at processor.h:13:2
    23096: 0xffffffff81342785    pause
  vmlinux-5.12.0-0_fbk8_clang_6656_gc85768aa64da`panic_smp_self_stop + 7 at panic.c:87:2
    23095: 0xffffffff81342787    jmp    0xffffffff81342785        ; <+5> [inlined] rep_nop at processor.h:13:2
```

It used to be in an infinite loop where the decoder never stopped.

Besides that, the dump info command shows

```
(lldb) thread trace dump info 12

 Errors:
    Number of individual errors: 32
      Number of fatal errors: 1
      Number of other errors: 31
```

and in json format

```
(lldb) thread trace dump info 12 -j

 "errors": {
      "totalCount": 32,
      "libiptErrors": {},
      "fatalErrors": 1,
      "otherErrors": 31
    }
```

Differential Revision: https://reviews.llvm.org/D136557
jdenny-ornl pushed a commit that referenced this issue Oct 31, 2022
Found by msan -fsanitize-memory-use-after-dtor.

==8259==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x55dbec54d2b8 in dtorRecord(clang::interp::Block*, char*, clang::interp::Descriptor*) clang/lib/AST/Interp/Descriptor.cpp:150:22
    #1 0x55dbec54bfcf in dtorArrayDesc(clang::interp::Block*, char*, clang::interp::Descriptor*) clang/lib/AST/Interp/Descriptor.cpp:97:7
    #2 0x55dbec508578 in invokeDtor clang/lib/AST/Interp/InterpBlock.h:79:7
    #3 0x55dbec508578 in clang::interp::Program::~Program() clang/lib/AST/Interp/Program.h:55:19
    #4 0x55dbec50657a in operator() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:55:5
    #5 0x55dbec50657a in std::__msan::unique_ptr<clang::interp::Program, std::__msan::default_delete<clang::interp::Program>>::~unique_ptr() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:261:7
    #6 0x55dbec5035a1 in clang::interp::Context::~Context() clang/lib/AST/Interp/Context.cpp:27:22
    #7 0x55dbebec1daa in operator() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:55:5
    #8 0x55dbebec1daa in std::__msan::unique_ptr<clang::interp::Context, std::__msan::default_delete<clang::interp::Context>>::~unique_ptr() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:261:7
    #9 0x55dbebe285f9 in clang::ASTContext::~ASTContext() clang/lib/AST/ASTContext.cpp:1038:40
    #10 0x55dbe941ff13 in llvm::RefCountedBase<clang::ASTContext>::Release() const llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:101:7
    #11 0x55dbe94353ef in release llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:159:38
    #12 0x55dbe94353ef in release llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:224:7
    #13 0x55dbe94353ef in ~IntrusiveRefCntPtr llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:191:27
    #14 0x55dbe94353ef in clang::CompilerInstance::setASTContext(clang::ASTContext*) clang/lib/Frontend/CompilerInstance.cpp:178:3
    #15 0x55dbe95ad0ad in clang::FrontendAction::EndSourceFile() clang/lib/Frontend/FrontendAction.cpp:1100:8
    #16 0x55dbe9445fcf in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) clang/lib/Frontend/CompilerInstance.cpp:1047:11
    #17 0x55dbe6b3afef in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:266:25
    #18 0x55dbe6b13288 in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) clang/tools/driver/cc1_main.cpp:250:15
    #19 0x55dbe6b0095f in ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) clang/tools/driver/driver.cpp:319:12
    #20 0x55dbe6aff41c in clang_main(int, char**) clang/tools/driver/driver.cpp:395:12
    #21 0x7f9be07fa632 in __libc_start_main
    #22 0x55dbe6a702e9 in _start

  Member fields were destroyed
    #0 0x55dbe6a7da5d in __sanitizer_dtor_callback_fields compiler-rt/lib/msan/msan_interceptors.cpp:949:5
    #1 0x55dbec5094ac in ~SmallVectorImpl llvm/include/llvm/ADT/SmallVector.h:479:7
    #2 0x55dbec5094ac in ~SmallVectorImpl llvm/include/llvm/ADT/SmallVector.h:612:3
    #3 0x55dbec5094ac in llvm::SmallVector<clang::interp::Record::Base, 8u>::~SmallVector() llvm/include/llvm/ADT/SmallVector.h:1207:3
    #4 0x55dbec508e79 in clang::interp::Record::~Record() clang/lib/AST/Interp/Record.h:24:7
    #5 0x55dbec508612 in clang::interp::Program::~Program() clang/lib/AST/Interp/Program.h:49:26
    #6 0x55dbec50657a in operator() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:55:5
    #7 0x55dbec50657a in std::__msan::unique_ptr<clang::interp::Program, std::__msan::default_delete<clang::interp::Program>>::~unique_ptr() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:261:7
    #8 0x55dbec5035a1 in clang::interp::Context::~Context() clang/lib/AST/Interp/Context.cpp:27:22
    #9 0x55dbebec1daa in operator() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:55:5
    #10 0x55dbebec1daa in std::__msan::unique_ptr<clang::interp::Context, std::__msan::default_delete<clang::interp::Context>>::~unique_ptr() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:261:7
    #11 0x55dbebe285f9 in clang::ASTContext::~ASTContext() clang/lib/AST/ASTContext.cpp:1038:40
    #12 0x55dbe941ff13 in llvm::RefCountedBase<clang::ASTContext>::Release() const llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:101:7
    #13 0x55dbe94353ef in release llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:159:38
    #14 0x55dbe94353ef in release llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:224:7
    #15 0x55dbe94353ef in ~IntrusiveRefCntPtr llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:191:27
    #16 0x55dbe94353ef in clang::CompilerInstance::setASTContext(clang::ASTContext*) clang/lib/Frontend/CompilerInstance.cpp:178:3
    #17 0x55dbe95ad0ad in clang::FrontendAction::EndSourceFile() clang/lib/Frontend/FrontendAction.cpp:1100:8
    #18 0x55dbe9445fcf in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) clang/lib/Frontend/CompilerInstance.cpp:1047:11
    #19 0x55dbe6b3afef in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:266:25
    #20 0x55dbe6b13288 in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) clang/tools/driver/cc1_main.cpp:250:15
    #21 0x55dbe6b0095f in ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) clang/tools/driver/driver.cpp:319:12
    #22 0x55dbe6aff41c in clang_main(int, char**) clang/tools/driver/driver.cpp:395:12
    #23 0x7f9be07fa632 in __libc_start_main
    #24 0x55dbe6a702e9 in _start
jdenny-ornl pushed a commit that referenced this issue Dec 19, 2022
…D112621

It seems like `LHS` and `RHS` could be empty range sets.
This caused an assertion failure inside RangeConstraintManager.

I'm hoisting out the check from the function into the call-site.
This way we could assert that we only want to deal with non-empty range
sets.

The relevant part of the trace:
```
 #6 0x00007fe6ff5f81a6 __assert_fail_base (/lib64/libc.so.6+0x2f1a6)
 #7 0x00007fe6ff5f8252 (/lib64/libc.so.6+0x2f252)
 #8 0x00000000049caed2 (anonymous namespace)::SymbolicRangeInferrer::VisitBinaryOperator(clang::ento::RangeSet, clang::BinaryOperatorKind, clang::ento::RangeSet, clang::QualType) RangeConstraintManager.cpp:0:0
 #9 0x00000000049c9867 (anonymous namespace)::SymbolicRangeInferrer::infer(clang::ento::SymExpr const*) RangeConstraintManager.cpp:0:0
#10 0x00000000049bebf5 (anonymous namespace)::RangeConstraintManager::assumeSymNE(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*, llvm::APSInt const&, llvm::APSInt const&) RangeConstraintManager.cpp:0:0
#11 0x00000000049d368c clang::ento::RangedConstraintManager::assumeSymUnsupported(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*, bool) (../../main-github/llvm/build-all/bin/clang+0x49d368c)
#12 0x00000000049f0b09 clang::ento::SimpleConstraintManager::assumeAux(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::NonLoc, bool) (../../main-github/llvm/build-all/bin/clang+0x49f0b09)
#13 0x00000000049f096a clang::ento::SimpleConstraintManager::assume(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::NonLoc, bool) (../../main-github/llvm/build-all/bin/clang+0x49f096a)
#14 0x00000000049f086d clang::ento::SimpleConstraintManager::assumeInternal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::DefinedSVal, bool) (../../main-github/llvm/build-all/bin/clang+0x49f086d)
#15 0x000000000492d3e3 clang::ento::ConstraintManager::assumeDual(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::DefinedSVal) (../../main-github/llvm/build-all/bin/clang+0x492d3e3)
#16 0x0000000004955b6d clang::ento::ExprEngine::evalEagerlyAssumeBinOpBifurcation(clang::ento::ExplodedNodeSet&, clang::ento::ExplodedNodeSet&, clang::Expr const*) (../../main-github/llvm/build-all/bin/clang+0x4955b6d)
#17 0x00000000049514b6 clang::ento::ExprEngine::Visit(clang::Stmt const*, clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) (../../main-github/llvm/build-all/bin/clang+0x49514b6)
#18 0x000000000494c73e clang::ento::ExprEngine::ProcessStmt(clang::Stmt const*, clang::ento::ExplodedNode*) (../../main-github/llvm/build-all/bin/clang+0x494c73e)
#19 0x000000000494c459 clang::ento::ExprEngine::processCFGElement(clang::CFGElement, clang::ento::ExplodedNode*, unsigned int, clang::ento::NodeBuilderContext*) (../../main-github/llvm/build-all/bin/clang+0x494c459)
#20 0x000000000492f3d0 clang::ento::CoreEngine::HandlePostStmt(clang::CFGBlock const*, unsigned int, clang::ento::ExplodedNode*) (../../main-github/llvm/build-all/bin/clang+0x492f3d0)
#21 0x000000000492e1f6 clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*, unsigned int, llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>) (../../main-github/llvm/build-all/bin/clang+0x492e1f6)
```

Differential Revision: https://reviews.llvm.org/D112621
jdenny-ornl pushed a commit that referenced this issue Mar 22, 2023
This change prevents rare deadlocks observed for specific macOS/iOS GUI
applications which issue many `dlopen()` calls from multiple different
threads at startup and where TSan finds and reports a race during
startup.  Providing a reliable test for this has been deemed infeasible.

Although I've only observed this deadlock on Apple platforms,
conceptually the cause is not confined to Apple code so the fix lives in
platform-independent code.

Deadlock scenario:
```
Thread 2                    | Thread 4
ReportRace()                |
Lock internal TSan mutexes  |
  &ctx->slot_mtx            |
                            | dlopen() interceptor
                            | OnLibraryLoaded()
                            | MemoryMappingLayout::DumpListOfModules()
                            | calls dyld API, which takes internal lock
                            | lock() interceptor
                            | TSan tries to take internal mutexes again
                            |   &ctx->slot_mtx
call into symbolizer        |
MemoryMappingLayout::DumpListOfModules()
calls dyld API, which hangs on trying to take lock
```
Resulting in:
* Thread 2 has internal TSan mutex, blocked on dyld lock
* Thread 4 has dyld lock, blocked on internal TSan mutex

The fix prevents this situation by not intercepting any of the calls
originating from `MemoryMappingLayout::DumpListOfModules()`.

Stack traces for deadlock between ReportRace() and dlopen() interceptor:
```
thread #2, queue = 'com.apple.root.default-qos'
  frame #0: libsystem_kernel.dylib
  frame #1: libclang_rt.tsan_osx_dynamic.dylib`::wrap_os_unfair_lock_lock_with_options(lock=<unavailable>, options=<unavailable>) at tsan_interceptors_mac.cpp:306:3
  frame #2: dyld`dyld4::RuntimeLocks::withLoadersReadLock(this=0x000000016f21b1e0, work=0x00000001814523c0) block_pointer) at DyldRuntimeState.cpp:227:28
  frame #3: dyld`dyld4::APIs::_dyld_get_image_header(this=0x0000000101012a20, imageIndex=614) at DyldAPIs.cpp:240:11
  frame #4: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::MemoryMappingLayout::CurrentImageHeader(this=<unavailable>) at sanitizer_procmaps_mac.cpp:391:35
  frame #5: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::MemoryMappingLayout::Next(this=0x000000016f2a2800, segment=0x000000016f2a2738) at sanitizer_procmaps_mac.cpp:397:51
  frame #6: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::MemoryMappingLayout::DumpListOfModules(this=0x000000016f2a2800, modules=0x00000001011000a0) at sanitizer_procmaps_mac.cpp:460:10
  frame #7: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::ListOfModules::init(this=0x00000001011000a0) at sanitizer_mac.cpp:610:18
  frame #8: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::Symbolizer::FindModuleForAddress(unsigned long) [inlined] __sanitizer::Symbolizer::RefreshModules(this=0x0000000101100078) at sanitizer_symbolizer_libcdep.cpp:185:12
  frame #9: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::Symbolizer::FindModuleForAddress(this=0x0000000101100078, address=6465454512) at sanitizer_symbolizer_libcdep.cpp:204:5
  frame #10: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::Symbolizer::SymbolizePC(this=0x0000000101100078, addr=6465454512) at sanitizer_symbolizer_libcdep.cpp:88:15
  frame #11: libclang_rt.tsan_osx_dynamic.dylib`__tsan::SymbolizeCode(addr=6465454512) at tsan_symbolize.cpp:106:35
  frame #12: libclang_rt.tsan_osx_dynamic.dylib`__tsan::SymbolizeStack(trace=StackTrace @ 0x0000600002d66d00) at tsan_rtl_report.cpp:112:28
  frame #13: libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedReportBase::AddMemoryAccess(this=0x000000016f2a2a90, addr=4381057136, external_tag=<unavailable>, s=<unavailable>, tid=<unavailable>, stack=<unavailable>, mset=0x00000001012fc310) at tsan_rtl_report.cpp:190:16
  frame #14: libclang_rt.tsan_osx_dynamic.dylib`__tsan::ReportRace(thr=0x00000001012fc000, shadow_mem=0x000008020a4340e0, cur=<unavailable>, old=<unavailable>, typ0=1) at tsan_rtl_report.cpp:795:9
  frame #15: libclang_rt.tsan_osx_dynamic.dylib`__tsan::DoReportRace(thr=0x00000001012fc000, shadow_mem=0x000008020a4340e0, cur=Shadow @ x22, old=Shadow @ 0x0000600002d6b4f0, typ=1) at tsan_rtl_access.cpp:166:3
  frame #16: libclang_rt.tsan_osx_dynamic.dylib`::__tsan_read8(void *) at tsan_rtl_access.cpp:220:5
  frame #17: libclang_rt.tsan_osx_dynamic.dylib`::__tsan_read8(void *) [inlined] __tsan::MemoryAccess(thr=0x00000001012fc000, pc=<unavailable>, addr=<unavailable>, size=8, typ=1) at tsan_rtl_access.cpp:442:3
  frame #18: libclang_rt.tsan_osx_dynamic.dylib`::__tsan_read8(addr=<unavailable>) at tsan_interface.inc:34:3
  <call into TSan from from instrumented code>

thread #4, queue = 'com.apple.dock.fullscreen'
  frame #0:  libsystem_kernel.dylib
  frame #1:  libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::FutexWait(p=<unavailable>, cmp=<unavailable>) at sanitizer_mac.cpp:540:3
  frame #2:  libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::Semaphore::Wait(this=<unavailable>) at sanitizer_mutex.cpp:35:7
  frame #3:  libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::Mutex::Lock(this=0x0000000102992a80) at sanitizer_mutex.h:196:18
  frame #4:  libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedInterceptor::~ScopedInterceptor() [inlined] __sanitizer::GenericScopedLock<__sanitizer::Mutex>::GenericScopedLock(this=<unavailable>, mu=0x0000000102992a80) at sanitizer_mutex.h:383:10
  frame #5:  libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedInterceptor::~ScopedInterceptor() [inlined] __sanitizer::GenericScopedLock<__sanitizer::Mutex>::GenericScopedLock(this=<unavailable>, mu=0x0000000102992a80) at sanitizer_mutex.h:382:77
  frame #6:  libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedInterceptor::~ScopedInterceptor() at tsan_rtl.h:708:10
  frame #7:  libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedInterceptor::~ScopedInterceptor() [inlined] __tsan::TryTraceFunc(thr=0x000000010f084000, pc=0) at tsan_rtl.h:751:7
  frame #8:  libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedInterceptor::~ScopedInterceptor() [inlined] __tsan::FuncExit(thr=0x000000010f084000) at tsan_rtl.h:798:7
  frame #9:  libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedInterceptor::~ScopedInterceptor(this=0x000000016f3ba280) at tsan_interceptors_posix.cpp:300:5
  frame #10: libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedInterceptor::~ScopedInterceptor(this=<unavailable>) at tsan_interceptors_posix.cpp:293:41
  frame #11: libclang_rt.tsan_osx_dynamic.dylib`::wrap_os_unfair_lock_lock_with_options(lock=0x000000016f21b1e8, options=OS_UNFAIR_LOCK_NONE) at tsan_interceptors_mac.cpp:310:1
  frame #12: dyld`dyld4::RuntimeLocks::withLoadersReadLock(this=0x000000016f21b1e0, work=0x00000001814525d4) block_pointer) at DyldRuntimeState.cpp:227:28
  frame #13: dyld`dyld4::APIs::_dyld_get_image_vmaddr_slide(this=0x0000000101012a20, imageIndex=412) at DyldAPIs.cpp:273:11
  frame #14: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::MemoryMappingLayout::Next(__sanitizer::MemoryMappedSegment*) at sanitizer_procmaps_mac.cpp:286:17
  frame #15: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::MemoryMappingLayout::Next(this=0x000000016f3ba560, segment=0x000000016f3ba498) at sanitizer_procmaps_mac.cpp:432:15
  frame #16: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::MemoryMappingLayout::DumpListOfModules(this=0x000000016f3ba560, modules=0x000000016f3ba618) at sanitizer_procmaps_mac.cpp:460:10
  frame #17: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::ListOfModules::init(this=0x000000016f3ba618) at sanitizer_mac.cpp:610:18
  frame #18: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::LibIgnore::OnLibraryLoaded(this=0x0000000101f3aa40, name="<some library>") at sanitizer_libignore.cpp:54:11
  frame #19: libclang_rt.tsan_osx_dynamic.dylib`::wrap_dlopen(filename="<some library>", flag=<unavailable>) at sanitizer_common_interceptors.inc:6466:3
  <library code>
```

rdar://106766395

Differential Revision: https://reviews.llvm.org/D146593
jdenny-ornl pushed a commit that referenced this issue Jul 12, 2023
…tput

The crash happens in clang::driver::tools::SplitDebugName when Output is
InputInfo::Nothing. It doesn't happen with standalone clang driver because
output is created in Driver::BuildJobsForActionNoCache.

Example backtrace:
```
* thread #1, name = 'clangd', stop reason = hit program assert
  * frame #0: 0x00007ffff5c4eacf libc.so.6`raise + 271
    frame #1: 0x00007ffff5c21ea5 libc.so.6`abort + 295
    frame #2: 0x00007ffff5c21d79 libc.so.6`__assert_fail_base.cold.0 + 15
    frame #3: 0x00007ffff5c47426 libc.so.6`__assert_fail + 70
    frame #4: 0x000055555dc0923c clangd`clang::driver::InputInfo::getFilename(this=0x00007fffffff9398) const at InputInfo.h:84:5
    frame #5: 0x000055555dcd0d8d clangd`clang::driver::tools::SplitDebugName(JA=0x000055555f6c6a50, Args=0x000055555f6d0b80, Input=0x00007fffffff9678, Output=0x00007fffffff9398) at CommonArgs.cpp:1275:40
    frame #6: 0x000055555dc955a5 clangd`clang::driver::tools::Clang::ConstructJob(this=0x000055555f6c69d0, C=0x000055555f6c64a0, JA=0x000055555f6c6a50, Output=0x00007fffffff9398, Inputs=0x00007fffffff9668, Args=0x000055555f6d0b80, LinkingOutput=0x0000000000000000) const at Clang.cpp:5690:33
    frame #7: 0x000055555dbf6b54 clangd`clang::driver::Driver::BuildJobsForActionNoCache(this=0x00007fffffffb5e0, C=0x000055555f6c64a0, A=0x000055555f6c6a50, TC=0x000055555f6c4be0, BoundArch=(Data = 0x0000000000000000, Length = 0), AtTopLevel=true, MultipleArchs=false, LinkingOutput=0x0000000000000000, CachedResults=size=1, TargetDeviceOffloadKind=OFK_None) const at Driver.cpp:5618:10
    frame #8: 0x000055555dbf4ef0 clangd`clang::driver::Driver::BuildJobsForAction(this=0x00007fffffffb5e0, C=0x000055555f6c64a0, A=0x000055555f6c6a50, TC=0x000055555f6c4be0, BoundArch=(Data = 0x0000000000000000, Length = 0), AtTopLevel=true, MultipleArchs=false, LinkingOutput=0x0000000000000000, CachedResults=size=1, TargetDeviceOffloadKind=OFK_None) const at Driver.cpp:5306:26
    frame #9: 0x000055555dbeb590 clangd`clang::driver::Driver::BuildJobs(this=0x00007fffffffb5e0, C=0x000055555f6c64a0) const at Driver.cpp:4844:5
    frame #10: 0x000055555dbe6b0f clangd`clang::driver::Driver::BuildCompilation(this=0x00007fffffffb5e0, ArgList=ArrayRef<const char *> @ 0x00007fffffffb268) at Driver.cpp:1496:3
    frame #11: 0x000055555b0cc0d9 clangd`clang::createInvocation(ArgList=ArrayRef<const char *> @ 0x00007fffffffbb38, Opts=CreateInvocationOptions @ 0x00007fffffffbb90) at CreateInvocationFromCommandLine.cpp:53:52
    frame #12: 0x000055555b378e7b clangd`clang::clangd::buildCompilerInvocation(Inputs=0x00007fffffffca58, D=0x00007fffffffc158, CC1Args=size=0) at Compiler.cpp:116:44
    frame #13: 0x000055555895a6c8 clangd`clang::clangd::(anonymous namespace)::Checker::buildInvocation(this=0x00007fffffffc760, TFS=0x00007fffffffe570, Contents= Has Value=false ) at Check.cpp:212:9
    frame #14: 0x0000555558959cec clangd`clang::clangd::check(File=(Data = "build/test.cpp", Length = 64), TFS=0x00007fffffffe570, Opts=0x00007fffffffe600) at Check.cpp:486:34
    frame #15: 0x000055555892164a clangd`main(argc=4, argv=0x00007fffffffecd8) at ClangdMain.cpp:993:12
    frame #16: 0x00007ffff5c3ad85 libc.so.6`__libc_start_main + 229
    frame #17: 0x00005555585bbe9e clangd`_start + 46
```

Test Plan: ninja ClangDriverTests && tools/clang/unittests/Driver/ClangDriverTests

Differential Revision: https://reviews.llvm.org/D154602
jdenny-ornl pushed a commit that referenced this issue Sep 20, 2023
This crash was exposed recently in our randomized testing. _BitInts were
not being handled properly during IntegerLiteral visitation. This patch
addresses the problem for now.

The BitIntType has no getKind() method, so the FoldingSetID is taken
from the APInt value representing the _BitInt(), similar to other
methods in StmtProfile.cpp.

Crash seen (summary form):

clang-tidy: <src-root>/llvm/include/llvm/Support/Casting.h:566:
decltype(auto) llvm::cast(const From&) [with To = clang::BuiltinType;
From = clang::QualType]: Assertion `isa<To>(Val) && "cast<Ty>() argument
of incompatible type!"' failed

```
  #9 <address> decltype(auto) llvm::cast<clang::BuiltinType,
       clang::QualType>(clang::QualType const&)
       <src-root>/llvm/include/llvm/Support/Casting.h:566:3
 #10 <address> clang::BuiltinType const* clang::Type::castAs<clang::BuiltinType>() const
       <bin-root>/tools/clang/include/clang/AST/TypeNodes.inc:86:1
 #11 <address> (anonymous namespace)::StmtProfiler::VisitIntegerLiteral(
       clang::IntegerLiteral const*)
       <src-root>/clang/lib/AST/StmtProfile.cpp:1362:64
 #12 <address> clang::StmtVisitorBase<llvm::make_const_ptr,
       (anonymous namespace)::StmtProfiler, void>::Visit(clang::Stmt const*)
       <src-root>/clang/include/clang/AST/StmtNodes.inc:1225:1
```

Reviewed By: donat.nagy
jdenny-ornl pushed a commit that referenced this issue Sep 22, 2023
…rtzext x))) -> (assertzext x) fold"

This reverts commit 05926a5.

Caused AArch64 crash

 #12 0x00007f09eec09181 skipExtensionForVectorMULL(llvm::SDNode*, llvm::SelectionDAG&)
 #13 0x00007f09eec08289 llvm::AArch64TargetLowering::LowerMUL(llvm::SDValue, llvm::SelectionDAG&) const
 #14 0x00007f09eec1a3fd llvm::AArch64TargetLowering::LowerOperation(llvm::SDValue, llvm::SelectionDAG&) const
 #15 0x00007f09dc8586a7 (anonymous namespace)::VectorLegalizer::LowerOperationWrapper(llvm::SDNode*, llvm::SmallVectorImpl<llvm::SDValue>&)
jdenny-ornl pushed a commit that referenced this issue Oct 27, 2023
…tePluginObject

After llvm#68052 this function changed from returning
a nullptr with `return {};` to returning Expected and hitting `llvm_unreachable` before it could
do so.

I gather that we're never supposed to call this function, but on Windows we actually do call
this function because `interpreter->CreateScriptedProcessInterface()` returns
`ScriptedProcessInterface` not `ScriptedProcessPythonInterface`. Likely because
`target_sp->GetDebugger().GetScriptInterpreter()` also does not return a Python related class.

The previously XFAILed test crashed with:
```
 # .---command stderr------------
 # | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
 # | Stack dump:
 # | 0.  Program arguments: c:\\users\\tcwg\\david.spickett\\build-llvm\\bin\\lldb-test.exe ir-memory-map C:\\Users\\tcwg\\david.spickett\\build-llvm\\tools\\lldb\\test\\Shell\\Expr\\Output\\TestIRMemoryMapWindows.test.tmp C:\\Users\\tcwg\\david.spickett\\llvm-project\\lldb\\test\\Shell\\Expr/Inputs/ir-memory-map-basic
 # | 1.  HandleCommand(command = "run")
 # | Exception Code: 0xC000001D
 # | #0 0x00007ff696b5f588 lldb_private::ScriptedProcessInterface::CreatePluginObject(class llvm::StringRef, class lldb_private::ExecutionContext &, class std::shared_ptr<class lldb_private::StructuredData::Dictionary>, class lldb_private::StructuredData::Generic *) C:\Users\tcwg\david.spickett\llvm-project\lldb\include\lldb\Interpreter\Interfaces\ScriptedProcessInterface.h:28:0
 # | #1 0x00007ff696b1d808 llvm::Expected<std::shared_ptr<lldb_private::StructuredData::Generic> >::operator bool C:\Users\tcwg\david.spickett\llvm-project\llvm\include\llvm\Support\Error.h:567:0
 # | #2 0x00007ff696b1d808 lldb_private::ScriptedProcess::ScriptedProcess(class std::shared_ptr<class lldb_private::Target>, class std::shared_ptr<class lldb_private::Listener>, class lldb_private::ScriptedMetadata const &, class lldb_private::Status &) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Plugins\Process\scripted\ScriptedProcess.cpp:115:0
 # | #3 0x00007ff696b1d124 std::shared_ptr<lldb_private::ScriptedProcess>::shared_ptr C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1478:0
 # | #4 0x00007ff696b1d124 lldb_private::ScriptedProcess::CreateInstance(class std::shared_ptr<class lldb_private::Target>, class std::shared_ptr<class lldb_private::Listener>, class lldb_private::FileSpec const *, bool) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Plugins\Process\scripted\ScriptedProcess.cpp:61:0
 # | #5 0x00007ff69699c8f4 std::_Ptr_base<lldb_private::Process>::_Move_construct_from C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1237:0
 # | #6 0x00007ff69699c8f4 std::shared_ptr<lldb_private::Process>::shared_ptr C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1534:0
 # | #7 0x00007ff69699c8f4 std::shared_ptr<lldb_private::Process>::operator= C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1594:0
 # | #8 0x00007ff69699c8f4 lldb_private::Process::FindPlugin(class std::shared_ptr<class lldb_private::Target>, class llvm::StringRef, class std::shared_ptr<class lldb_private::Listener>, class lldb_private::FileSpec const *, bool) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Target\Process.cpp:396:0
 # | #9 0x00007ff6969bd708 std::_Ptr_base<lldb_private::Process>::_Move_construct_from C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1237:0
 # | #10 0x00007ff6969bd708 std::shared_ptr<lldb_private::Process>::shared_ptr C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1534:0
 # | #11 0x00007ff6969bd708 std::shared_ptr<lldb_private::Process>::operator= C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1594:0
 # | #12 0x00007ff6969bd708 lldb_private::Target::CreateProcess(class std::shared_ptr<class lldb_private::Listener>, class llvm::StringRef, class lldb_private::FileSpec const *, bool) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Target\Target.cpp:215:0
 # | #13 0x00007ff696b13af0 std::_Ptr_base<lldb_private::Process>::_Ptr_base C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1230:0
 # | #14 0x00007ff696b13af0 std::shared_ptr<lldb_private::Process>::shared_ptr C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1524:0
 # | #15 0x00007ff696b13af0 lldb_private::PlatformWindows::DebugProcess(class lldb_private::ProcessLaunchInfo &, class lldb_private::Debugger &, class lldb_private::Target &, class lldb_private::Status &) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Plugins\Platform\Windows\PlatformWindows.cpp:495:0
 # | #16 0x00007ff6969cf590 std::_Ptr_base<lldb_private::Process>::_Move_construct_from C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1237:0
 # | #17 0x00007ff6969cf590 std::shared_ptr<lldb_private::Process>::shared_ptr C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1534:0
 # | #18 0x00007ff6969cf590 std::shared_ptr<lldb_private::Process>::operator= C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\memory:1594:0
 # | #19 0x00007ff6969cf590 lldb_private::Target::Launch(class lldb_private::ProcessLaunchInfo &, class lldb_private::Stream *) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Target\Target.cpp:3274:0
 # | #20 0x00007ff696fff82c CommandObjectProcessLaunch::DoExecute(class lldb_private::Args &, class lldb_private::CommandReturnObject &) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Commands\CommandObjectProcess.cpp:258:0
 # | #21 0x00007ff696fab6c0 lldb_private::CommandObjectParsed::Execute(char const *, class lldb_private::CommandReturnObject &) C:\Users\tcwg\david.spickett\llvm-project\lldb\source\Interpreter\CommandObject.cpp:751:0
 # `-----------------------------
 # error: command failed with exit status: 0xc000001d
```

That might be a bug on the Windows side, or an artifact of how our build is setup,
but whatever it is, having `CreatePluginObject` return an error and
the caller check it, fixes the failing test.

The built lldb can run the script command to use Python, but I'm not sure if that means
anything.
jdenny-ornl pushed a commit that referenced this issue Nov 10, 2023
…ooking options for a custom subcommand (llvm#71975)

…ooking options for a custom subcommand. (llvm#71776)"

This reverts commit b88308b.

The build-bot is unhappy
(https://lab.llvm.org/buildbot/#/builders/186/builds/13096),
`GroupingAndPrefix` fails after `TopLevelOptInSubcommand` (the newly
added test).

Revert while I look into this (might be related with test sharding but
not sure)

```

[----------] 3 tests from CommandLineTest
[ RUN      ] CommandLineTest.TokenizeWindowsCommandLine2
[       OK ] CommandLineTest.TokenizeWindowsCommandLine2 (0 ms)
[ RUN      ] CommandLineTest.TopLevelOptInSubcommand
[       OK ] CommandLineTest.TopLevelOptInSubcommand (0 ms)
[ RUN      ] CommandLineTest.GroupingAndPrefix
 #0 0x00ba8118 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x594118)
 #1 0x00ba5914 llvm::sys::RunSignalHandlers() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x591914)
 #2 0x00ba89c4 SignalHandler(int) (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5949c4)
 #3 0xf7828530 __default_sa_restorer /build/glibc-9MGTF6/glibc-2.31/signal/../sysdeps/unix/sysv/linux/arm/sigrestorer.S:67:0
 #4 0x00af91f0 (anonymous namespace)::CommandLineParser::ResetAllOptionOccurrences() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x4e51f0)
 #5 0x00af8e1c llvm::cl::ResetCommandLineParser() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x4e4e1c)
 #6 0x0077cda0 (anonymous namespace)::CommandLineTest_GroupingAndPrefix_Test::TestBody() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x168da0)
 #7 0x00bc5adc testing::Test::Run() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5b1adc)
 #8 0x00bc6cc0 testing::TestInfo::Run() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5b2cc0)
 #9 0x00bc7880 testing::TestSuite::Run() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5b3880)
#10 0x00bd7974 testing::internal::UnitTestImpl::RunAllTests() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5c3974)
#11 0x00bd6ebc testing::UnitTest::Run() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5c2ebc)
#12 0x00bb1058 main (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x59d058)
#13 0xf78185a4 __libc_start_main /build/glibc-9MGTF6/glibc-2.31/csu/libc-start.c:342:3
```
jdenny-ornl pushed a commit that referenced this issue Nov 15, 2023
…2028)

Factor out some stack allocation in a separate function. This patch
splits out the generic portion of a larger refactoring done as a part of
stack clash protection support.

The patch is almost, but not quite NFC. The only difference should
be that where we have adjacent allocation of stack space
for local SVE objects and non-local SVE objects the order
of `sub sp, ...` and `addvl sp, ...` instructions is reversed, because now
it's done with a single call to `emitFrameOffset` and it happens
add/subtract the fixed part before the scalable part, e.g.

    addvl sp, sp, #-2
    sub sp, sp, #16, lsl #12
    sub sp, sp, #16

becomes

    sub sp, sp, #16, lsl #12
    sub sp, sp, #16
    addvl sp, sp, #-2
jdenny-ornl pushed a commit that referenced this issue Dec 5, 2023
When all the large const offsets masked with the same value from bit-12 to bit-23.
Fold
  add     x8, x0, llvm#2031, lsl #12
  add     x8, x8, llvm#960
  ldr     x9, [x8, x8]
  ldr     x8, [x8, llvm#2056]

into
  add     x8, x0, llvm#2031, lsl #12
  ldr     x9, [x8, llvm#960]
  ldr     x8, [x8, llvm#3016]
jdenny-ornl pushed a commit that referenced this issue Feb 21, 2024
…lvm#80904)"

This reverts commit b1ac052.

This commit breaks coroutine splitting for non-swift calling convention
functions. In this example:

```ll
; ModuleID = 'repro.ll'
source_filename = "stdlib/test/runtime/test_llcl.mojo"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@0 = internal constant { i32, i32 } { i32 trunc (i64 sub (i64 ptrtoint (ptr @craSH to i64), i64 ptrtoint (ptr getelementptr inbounds ({ i32, i32 }, ptr @0, i32 0, i32 1) to i64)) to i32), i32 64 }

define dso_local void @af_suspend_fn(ptr %0, i64 %1, ptr %2) #0 {
  ret void
}

define dso_local void @craSH(ptr %0) #0 {
  %2 = call token @llvm.coro.id.async(i32 64, i32 8, i32 0, ptr @0)
  %3 = call ptr @llvm.coro.begin(token %2, ptr null)
  %4 = getelementptr inbounds { ptr, { ptr, ptr }, i64, { ptr, i1 }, i64, i64 }, ptr poison, i32 0, i32 0
  %5 = call ptr @llvm.coro.async.resume()
  store ptr %5, ptr %4, align 8
  %6 = call { ptr, ptr, ptr } (i32, ptr, ptr, ...) @llvm.coro.suspend.async.sl_p0p0p0s(i32 0, ptr %5, ptr @ctxt_proj_fn, ptr @af_suspend_fn, ptr poison, i64 -1, ptr poison)
  ret void
}

define dso_local ptr @ctxt_proj_fn(ptr %0) #0 {
  ret ptr %0
}

; Function Attrs: nomerge nounwind
declare { ptr, ptr, ptr } @llvm.coro.suspend.async.sl_p0p0p0s(i32, ptr, ptr, ...) #1

; Function Attrs: nounwind
declare token @llvm.coro.id.async(i32, i32, i32, ptr) #2

; Function Attrs: nounwind
declare ptr @llvm.coro.begin(token, ptr writeonly) #2

; Function Attrs: nomerge nounwind
declare ptr @llvm.coro.async.resume() #1

attributes #0 = { "target-features"="+adx,+aes,+avx,+avx2,+bmi,+bmi2,+clflushopt,+clwb,+clzero,+crc32,+cx16,+cx8,+f16c,+fma,+fsgsbase,+fxsr,+invpcid,+lzcnt,+mmx,+movbe,+mwaitx,+pclmul,+pku,+popcnt,+prfchw,+rdpid,+rdpru,+rdrnd,+rdseed,+sahf,+sha,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+sse4a,+ssse3,+vaes,+vpclmulqdq,+wbnoinvd,+x87,+xsave,+xsavec,+xsaveopt,+xsaves" }
attributes #1 = { nomerge nounwind }
attributes #2 = { nounwind }
```

This verifier crashes after the `coro-split` pass with

```
cannot guarantee tail call due to mismatched parameter counts
  musttail call void @af_suspend_fn(ptr poison, i64 -1, ptr poison)
LLVM ERROR: Broken function
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: opt ../../../reduced.ll -O0
 #0 0x00007f1d89645c0e __interceptor_backtrace.part.0 /build/gcc-11-XeT9lY/gcc-11-11.4.0/build/x86_64-linux-gnu/libsanitizer/asan/../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4193:28
 #1 0x0000556d94d254f7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/ubuntu/modular/third-party/llvm-project/llvm/lib/Support/Unix/Signals.inc:723:22
 #2 0x0000556d94d19a2f llvm::sys::RunSignalHandlers() /home/ubuntu/modular/third-party/llvm-project/llvm/lib/Support/Signals.cpp:105:20
 #3 0x0000556d94d1aa42 SignalHandler(int) /home/ubuntu/modular/third-party/llvm-project/llvm/lib/Support/Unix/Signals.inc:371:36
 #4 0x00007f1d88e42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #5 0x00007f1d88e969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #6 0x00007f1d88e969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #7 0x00007f1d88e969fc pthread_kill ./nptl/pthread_kill.c:89:10
 #8 0x00007f1d88e42476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #9 0x00007f1d88e287f3 abort ./stdlib/abort.c:81:7
 #10 0x0000556d8944be01 std::vector<llvm::json::Value, std::allocator<llvm::json::Value>>::size() const /usr/include/c++/11/bits/stl_vector.h:919:40
 #11 0x0000556d8944be01 bool std::operator==<llvm::json::Value, std::allocator<llvm::json::Value>>(std::vector<llvm::json::Value, std::allocator<llvm::json::Value>> const&, std::vector<llvm::json::Value, std::allocator<llvm::json::Value>> const&) /usr/include/c++/11/bits/stl_vector.h:1893:23
 #12 0x0000556d8944be01 llvm::json::operator==(llvm::json::Array const&, llvm::json::Array const&) /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/Support/JSON.h:572:69
 #13 0x0000556d8944be01 llvm::json::operator==(llvm::json::Value const&, llvm::json::Value const&) (.cold) /home/ubuntu/modular/third-party/llvm-project/llvm/lib/Support/JSON.cpp:204:28
 #14 0x0000556d949ed2bd llvm::report_fatal_error(char const*, bool) /home/ubuntu/modular/third-party/llvm-project/llvm/lib/Support/ErrorHandling.cpp:82:70
 #15 0x0000556d8e37e876 llvm::SmallVectorBase<unsigned int>::size() const /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/ADT/SmallVector.h:91:32
 #16 0x0000556d8e37e876 llvm::SmallVectorTemplateCommon<llvm::DiagnosticInfoOptimizationBase::Argument, void>::end() /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/ADT/SmallVector.h:282:41
 #17 0x0000556d8e37e876 llvm::SmallVector<llvm::DiagnosticInfoOptimizationBase::Argument, 4u>::~SmallVector() /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/ADT/SmallVector.h:1215:24
 #18 0x0000556d8e37e876 llvm::DiagnosticInfoOptimizationBase::~DiagnosticInfoOptimizationBase() /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/IR/DiagnosticInfo.h:413:7
 #19 0x0000556d8e37e876 llvm::DiagnosticInfoIROptimization::~DiagnosticInfoIROptimization() /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/IR/DiagnosticInfo.h:622:7
 #20 0x0000556d8e37e876 llvm::OptimizationRemark::~OptimizationRemark() /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/IR/DiagnosticInfo.h:689:7
 #21 0x0000556d8e37e876 operator() /home/ubuntu/modular/third-party/llvm-project/llvm/lib/Transforms/Coroutines/CoroSplit.cpp:2213:14
 #22 0x0000556d8e37e876 emit<llvm::CoroSplitPass::run(llvm::LazyCallGraph::SCC&, llvm::CGSCCAnalysisManager&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&)::<lambda()> > /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h:83:12
 #23 0x0000556d8e37e876 llvm::CoroSplitPass::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) /home/ubuntu/modular/third-party/llvm-project/llvm/lib/Transforms/Coroutines/CoroSplit.cpp:2212:13
 #24 0x0000556d8c36ecb1 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::CoroSplitPass, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:3
 #25 0x0000556d91c1a84f llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) /home/ubuntu/modular/third-party/llvm-project/llvm/lib/Analysis/CGSCCPassManager.cpp:90:12
 #26 0x0000556d8c3690d1 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:3
 #27 0x0000556d91c2162d llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /home/ubuntu/modular/third-party/llvm-project/llvm/lib/Analysis/CGSCCPassManager.cpp:278:18
 llvm#28 0x0000556d8c369035 llvm::detail::PassModel<llvm::Module, llvm::ModuleToPostOrderCGSCCPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:3
 llvm#29 0x0000556d9457abc5 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/IR/PassManager.h:247:20
 llvm#30 0x0000556d8e30979e llvm::CoroConditionalWrapper::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /home/ubuntu/modular/third-party/llvm-project/llvm/lib/Transforms/Coroutines/CoroConditionalWrapper.cpp:19:74
 llvm#31 0x0000556d8c365755 llvm::detail::PassModel<llvm::Module, llvm::CoroConditionalWrapper, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:3
 llvm#32 0x0000556d9457abc5 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/IR/PassManager.h:247:20
 llvm#33 0x0000556d89818556 llvm::SmallPtrSetImplBase::isSmall() const /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h:196:33
 llvm#34 0x0000556d89818556 llvm::SmallPtrSetImplBase::~SmallPtrSetImplBase() /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h:84:17
 llvm#35 0x0000556d89818556 llvm::SmallPtrSetImpl<llvm::AnalysisKey*>::~SmallPtrSetImpl() /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h:321:7
 llvm#36 0x0000556d89818556 llvm::SmallPtrSet<llvm::AnalysisKey*, 2u>::~SmallPtrSet() /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h:427:7
 llvm#37 0x0000556d89818556 llvm::PreservedAnalyses::~PreservedAnalyses() /home/ubuntu/modular/third-party/llvm-project/llvm/include/llvm/IR/Analysis.h:109:7
 llvm#38 0x0000556d89818556 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool) /home/ubuntu/modular/third-party/llvm-project/llvm/tools/opt/NewPMDriver.cpp:532:10
 llvm#39 0x0000556d897e3939 optMain /home/ubuntu/modular/third-party/llvm-project/llvm/tools/opt/optdriver.cpp:737:27
 llvm#40 0x0000556d89455461 main /home/ubuntu/modular/third-party/llvm-project/llvm/tools/opt/opt.cpp:25:33
 llvm#41 0x00007f1d88e29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
 llvm#42 0x00007f1d88e29e40 call_init ./csu/../csu/libc-start.c:128:20
 llvm#43 0x00007f1d88e29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
 llvm#44 0x0000556d897b6335 _start (/home/ubuntu/modular/.derived/third-party/llvm-project/build-relwithdebinfo-asan/bin/opt+0x150c335)
Aborted (core dumped)
jdenny-ornl pushed a commit that referenced this issue Mar 9, 2024
TestCases/Misc/Linux/sigaction.cpp fails because dlsym() may call malloc
on failure. And then the wrapped malloc appears to access thread local
storage using global dynamic accesses, thus calling
___interceptor___tls_get_addr, before REAL(__tls_get_addr) has
been set, so we get a crash inside ___interceptor___tls_get_addr. For
example, this can happen when looking up __isoc23_scanf which might not
exist in some libcs.

Fix this by marking the thread local variable accessed inside the
debug checks as "initial-exec", which does not require __tls_get_addr.

This is probably a better alternative to llvm#83886.

This fixes a different crash but is related to llvm#46204.

Backtrace:
```
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff6a9d89e in ___interceptor___tls_get_addr (arg=0x7ffff6b27be8) at /path/to/llvm/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:2759
#2 0x00007ffff6a46bc6 in __sanitizer::CheckedMutex::LockImpl (this=0x7ffff6b27be8, pc=140737331846066) at /path/to/llvm/compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp:218
#3 0x00007ffff6a448b2 in __sanitizer::CheckedMutex::Lock (this=0x7ffff6b27be8, this@entry=0x730000000580) at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_mutex.h:129
#4 __sanitizer::Mutex::Lock (this=0x7ffff6b27be8, this@entry=0x730000000580) at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_mutex.h:167
#5 0x00007ffff6abdbb2 in __sanitizer::GenericScopedLock<__sanitizer::Mutex>::GenericScopedLock (mu=0x730000000580, this=<optimized out>) at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_mutex.h:383
#6 __sanitizer::SizeClassAllocator64<__tsan::AP64>::GetFromAllocator (this=0x7ffff7487dc0 <__tsan::allocator_placeholder>, stat=stat@entry=0x7ffff570db68, class_id=11, chunks=chunks@entry=0x7ffff5702cc8, n_chunks=n_chunks@entry=128) at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_allocator_primary64.h:207
#7 0x00007ffff6abdaa0 in __sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__tsan::AP64> >::Refill (this=<optimized out>, c=c@entry=0x7ffff5702cb8, allocator=<optimized out>, class_id=<optimized out>)
 at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_allocator_local_cache.h:103
#8 0x00007ffff6abd731 in __sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__tsan::AP64> >::Allocate (this=0x7ffff6b27be8, allocator=0x7ffff5702cc8, class_id=140737311157448)
 at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_allocator_local_cache.h:39
#9 0x00007ffff6abc397 in __sanitizer::CombinedAllocator<__sanitizer::SizeClassAllocator64<__tsan::AP64>, __sanitizer::LargeMmapAllocatorPtrArrayDynamic>::Allocate (this=0x7ffff5702cc8, cache=0x7ffff6b27be8, size=<optimized out>, size@entry=175, alignment=alignment@entry=16)
 at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_allocator_combined.h:69
#10 0x00007ffff6abaa6a in __tsan::user_alloc_internal (thr=0x7ffff7ebd980, pc=140737331499943, sz=sz@entry=175, align=align@entry=16, signal=true) at /path/to/llvm/compiler-rt/lib/tsan/rtl/tsan_mman.cpp:198
#11 0x00007ffff6abb0d1 in __tsan::user_alloc (thr=0x7ffff6b27be8, pc=140737331846066, sz=11, sz@entry=175) at /path/to/llvm/compiler-rt/lib/tsan/rtl/tsan_mman.cpp:223
#12 0x00007ffff6a693b5 in ___interceptor_malloc (size=175) at /path/to/llvm/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:666
#13 0x00007ffff7fce7f2 in malloc (size=175) at ../include/rtld-malloc.h:56
#14 __GI__dl_exception_create_format (exception=exception@entry=0x7fffffffd0d0, objname=0x7ffff7fc3550 "/path/to/llvm/compiler-rt/cmake-build-all-sanitizers/lib/linux/libclang_rt.tsan-x86_64.so",
 fmt=fmt@entry=0x7ffff7ff2db9 "undefined symbol: %s%s%s") at ./elf/dl-exception.c:157
#15 0x00007ffff7fd50e8 in _dl_lookup_symbol_x (undef_name=0x7ffff6af868b "__isoc23_scanf", undef_map=<optimized out>, ref=0x7fffffffd148, symbol_scope=<optimized out>, version=<optimized out>, type_class=0, flags=2, skip_map=0x7ffff7fc35e0) at ./elf/dl-lookup.c:793
--Type <RET> for more, q to quit, c to continue without paging--
#16 0x00007ffff656d6ed in do_sym (handle=<optimized out>, name=0x7ffff6af868b "__isoc23_scanf", who=0x7ffff6a3bb84 <__interception::InterceptFunction(char const*, unsigned long*, unsigned long, unsigned long)+36>, vers=vers@entry=0x0, flags=flags@entry=2) at ./elf/dl-sym.c:146
#17 0x00007ffff656d9dd in _dl_sym (handle=<optimized out>, name=<optimized out>, who=<optimized out>) at ./elf/dl-sym.c:195
#18 0x00007ffff64a2854 in dlsym_doit (a=a@entry=0x7fffffffd3b0) at ./dlfcn/dlsym.c:40
#19 0x00007ffff7fcc489 in __GI__dl_catch_exception (exception=exception@entry=0x7fffffffd310, operate=0x7ffff64a2840 <dlsym_doit>, args=0x7fffffffd3b0) at ./elf/dl-catch.c:237
#20 0x00007ffff7fcc5af in _dl_catch_error (objname=0x7fffffffd368, errstring=0x7fffffffd370, mallocedp=0x7fffffffd367, operate=<optimized out>, args=<optimized out>) at ./elf/dl-catch.c:256
#21 0x00007ffff64a2257 in _dlerror_run (operate=operate@entry=0x7ffff64a2840 <dlsym_doit>, args=args@entry=0x7fffffffd3b0) at ./dlfcn/dlerror.c:138
#22 0x00007ffff64a28e5 in dlsym_implementation (dl_caller=<optimized out>, name=<optimized out>, handle=<optimized out>) at ./dlfcn/dlsym.c:54
#23 ___dlsym (handle=<optimized out>, name=<optimized out>) at ./dlfcn/dlsym.c:68
#24 0x00007ffff6a3bb84 in __interception::GetFuncAddr (name=0x7ffff6af868b "__isoc23_scanf", trampoline=140737311157448) at /path/to/llvm/compiler-rt/lib/interception/interception_linux.cpp:42
#25 __interception::InterceptFunction (name=0x7ffff6af868b "__isoc23_scanf", ptr_to_real=0x7ffff74850e8 <__interception::real___isoc23_scanf>, func=11, trampoline=140737311157448)
 at /path/to/llvm/compiler-rt/lib/interception/interception_linux.cpp:61
#26 0x00007ffff6a9f2d9 in InitializeCommonInterceptors () at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_common_interceptors.inc:10315
```

Reviewed By: vitalybuka, MaskRay

Pull Request: llvm#83890
jdenny-ornl pushed a commit that referenced this issue Jul 4, 2024
…arallel fusion llvm#94391 (llvm#97607)"

This reverts commit edbc0e3.

Reason for rollback. ASAN complains about this PR:

==4320==ERROR: AddressSanitizer: heap-use-after-free on address 0x502000006cd8 at pc 0x55e2978d63cf bp 0x7ffe6431c2b0 sp 0x7ffe6431c2a8
READ of size 8 at 0x502000006cd8 thread T0
    #0 0x55e2978d63ce in map<llvm::MutableArrayRef<mlir::BlockArgument> &, llvm::MutableArrayRef<mlir::BlockArgument>, nullptr> mlir/include/mlir/IR/IRMapping.h:40:11
    #1 0x55e2978d63ce in mlir::createFused(mlir::LoopLikeOpInterface, mlir::LoopLikeOpInterface, mlir::RewriterBase&, std::__u::function<llvm::SmallVector<mlir::Value, 6u> (mlir::OpBuilder&, mlir::Location, llvm::ArrayRef<mlir::BlockArgument>)>, llvm::function_ref<void (mlir::RewriterBase&, mlir::LoopLikeOpInterface, mlir::LoopLikeOpInterface&, mlir::IRMapping)>) mlir/lib/Interfaces/LoopLikeInterface.cpp:156:11
    #2 0x55e2952a614b in mlir::fuseIndependentSiblingForLoops(mlir::scf::ForOp, mlir::scf::ForOp, mlir::RewriterBase&) mlir/lib/Dialect/SCF/Utils/Utils.cpp:1398:43
    #3 0x55e291480c6f in mlir::transform::LoopFuseSiblingOp::apply(mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp:482:17
    #4 0x55e29149ed5e in mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Model<mlir::transform::LoopFuseSiblingOp>::apply(mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h.inc:477:56
    #5 0x55e297494a60 in apply blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.cpp.inc:61:14
    #6 0x55e297494a60 in mlir::transform::TransformState::applyTransform(mlir::transform::TransformOpInterface) mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp:953:48
    #7 0x55e294646a8d in applySequenceBlock(mlir::Block&, mlir::transform::FailurePropagationMode, mlir::transform::TransformState&, mlir::transform::TransformResults&) mlir/lib/Dialect/Transform/IR/TransformOps.cpp:1788:15
    #8 0x55e29464f927 in mlir::transform::NamedSequenceOp::apply(mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) mlir/lib/Dialect/Transform/IR/TransformOps.cpp:2155:10
    #9 0x55e2945d28ee in mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Model<mlir::transform::NamedSequenceOp>::apply(mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h.inc:477:56
    #10 0x55e297494a60 in apply blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.cpp.inc:61:14
    #11 0x55e297494a60 in mlir::transform::TransformState::applyTransform(mlir::transform::TransformOpInterface) mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp:953:48
    #12 0x55e2974a5fe2 in mlir::transform::applyTransforms(mlir::Operation*, mlir::transform::TransformOpInterface, mlir::RaggedArray<llvm::PointerUnion<mlir::Operation*, mlir::Attribute, mlir::Value>> const&, mlir::transform::TransformOptions const&, bool) mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp:2016:16
    #13 0x55e2945888d7 in mlir::transform::applyTransformNamedSequence(mlir::RaggedArray<llvm::PointerUnion<mlir::Operation*, mlir::Attribute, mlir::Value>>, mlir::transform::TransformOpInterface, mlir::ModuleOp, mlir::transform::TransformOptions const&) mlir/lib/Dialect/Transform/Transforms/TransformInterpreterUtils.cpp:234:10
    #14 0x55e294582446 in (anonymous namespace)::InterpreterPass::runOnOperation() mlir/lib/Dialect/Transform/Transforms/InterpreterPass.cpp:147:16
    #15 0x55e2978e93c6 in operator() mlir/lib/Pass/Pass.cpp:527:17
    #16 0x55e2978e93c6 in void llvm::function_ref<void ()>::callback_fn<mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1>(long) llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    #17 0x55e2978e207a in operator() llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    #18 0x55e2978e207a in executeAction<mlir::PassExecutionAction, mlir::Pass &> mlir/include/mlir/IR/MLIRContext.h:275:7
    #19 0x55e2978e207a in mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) mlir/lib/Pass/Pass.cpp:521:21
    #20 0x55e2978e5fbf in runPipeline mlir/lib/Pass/Pass.cpp:593:16
    #21 0x55e2978e5fbf in mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) mlir/lib/Pass/Pass.cpp:904:10
    #22 0x55e2978e5b65 in mlir::PassManager::run(mlir::Operation*) mlir/lib/Pass/Pass.cpp:884:60
    #23 0x55e291ebb460 in performActions(llvm::raw_ostream&, std::__u::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:408:17
    #24 0x55e291ebabd9 in processBuffer mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:481:9
    #25 0x55e291ebabd9 in operator() mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:548:12
    #26 0x55e291ebabd9 in llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    #27 0x55e297b1cffe in operator() llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    llvm#28 0x55e297b1cffe in mlir::splitAndProcessBuffer(std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef)::$_0::operator()(llvm::StringRef) const mlir/lib/Support/ToolUtilities.cpp:86:16
    llvm#29 0x55e297b1c9c5 in interleave<const llvm::StringRef *, (lambda at mlir/lib/Support/ToolUtilities.cpp:79:23), (lambda at llvm/include/llvm/ADT/STLExtras.h:2147:49), void> llvm/include/llvm/ADT/STLExtras.h:2125:3
    llvm#30 0x55e297b1c9c5 in interleave<llvm::SmallVector<llvm::StringRef, 8U>, (lambda at mlir/lib/Support/ToolUtilities.cpp:79:23), llvm::raw_ostream, llvm::StringRef> llvm/include/llvm/ADT/STLExtras.h:2147:3
    llvm#31 0x55e297b1c9c5 in mlir::splitAndProcessBuffer(std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) mlir/lib/Support/ToolUtilities.cpp:89:3
    llvm#32 0x55e291eb0cf0 in mlir::MlirOptMain(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:551:10
    llvm#33 0x55e291eb115c in mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:589:14
    llvm#34 0x55e291eb15f8 in mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:605:10
    llvm#35 0x55e29130d1be in main mlir/tools/mlir-opt/mlir-opt.cpp:311:33
    llvm#36 0x7fbcf3fff3d3 in __libc_start_main (/usr/grte/v5/lib64/libc.so.6+0x613d3) (BuildId: 9a996398ce14a94560b0c642eb4f6e94)
    llvm#37 0x55e2912365a9 in _start /usr/grte/v5/debug-src/src/csu/../sysdeps/x86_64/start.S:120

0x502000006cd8 is located 8 bytes inside of 16-byte region [0x502000006cd0,0x502000006ce0)
freed by thread T0 here:
    #0 0x55e29130b7e2 in operator delete(void*, unsigned long) compiler-rt/lib/asan/asan_new_delete.cpp:155:3
    #1 0x55e2979eb657 in __libcpp_operator_delete<void *, unsigned long>
    #2 0x55e2979eb657 in __do_deallocate_handle_size<>
    #3 0x55e2979eb657 in __libcpp_deallocate
    #4 0x55e2979eb657 in deallocate
    #5 0x55e2979eb657 in deallocate
    #6 0x55e2979eb657 in operator()
    #7 0x55e2979eb657 in ~vector
    #8 0x55e2979eb657 in mlir::Block::~Block() mlir/lib/IR/Block.cpp:24:1
    #9 0x55e2979ebc17 in deleteNode llvm/include/llvm/ADT/ilist.h:42:39
    #10 0x55e2979ebc17 in erase llvm/include/llvm/ADT/ilist.h:205:5
    #11 0x55e2979ebc17 in erase llvm/include/llvm/ADT/ilist.h:209:39
    #12 0x55e2979ebc17 in mlir::Block::erase() mlir/lib/IR/Block.cpp:67:28
    #13 0x55e297aef978 in mlir::RewriterBase::eraseBlock(mlir::Block*) mlir/lib/IR/PatternMatch.cpp:245:10
    #14 0x55e297af0563 in mlir::RewriterBase::inlineBlockBefore(mlir::Block*, mlir::Block*, llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, false, false, void, false, void>, false, false>, mlir::ValueRange) mlir/lib/IR/PatternMatch.cpp:331:3
    #15 0x55e297af06d8 in mlir::RewriterBase::mergeBlocks(mlir::Block*, mlir::Block*, mlir::ValueRange) mlir/lib/IR/PatternMatch.cpp:341:3
    #16 0x55e297036608 in mlir::scf::ForOp::replaceWithAdditionalYields(mlir::RewriterBase&, mlir::ValueRange, bool, std::__u::function<llvm::SmallVector<mlir::Value, 6u> (mlir::OpBuilder&, mlir::Location, llvm::ArrayRef<mlir::BlockArgument>)> const&) mlir/lib/Dialect/SCF/IR/SCF.cpp:575:12
    #17 0x55e2970673ca in mlir::detail::LoopLikeOpInterfaceInterfaceTraits::Model<mlir::scf::ForOp>::replaceWithAdditionalYields(mlir::detail::LoopLikeOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::RewriterBase&, mlir::ValueRange, bool, std::__u::function<llvm::SmallVector<mlir::Value, 6u> (mlir::OpBuilder&, mlir::Location, llvm::ArrayRef<mlir::BlockArgument>)> const&) blaze-out/k8-opt-asan/bin/mlir/include/mlir/Interfaces/LoopLikeInterface.h.inc:658:56
    #18 0x55e2978d5feb in replaceWithAdditionalYields blaze-out/k8-opt-asan/bin/mlir/include/mlir/Interfaces/LoopLikeInterface.cpp.inc:105:14
    #19 0x55e2978d5feb in mlir::createFused(mlir::LoopLikeOpInterface, mlir::LoopLikeOpInterface, mlir::RewriterBase&, std::__u::function<llvm::SmallVector<mlir::Value, 6u> (mlir::OpBuilder&, mlir::Location, llvm::ArrayRef<mlir::BlockArgument>)>, llvm::function_ref<void (mlir::RewriterBase&, mlir::LoopLikeOpInterface, mlir::LoopLikeOpInterface&, mlir::IRMapping)>) mlir/lib/Interfaces/LoopLikeInterface.cpp:135:14
    #20 0x55e2952a614b in mlir::fuseIndependentSiblingForLoops(mlir::scf::ForOp, mlir::scf::ForOp, mlir::RewriterBase&) mlir/lib/Dialect/SCF/Utils/Utils.cpp:1398:43
    #21 0x55e291480c6f in mlir::transform::LoopFuseSiblingOp::apply(mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp:482:17
    #22 0x55e29149ed5e in mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Model<mlir::transform::LoopFuseSiblingOp>::apply(mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h.inc:477:56
    #23 0x55e297494a60 in apply blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.cpp.inc:61:14
    #24 0x55e297494a60 in mlir::transform::TransformState::applyTransform(mlir::transform::TransformOpInterface) mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp:953:48
    #25 0x55e294646a8d in applySequenceBlock(mlir::Block&, mlir::transform::FailurePropagationMode, mlir::transform::TransformState&, mlir::transform::TransformResults&) mlir/lib/Dialect/Transform/IR/TransformOps.cpp:1788:15
    #26 0x55e29464f927 in mlir::transform::NamedSequenceOp::apply(mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) mlir/lib/Dialect/Transform/IR/TransformOps.cpp:2155:10
    #27 0x55e2945d28ee in mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Model<mlir::transform::NamedSequenceOp>::apply(mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h.inc:477:56
    llvm#28 0x55e297494a60 in apply blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.cpp.inc:61:14
    llvm#29 0x55e297494a60 in mlir::transform::TransformState::applyTransform(mlir::transform::TransformOpInterface) mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp:953:48
    llvm#30 0x55e2974a5fe2 in mlir::transform::applyTransforms(mlir::Operation*, mlir::transform::TransformOpInterface, mlir::RaggedArray<llvm::PointerUnion<mlir::Operation*, mlir::Attribute, mlir::Value>> const&, mlir::transform::TransformOptions const&, bool) mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp:2016:16
    llvm#31 0x55e2945888d7 in mlir::transform::applyTransformNamedSequence(mlir::RaggedArray<llvm::PointerUnion<mlir::Operation*, mlir::Attribute, mlir::Value>>, mlir::transform::TransformOpInterface, mlir::ModuleOp, mlir::transform::TransformOptions const&) mlir/lib/Dialect/Transform/Transforms/TransformInterpreterUtils.cpp:234:10
    llvm#32 0x55e294582446 in (anonymous namespace)::InterpreterPass::runOnOperation() mlir/lib/Dialect/Transform/Transforms/InterpreterPass.cpp:147:16
    llvm#33 0x55e2978e93c6 in operator() mlir/lib/Pass/Pass.cpp:527:17
    llvm#34 0x55e2978e93c6 in void llvm::function_ref<void ()>::callback_fn<mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1>(long) llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    llvm#35 0x55e2978e207a in operator() llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    llvm#36 0x55e2978e207a in executeAction<mlir::PassExecutionAction, mlir::Pass &> mlir/include/mlir/IR/MLIRContext.h:275:7
    llvm#37 0x55e2978e207a in mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) mlir/lib/Pass/Pass.cpp:521:21
    llvm#38 0x55e2978e5fbf in runPipeline mlir/lib/Pass/Pass.cpp:593:16
    llvm#39 0x55e2978e5fbf in mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) mlir/lib/Pass/Pass.cpp:904:10
    llvm#40 0x55e2978e5b65 in mlir::PassManager::run(mlir::Operation*) mlir/lib/Pass/Pass.cpp:884:60
    llvm#41 0x55e291ebb460 in performActions(llvm::raw_ostream&, std::__u::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:408:17
    llvm#42 0x55e291ebabd9 in processBuffer mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:481:9
    llvm#43 0x55e291ebabd9 in operator() mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:548:12
    llvm#44 0x55e291ebabd9 in llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    llvm#45 0x55e297b1cffe in operator() llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    llvm#46 0x55e297b1cffe in mlir::splitAndProcessBuffer(std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef)::$_0::operator()(llvm::StringRef) const mlir/lib/Support/ToolUtilities.cpp:86:16
    llvm#47 0x55e297b1c9c5 in interleave<const llvm::StringRef *, (lambda at mlir/lib/Support/ToolUtilities.cpp:79:23), (lambda at llvm/include/llvm/ADT/STLExtras.h:2147:49), void> llvm/include/llvm/ADT/STLExtras.h:2125:3
    llvm#48 0x55e297b1c9c5 in interleave<llvm::SmallVector<llvm::StringRef, 8U>, (lambda at mlir/lib/Support/ToolUtilities.cpp:79:23), llvm::raw_ostream, llvm::StringRef> llvm/include/llvm/ADT/STLExtras.h:2147:3
    llvm#49 0x55e297b1c9c5 in mlir::splitAndProcessBuffer(std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) mlir/lib/Support/ToolUtilities.cpp:89:3
    llvm#50 0x55e291eb0cf0 in mlir::MlirOptMain(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:551:10
    llvm#51 0x55e291eb115c in mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:589:14

previously allocated by thread T0 here:
    #0 0x55e29130ab5d in operator new(unsigned long) compiler-rt/lib/asan/asan_new_delete.cpp:86:3
    #1 0x55e2979ed5d4 in __libcpp_operator_new<unsigned long>
    #2 0x55e2979ed5d4 in __libcpp_allocate
    #3 0x55e2979ed5d4 in allocate
    #4 0x55e2979ed5d4 in __allocate_at_least<std::__u::allocator<mlir::BlockArgument> >
    #5 0x55e2979ed5d4 in __split_buffer
    #6 0x55e2979ed5d4 in mlir::BlockArgument* std::__u::vector<mlir::BlockArgument, std::__u::allocator<mlir::BlockArgument>>::__push_back_slow_path<mlir::BlockArgument const&>(mlir::BlockArgument const&)
    #7 0x55e2979ec0f2 in push_back
    #8 0x55e2979ec0f2 in mlir::Block::addArgument(mlir::Type, mlir::Location) mlir/lib/IR/Block.cpp:154:13
    #9 0x55e29796e457 in parseRegionBody mlir/lib/AsmParser/Parser.cpp:2172:34
    #10 0x55e29796e457 in (anonymous namespace)::OperationParser::parseRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) mlir/lib/AsmParser/Parser.cpp:2121:7
    #11 0x55e29796b25e in (anonymous namespace)::CustomOpAsmParser::parseRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) mlir/lib/AsmParser/Parser.cpp:1785:16
    #12 0x55e297035742 in mlir::scf::ForOp::parse(mlir::OpAsmParser&, mlir::OperationState&) mlir/lib/Dialect/SCF/IR/SCF.cpp:521:14
    #13 0x55e291322c18 in llvm::ParseResult llvm::detail::UniqueFunctionBase<llvm::ParseResult, mlir::OpAsmParser&, mlir::OperationState&>::CallImpl<llvm::ParseResult (*)(mlir::OpAsmParser&, mlir::OperationState&)>(void*, mlir::OpAsmParser&, mlir::OperationState&) llvm/include/llvm/ADT/FunctionExtras.h:220:12
    #14 0x55e29795bea3 in operator() llvm/include/llvm/ADT/FunctionExtras.h:384:12
    #15 0x55e29795bea3 in callback_fn<llvm::unique_function<llvm::ParseResult (mlir::OpAsmParser &, mlir::OperationState &)> > llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    #16 0x55e29795bea3 in operator() llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    #17 0x55e29795bea3 in parseOperation mlir/lib/AsmParser/Parser.cpp:1521:9
    #18 0x55e29795bea3 in parseCustomOperation mlir/lib/AsmParser/Parser.cpp:2017:19
    #19 0x55e29795bea3 in (anonymous namespace)::OperationParser::parseOperation() mlir/lib/AsmParser/Parser.cpp:1174:10
    #20 0x55e297971d20 in parseBlockBody mlir/lib/AsmParser/Parser.cpp:2296:9
    #21 0x55e297971d20 in (anonymous namespace)::OperationParser::parseBlock(mlir::Block*&) mlir/lib/AsmParser/Parser.cpp:2226:12
    #22 0x55e29796e4f5 in parseRegionBody mlir/lib/AsmParser/Parser.cpp:2184:7
    #23 0x55e29796e4f5 in (anonymous namespace)::OperationParser::parseRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) mlir/lib/AsmParser/Parser.cpp:2121:7
    #24 0x55e29796b25e in (anonymous namespace)::CustomOpAsmParser::parseRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) mlir/lib/AsmParser/Parser.cpp:1785:16
    #25 0x55e29796b2cf in (anonymous namespace)::CustomOpAsmParser::parseOptionalRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) mlir/lib/AsmParser/Parser.cpp:1796:12
    #26 0x55e2978d89ff in mlir::function_interface_impl::parseFunctionOp(mlir::OpAsmParser&, mlir::OperationState&, bool, mlir::StringAttr, llvm::function_ref<mlir::Type (mlir::Builder&, llvm::ArrayRef<mlir::Type>, llvm::ArrayRef<mlir::Type>, mlir::function_interface_impl::VariadicFlag, std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>&)>, mlir::StringAttr, mlir::StringAttr) mlir/lib/Interfaces/FunctionImplementation.cpp:232:14
    #27 0x55e2969ba41d in mlir::func::FuncOp::parse(mlir::OpAsmParser&, mlir::OperationState&) mlir/lib/Dialect/Func/IR/FuncOps.cpp:203:10
    llvm#28 0x55e291322c18 in llvm::ParseResult llvm::detail::UniqueFunctionBase<llvm::ParseResult, mlir::OpAsmParser&, mlir::OperationState&>::CallImpl<llvm::ParseResult (*)(mlir::OpAsmParser&, mlir::OperationState&)>(void*, mlir::OpAsmParser&, mlir::OperationState&) llvm/include/llvm/ADT/FunctionExtras.h:220:12
    llvm#29 0x55e29795bea3 in operator() llvm/include/llvm/ADT/FunctionExtras.h:384:12
    llvm#30 0x55e29795bea3 in callback_fn<llvm::unique_function<llvm::ParseResult (mlir::OpAsmParser &, mlir::OperationState &)> > llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    llvm#31 0x55e29795bea3 in operator() llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    llvm#32 0x55e29795bea3 in parseOperation mlir/lib/AsmParser/Parser.cpp:1521:9
    llvm#33 0x55e29795bea3 in parseCustomOperation mlir/lib/AsmParser/Parser.cpp:2017:19
    llvm#34 0x55e29795bea3 in (anonymous namespace)::OperationParser::parseOperation() mlir/lib/AsmParser/Parser.cpp:1174:10
    llvm#35 0x55e297959b78 in parse mlir/lib/AsmParser/Parser.cpp:2725:20
    llvm#36 0x55e297959b78 in mlir::parseAsmSourceFile(llvm::SourceMgr const&, mlir::Block*, mlir::ParserConfig const&, mlir::AsmParserState*, mlir::AsmParserCodeCompleteContext*) mlir/lib/AsmParser/Parser.cpp:2785:41
    llvm#37 0x55e29790d5c2 in mlir::parseSourceFile(std::__u::shared_ptr<llvm::SourceMgr> const&, mlir::Block*, mlir::ParserConfig const&, mlir::LocationAttr*) mlir/lib/Parser/Parser.cpp:46:10
    llvm#38 0x55e291ebbfe2 in parseSourceFile<mlir::ModuleOp, const std::__u::shared_ptr<llvm::SourceMgr> &> mlir/include/mlir/Parser/Parser.h:159:14
    llvm#39 0x55e291ebbfe2 in parseSourceFile<mlir::ModuleOp> mlir/include/mlir/Parser/Parser.h:189:10
    llvm#40 0x55e291ebbfe2 in mlir::parseSourceFileForTool(std::__u::shared_ptr<llvm::SourceMgr> const&, mlir::ParserConfig const&, bool) mlir/include/mlir/Tools/ParseUtilities.h:31:12
    llvm#41 0x55e291ebb263 in performActions(llvm::raw_ostream&, std::__u::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:383:33
    llvm#42 0x55e291ebabd9 in processBuffer mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:481:9
    llvm#43 0x55e291ebabd9 in operator() mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:548:12
    llvm#44 0x55e291ebabd9 in llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    llvm#45 0x55e297b1cffe in operator() llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    llvm#46 0x55e297b1cffe in mlir::splitAndProcessBuffer(std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef)::$_0::operator()(llvm::StringRef) const mlir/lib/Support/ToolUtilities.cpp:86:16
    llvm#47 0x55e297b1c9c5 in interleave<const llvm::StringRef *, (lambda at mlir/lib/Support/ToolUtilities.cpp:79:23), (lambda at llvm/include/llvm/ADT/STLExtras.h:2147:49), void> llvm/include/llvm/ADT/STLExtras.h:2125:3
    llvm#48 0x55e297b1c9c5 in interleave<llvm::SmallVector<llvm::StringRef, 8U>, (lambda at mlir/lib/Support/ToolUtilities.cpp:79:23), llvm::raw_ostream, llvm::StringRef> llvm/include/llvm/ADT/STLExtras.h:2147:3
    llvm#49 0x55e297b1c9c5 in mlir::splitAndProcessBuffer(std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) mlir/lib/Support/ToolUtilities.cpp:89:3
    llvm#50 0x55e291eb0cf0 in mlir::MlirOptMain(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:551:10
    llvm#51 0x55e291eb115c in mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:589:14
    llvm#52 0x55e291eb15f8 in mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:605:10
    llvm#53 0x55e29130d1be in main mlir/tools/mlir-opt/mlir-opt.cpp:311:33
    llvm#54 0x7fbcf3fff3d3 in __libc_start_main (/usr/grte/v5/lib64/libc.so.6+0x613d3) (BuildId: 9a996398ce14a94560b0c642eb4f6e94)
    llvm#55 0x55e2912365a9 in _start /usr/grte/v5/debug-src/src/csu/../sysdeps/x86_64/start.S:120

SUMMARY: AddressSanitizer: heap-use-after-free mlir/include/mlir/IR/IRMapping.h:40:11 in map<llvm::MutableArrayRef<mlir::BlockArgument> &, llvm::MutableArrayRef<mlir::BlockArgument>, nullptr>
Shadow bytes around the buggy address:
  0x502000006a00: fa fa 00 fa fa fa 00 00 fa fa 00 fa fa fa 00 fa
  0x502000006a80: fa fa 00 fa fa fa 00 00 fa fa 00 00 fa fa 00 00
  0x502000006b00: fa fa 00 00 fa fa 00 00 fa fa 00 fa fa fa 00 fa
  0x502000006b80: fa fa 00 fa fa fa 00 fa fa fa 00 00 fa fa 00 00
  0x502000006c00: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa fd fa
=>0x502000006c80: fa fa fd fa fa fa fd fd fa fa fd[fd]fa fa fd fd
  0x502000006d00: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
  0x502000006d80: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
  0x502000006e00: fa fa 00 fa fa fa 00 fa fa fa 00 00 fa fa 00 fa
  0x502000006e80: fa fa 00 fa fa fa 00 00 fa fa 00 fa fa fa 00 fa
  0x502000006f00: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==4320==ABORTING
jdenny-ornl pushed a commit that referenced this issue Nov 11, 2024
… depobj construct (llvm#114221)

A codegen crash is occurring when a depend object was initialized with
omp_all_memory in the depobj directive.
llvm#114214
The root cause of issue looks to be the improper handling of the
dependency list when omp_all_memory was specified.

The change introduces the use of OMPTaskDataTy to manage dependencies.
The buildDependences function is called to construct the dependency
list, and the list is iterated over to emit and store the dependencies.

Reduced Test Case : 
```
#include <omp.h>

int main()

{ omp_depend_t obj; #pragma omp depobj(obj) depend(inout: omp_all_memory) }
```

```
 #1 0x0000000003de6623 SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f8e4a6b990f (/lib64/libpthread.so.0+0x1690f)
 #3 0x00007f8e4a117d2a raise (/lib64/libc.so.6+0x4ad2a)
 #4 0x00007f8e4a1193e4 abort (/lib64/libc.so.6+0x4c3e4)
 #5 0x00007f8e4a10fc69 __assert_fail_base (/lib64/libc.so.6+0x42c69)
 #6 0x00007f8e4a10fcf1 __assert_fail (/lib64/libc.so.6+0x42cf1)
 #7 0x0000000004114367 clang::CodeGen::CodeGenFunction::EmitOMPDepobjDirective(clang::OMPDepobjDirective const&) (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0x4114367)
 #8 0x00000000040f8fac clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0x40f8fac)
 #9 0x00000000040ff4fb clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0x40ff4fb)
#10 0x00000000041847b2 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0x41847b2)
#11 0x0000000004199e4a clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0x4199e4a)
#12 0x00000000041f7b9d clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0x41f7b9d)
#13 0x00000000041f16a3 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0x41f16a3)
#14 0x00000000041fd954 clang::CodeGen::CodeGenModule::EmitDeferred() (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0x41fd954)
#15 0x0000000004200277 clang::CodeGen::CodeGenModule::Release() (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0x4200277)
#16 0x00000000046b6a49 (anonymous namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&) ModuleBuilder.cpp:0:0
#17 0x00000000046b4cb6 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0x46b4cb6)
#18 0x0000000006204d5c clang::ParseAST(clang::Sema&, bool, bool) (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0x6204d5c)
#19 0x000000000496b278 clang::FrontendAction::Execute() (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0x496b278)
#20 0x00000000048dd074 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0x48dd074)
#21 0x0000000004a38092 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0x4a38092)
#22 0x0000000000fd4e9c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0xfd4e9c)
#23 0x0000000000fcca73 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#24 0x0000000000fd140c clang_main(int, char**, llvm::ToolContext const&) (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0xfd140c)
#25 0x0000000000ee2ef3 main (/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18+0xee2ef3)
#26 0x00007f8e4a10224c __libc_start_main (/lib64/libc.so.6+0x3524c)
#27 0x0000000000fcaae9 _start /home/abuild/rpmbuild/BUILD/glibc-2.31/csu/../sysdeps/x86_64/start.S:120:0
clang: error: unable to execute command: Aborted
```

---------

Co-authored-by: Chandra Ghale <[email protected]>
jdenny-ornl pushed a commit that referenced this issue Nov 19, 2024
…onger cause a crash (llvm#116569)

This PR fixes a bug introduced by llvm#110199, which causes any half float
argument to crash the compiler on MIPS64.

Currently compiling this bit of code with `llc -mtriple=mips64`: 
```
define void @half_args(half %a) nounwind {
entry:
        ret void
}
```

Crashes with the following log:
```
LLVM ERROR: unable to allocate function argument #0
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: llc -mtriple=mips64
1.	Running pass 'Function Pass Manager' on module '<stdin>'.
2.	Running pass 'MIPS DAG->DAG Pattern Instruction Selection' on function '@half_args'
 #0 0x000055a3a4013df8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/davide/Ps2/rps2-tools/prefix/bin/llc+0x32d0df8)
 #1 0x000055a3a401199e llvm::sys::RunSignalHandlers() (/home/davide/Ps2/rps2-tools/prefix/bin/llc+0x32ce99e)
 #2 0x000055a3a40144a8 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f00bde558c0 __restore_rt libc_sigaction.c:0:0
 #4 0x00007f00bdea462c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007f00bde55822 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #6 0x00007f00bde3e4af abort ./stdlib/abort.c:81:7
 #7 0x000055a3a3f80e3c llvm::report_fatal_error(llvm::Twine const&, bool) (/home/davide/Ps2/rps2-tools/prefix/bin/llc+0x323de3c)
 #8 0x000055a3a2e20dfa (/home/davide/Ps2/rps2-tools/prefix/bin/llc+0x20dddfa)
 #9 0x000055a3a2a34e20 llvm::MipsTargetLowering::LowerFormalArguments(llvm::SDValue, unsigned int, bool, llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, llvm::SDLoc const&, llvm::SelectionDAG&, llvm::SmallVectorImpl<llvm::SDValue>&) const MipsISelLowering.cpp:0:0
#10 0x000055a3a3d896a9 llvm::SelectionDAGISel::LowerArguments(llvm::Function const&) (/home/davide/Ps2/rps2-tools/prefix/bin/llc+0x30466a9)
#11 0x000055a3a3e0b3ec llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/home/davide/Ps2/rps2-tools/prefix/bin/llc+0x30c83ec)
#12 0x000055a3a3e09e21 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/home/davide/Ps2/rps2-tools/prefix/bin/llc+0x30c6e21)
#13 0x000055a3a2aae1ca llvm::MipsDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) MipsISelDAGToDAG.cpp:0:0
#14 0x000055a3a3e07706 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/home/davide/Ps2/rps2-tools/prefix/bin/llc+0x30c4706)
#15 0x000055a3a3051ed6 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/home/davide/Ps2/rps2-tools/prefix/bin/llc+0x230eed6)
#16 0x000055a3a35a3ec9 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/davide/Ps2/rps2-tools/prefix/bin/llc+0x2860ec9)
#17 0x000055a3a35ac3b2 llvm::FPPassManager::runOnModule(llvm::Module&) (/home/davide/Ps2/rps2-tools/prefix/bin/llc+0x28693b2)
#18 0x000055a3a35a499c llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/davide/Ps2/rps2-tools/prefix/bin/llc+0x286199c)
#19 0x000055a3a262abbb main (/home/davide/Ps2/rps2-tools/prefix/bin/llc+0x18e7bbb)
#20 0x00007f00bde3fc4c __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#21 0x00007f00bde3fd05 call_init ./csu/../csu/libc-start.c:128:20
#22 0x00007f00bde3fd05 __libc_start_main@GLIBC_2.2.5 ./csu/../csu/libc-start.c:347:5
#23 0x000055a3a2624921 _start /builddir/glibc-2.39/csu/../sysdeps/x86_64/start.S:117:0
```

This is caused by the fact that after the change, `f16`s are no longer
lowered as `f32`s in calls.

Two possible fixes are available:
- Update calling conventions to properly support passing `f16` as
integers.
- Update `useFPRegsForHalfType()` to return `true` so that `f16` are
still kept in `f32` registers, as before llvm#110199.

This PR implements the first solution to not introduce any more ABI
changes as llvm#110199 already did.

As of what is the correct ABI for halfs, I don't think there is a
correct answer. GCC doesn't support halfs on MIPS, and I couldn't find
any information on old MIPS ABI manuals either.
jdenny-ornl pushed a commit that referenced this issue Dec 20, 2024
…ns (llvm#120564)

This patch makes sure that `BinaryContext::printInstruction` prints the
preferred disassembly. Preferred disassembly only gets printed when
there are no annotations on the MCInst. Therefore, this patch
temporarily removes the annotations before printing it.

A few examples of before and after on AArch64 instructions are as
follows:

```
  BEFORE                     AFTER
                             (preferred disassembly)

  ret   x30                  ret
  orr   x30, xzr, x0         mov   x30, x0
  hint  llvm#29                  autiasp
  hint  #12                  autia1716
```

Clearly, the preferred disassembly is easier for developers to read, and
is the disassembly that tools should be printing.

This patch is motivated as part of future work on the
llvm-bolt-binary-analysis tool, making sure that the reports it prints
do use preferred disassembly.

This patch was cherry-picked from
https://github.com/kbeyls/llvm-project/tree/bolt-gadget-scanner-prototype.

In this current patch, this only affects existing RISCV test cases.

This patch also does improve test cases in future patches that will
introduce a binary analysis for llvm-bolt-binary-analysis that checks
for correct application of pac-ret (pointer authentication on return
addresses).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clacc Related to the Clacc project (OpenACC support for C/C++) runtime Related to a runtime (e.g., LLVM's openmp subproject) upstreamable Identifies work that is ready to be considered for LLVM upstream
Projects
None yet
Development

No branches or pull requests

1 participant