This is an archive of the discontinued LLVM Phabricator instance.

[IR] Increase max alignment to 4GB
ClosedPublic

Authored by aeubanks on Sep 24 2021, 3:54 PM.

Details

Summary

Currently the max alignment representable is 1GB, see D108661.
Setting the align of an object to 4GB is desirable in some cases to make sure the lower 32 bits are clear which can be used for some optimizations, e.g. https://crbug.com/1016945.

This uses an extra bit in instructions that carry an alignment. We can store 15 bits of "free" information, and with this change some instructions (e.g. AtomicCmpXchgInst) use 14 bits.
We can increase the max alignment representable above 4GB (up to 2^62) since we're only using 33 of the 64 values, but I've just limited it to 4GB for now.

The one place we have to update the bitcode format is for the alloca instruction. It stores its alignment into 5 bits of a 32 bit bitfield. I've added another field which is 8 bits and should be future proof for a while. For backward compatibility, we check if the old field has a value and use that, otherwise use the new field.

Updating clang's max allowed alignment will come in a future patch.

Diff Detail

Event Timeline

aeubanks created this revision.Sep 24 2021, 3:54 PM
aeubanks retitled this revision from [IR] Increase max alignment to 4GiB to [IR] Increase max alignment to 4GB.Sep 29 2021, 5:06 PM
aeubanks edited the summary of this revision. (Show Details)
aeubanks published this revision for review.Sep 30 2021, 11:06 AM

I'll update tests/clang if this is ok with people
I can also split out the uint64_t changes

Herald added a reviewer: sstefan1. · View Herald Transcript
Herald added a reviewer: baziotis. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
This comment was removed by craig.topper.
craig.topper added inline comments.Sep 30 2021, 11:24 AM
llvm/include/llvm/IR/Value.h
788–789

MaxAlignmentExponent doesn't need to be uint64_t.

llvm/lib/Transforms/Utils/Local.cpp
1352 ↗(On Diff #374977)

This change doesn't seem necessary. KnownBits can't support a bit width of more than 2^32 - 1 bits.

1360 ↗(On Diff #374977)

The shift amount here shouldn't need to be 64 bits.

aeubanks updated this revision to Diff 376376.Sep 30 2021, 2:44 PM

remove unnecessary uint64_t changes

hans added a comment.Oct 1 2021, 6:24 AM

This looks good to me. The only downside I could see is if we'd be growing sizeof(Instruction), but it sounds like that's not happening.

I'm fine with this but I assume (Attributor) tests need to be regenerated as part of it.

aeubanks updated this revision to Diff 376584.Oct 1 2021, 11:33 AM

update tests
update alloca's bitcode representation
fix some uint32 parsing

aeubanks edited the summary of this revision. (Show Details)Oct 1 2021, 11:33 AM
aeubanks edited the summary of this revision. (Show Details)
aeubanks updated this revision to Diff 376586.Oct 1 2021, 11:34 AM

add comment to LegacyAlign

hans accepted this revision.Oct 4 2021, 2:56 AM
This revision is now accepted and ready to land.Oct 4 2021, 2:56 AM
aeubanks updated this revision to Diff 377300.Oct 5 2021, 10:58 AM

keep using the existing 5 bits for alloca bitcode alignment, just add 3 extra bits to use as upper bits

aeubanks updated this revision to Diff 377335.Oct 5 2021, 1:14 PM

update some clang uses to fix errors/warnings

Herald added a project: Restricted Project. · View Herald TranscriptOct 5 2021, 1:14 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision was landed with ongoing or failed builds.Oct 6 2021, 9:58 AM
This revision was automatically updated to reflect the committed changes.
aeubanks reopened this revision.Oct 6 2021, 12:04 PM
This revision is now accepted and ready to land.Oct 6 2021, 12:04 PM
aeubanks updated this revision to Diff 377631.Oct 6 2021, 12:04 PM

more types changed throughout the codebase

MaskRay added inline comments.
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
179

You may switch to namespace scope/global constexpr while touching the lines. They are automatically internal linkage.

aeubanks added inline comments.Oct 6 2021, 1:32 PM
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
179

I'll do that separately

This revision was landed with ongoing or failed builds.Oct 6 2021, 1:32 PM
This revision was automatically updated to reflect the committed changes.

Hi. It seems the reland caused an assertion to fail on our clang builders (https://luci-milo.appspot.com/ui/p/fuchsia/builders/prod/clang-linux-x64/b8834065059600721665/overview):

[194/194] Building CXX object lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64SpeculationHardening.cpp.o
FAILED: lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64SpeculationHardening.cpp.o 
/usr/local/google/home/leonardchan/fuchsia/prebuilt/third_party/goma/linux-x64/gomacc /usr/local/google/home/leonardchan/llvm-monorepo/llvm-build-1-two-stage-fuchsia-toolchain/./bin/clang++ --sysroot=/usr/local/google/home/leonardchan/sysroot/linux -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Target/AArch64 -I/usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Target/AArch64 -Iinclude -I/usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/include -I/usr/local/google/home/leonardchan/misc/zlib-install/include -stdlib=libc++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -ffile-prefix-map=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins=../llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins -ffile-prefix-map=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/= -no-canonical-prefixes -O3 -DNDEBUG -fvisibility=hidden  -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -std=c++14 -MD -MT lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64SpeculationHardening.cpp.o -MF lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64SpeculationHardening.cpp.o.d -o lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64SpeculationHardening.cpp.o -c /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Target/AArch64/AArch64SpeculationHardening.cpp
clang++: /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/include/llvm/Support/Alignment.h:77: llvm::Align::Align(uint64_t): Assertion `Value > 0 && "Value must not be 0"' failed.

Would you be able to send out a fix or revert? I'll see if I can also provide a stack trace.

Yes a stack trace/repro would be nice.
I see a couple places that might be causing issues, I'll try fixing those.

I've comitted https://reviews.llvm.org/rGa0a493518245fa20fe15703a1be6babcb0c43c0a, if your stack trace is different, the fix will probably be very similar

Finally got the stacktrace:

leonardchan@cp-snakewater:~/llvm-monorepo/llvm-build-1-clang-only-debug$ bin/clang++ "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "--mrelax-relocations" "-disable-free" "-main-file-name" "AArch64SpeculationHardening.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=none" "-fmath-errno" "-fno-rounding-math" "-mconstructor-aliases" "-target-cpu" "x86-64" "-tune-cpu" "generic" "-debugger-tuning=gdb" "-ffunction-sections" "-fdata-sections" "-fcoverage-compilation-dir=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins" "-sys-header-deps" "-D" "GTEST_HAS_RTTI=0" "-D" "_GNU_SOURCE" "-D" "__STDC_CONSTANT_MACROS" "-D" "__STDC_FORMAT_MACROS" "-D" "__STDC_LIMIT_MACROS" "-D" "NDEBUG" "-fmacro-prefix-map=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins=../llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins" "-fmacro-prefix-map=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/=" "-fcoverage-prefix-map=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins=../llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins" "-fcoverage-prefix-map=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/=" "-O3" "-Werror=date-time" "-Werror=unguarded-availability-new" "-Wall" "-Wextra" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wmissing-field-initializers" "-Wno-long-long" "-Wc++98-compat-extra-semi" "-Wimplicit-fallthrough" "-Wcovered-switch-default" "-Wno-noexcept-type" "-Wnon-virtual-dtor" "-Wdelete-non-virtual-dtor" "-Wsuggest-override" "-Wno-comment" "-Wstring-conversion" "-Wmisleading-indentation" "-pedantic" "-std=c++14" "-fdeprecated-macro" "-fdebug-compilation-dir=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins" "-fdebug-prefix-map=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins=../llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins" "-fdebug-prefix-map=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/=" "-ferror-limit" "19" "-fvisibility" "hidden" "-fvisibility-inlines-hidden" "-fno-rtti" "-fgnuc-version=4.2.1" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-faddrsig" "-x" "c++" ~/misc/AArch64SpeculationHardening-33e9d2.cpp
clang++: /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/include/llvm/Support/Alignment.h:77: llvm::Align::Align(uint64_t): Assertion `Value > 0 && "Value must not be 0"' 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.	Program arguments: bin/clang++ -cc1 -triple x86_64-unknown-linux-gnu -emit-obj --mrelax-relocations -disable-free -main-file-name AArch64SpeculationHardening.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -ffunction-sections -fdata-sections -fcoverage-compilation-dir=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins -sys-header-deps -D GTEST_HAS_RTTI=0 -D _GNU_SOURCE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -D NDEBUG -fmacro-prefix-map=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins=../llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins -fmacro-prefix-map=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/= -fcoverage-prefix-map=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins=../llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins -fcoverage-prefix-map=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/= -O3 -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -pedantic -std=c++14 -fdeprecated-macro -fdebug-compilation-dir=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins -fdebug-prefix-map=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins=../llvm-build-1-two-stage-fuchsia-toolchain/tools/clang/stage2-bins -fdebug-prefix-map=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/= -ferror-limit 19 -fvisibility hidden -fvisibility-inlines-hidden -fno-rtti -fgnuc-version=4.2.1 -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -x c++ /usr/local/google/home/leonardchan/misc/AArch64SpeculationHardening-33e9d2.cpp
1.	<eof> parser at end of file
2.	Optimizer
 #0 0x00000000093983ca llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Support/Unix/Signals.inc:565:11
 #1 0x00000000093984db PrintStackTraceSignalHandler(void*) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Support/Unix/Signals.inc:632:1
 #2 0x0000000009396d93 llvm::sys::RunSignalHandlers() /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Support/Signals.cpp:97:5
 #3 0x0000000009398b15 SignalHandler(int) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Support/Unix/Signals.inc:407:1
 #4 0x00007f7b15b51140 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14140)
 #5 0x00007f7b1585ece1 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x3bce1)
 #6 0x00007f7b15848537 abort (/lib/x86_64-linux-gnu/libc.so.6+0x25537)
 #7 0x00007f7b1584840f __tls_get_addr (/lib/x86_64-linux-gnu/libc.so.6+0x2540f)
 #8 0x00007f7b15857662 (/lib/x86_64-linux-gnu/libc.so.6+0x34662)
 #9 0x0000000005d5fa99 llvm::Align::Align(unsigned long) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/include/llvm/Support/Alignment.h:78:5
#10 0x0000000009045bec (anonymous namespace)::LoopPromoter::doExtraRewritesBeforeFinalDeletion() /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Transforms/Scalar/LICM.cpp:1921:27
#11 0x00000000094febaa llvm::LoadAndStorePromoter::run(llvm::SmallVectorImpl<llvm::Instruction*> const&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Transforms/Utils/SSAUpdater.cpp:448:28
#12 0x0000000009042c96 llvm::promoteLoopAccessesToScalars(llvm::SmallSetVector<llvm::Value*, 8u> const&, llvm::SmallVectorImpl<llvm::BasicBlock*>&, llvm::SmallVectorImpl<llvm::Instruction*>&, llvm::SmallVectorImpl<llvm::MemoryAccess*>&, llvm::PredIteratorCache&, llvm::LoopInfo*, llvm::DominatorTree*, llvm::TargetLibraryInfo const*, llvm::Loop*, llvm::MemorySSAUpdater*, llvm::ICFLoopSafetyInfo*, llvm::OptimizationRemarkEmitter*) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Transforms/Scalar/LICM.cpp:2255:7
#13 0x000000000903c503 (anonymous namespace)::LoopInvariantCodeMotion::runOnLoop(llvm::Loop*, llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*, llvm::BlockFrequencyInfo*, llvm::TargetLibraryInfo*, llvm::TargetTransformInfo*, llvm::ScalarEvolution*, llvm::MemorySSA*, llvm::OptimizationRemarkEmitter*, bool) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Transforms/Scalar/LICM.cpp:467:28
#14 0x000000000903be19 llvm::LICMPass::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Transforms/Scalar/LICM.cpp:274:7
#15 0x000000000b065647 llvm::detail::PassModel<llvm::Loop, llvm::LICMPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/include/llvm/IR/PassManagerInternal.h:88:17
#16 0x000000000b08a359 llvm::FunctionToLoopPassAdaptor::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Transforms/Scalar/LoopPassManager.cpp:291:14
#17 0x000000000b064e57 llvm::detail::PassModel<llvm::Function, llvm::FunctionToLoopPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/include/llvm/IR/PassManagerInternal.h:88:17
#18 0x0000000008759d1d llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/include/llvm/IR/PassManager.h:525:16
#19 0x00000000062b8c97 llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/include/llvm/IR/PassManagerInternal.h:88:17
#20 0x0000000007a77713 llvm::CGSCCToFunctionPassAdaptor::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Analysis/CGSCCPassManager.cpp:551:14
#21 0x00000000062be887 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::CGSCCToFunctionPassAdaptor, llvm::PreservedAnalyses, 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&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/include/llvm/IR/PassManagerInternal.h:88:17
#22 0x0000000007a754fc 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&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Analysis/CGSCCPassManager.cpp:89:14
#23 0x0000000008956c97 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>, llvm::PreservedAnalyses, 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&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/include/llvm/IR/PassManagerInternal.h:88:17
#24 0x0000000007a765a9 llvm::DevirtSCCRepeatedPass::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Analysis/CGSCCPassManager.cpp:417:9
#25 0x0000000008957657 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::DevirtSCCRepeatedPass, llvm::PreservedAnalyses, 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&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/include/llvm/IR/PassManagerInternal.h:88:17
#26 0x0000000007a7605c llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Analysis/CGSCCPassManager.cpp:282:20
#27 0x0000000008957147 llvm::detail::PassModel<llvm::Module, llvm::ModuleToPostOrderCGSCCPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/include/llvm/IR/PassManagerInternal.h:88:17
#28 0x0000000008758fcd llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/include/llvm/IR/PassManager.h:525:16
#29 0x0000000008948f45 llvm::ModuleInlinerWrapperPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/lib/Transforms/IPO/Inliner.cpp:1049:3
#30 0x000000000b047927 llvm::detail::PassModel<llvm::Module, llvm::ModuleInlinerWrapperPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/include/llvm/IR/PassManagerInternal.h:88:17
#31 0x0000000008758fcd llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/llvm/include/llvm/IR/PassManager.h:525:16
#32 0x000000000a0d9740 (anonymous namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction, std::__2::unique_ptr<llvm::raw_pwrite_stream, std::__2::default_delete<llvm::raw_pwrite_stream> >) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/clang/lib/CodeGen/BackendUtil.cpp:1509:5
#33 0x000000000a0d7299 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::__2::unique_ptr<llvm::raw_pwrite_stream, std::__2::default_delete<llvm::raw_pwrite_stream> >) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/clang/lib/CodeGen/BackendUtil.cpp:1675:5
#34 0x000000000a544165 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/clang/lib/CodeGen/CodeGenAction.cpp:360:7
#35 0x000000000cc06171 clang::ParseAST(clang::Sema&, bool, bool) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/clang/lib/Parse/ParseAST.cpp:178:12
#36 0x000000000a37760c clang::ASTFrontendAction::ExecuteAction() /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/clang/lib/Frontend/FrontendAction.cpp:1065:1
#37 0x000000000a53fca2 clang::CodeGenAction::ExecuteAction() /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/clang/lib/CodeGen/CodeGenAction.cpp:1094:5
#38 0x000000000a37703c clang::FrontendAction::Execute() /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/clang/lib/Frontend/FrontendAction.cpp:960:7
#39 0x000000000a2b5721 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/clang/lib/Frontend/CompilerInstance.cpp:975:23
#40 0x000000000a52e8b7 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:261:8
#41 0x0000000005d23574 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/clang/tools/driver/cc1_main.cpp:246:13
#42 0x0000000005d15fab ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/clang/tools/driver/driver.cpp:317:5
#43 0x0000000005d15075 main /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/clang/tools/driver/driver.cpp:388:5
#44 0x00007f7b15849d0a __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26d0a)
#45 0x0000000005d148ba _start (bin/clang+++0x5d148ba)
Aborted

I've also uploaded the crash reproducer at https://drive.google.com/drive/folders/1AYJwxpgPCslg7iK8dtLHUp7hkfW65Qnh?usp=sharing.

Sorry about that, should be fixed with 20a0c482e0.