Skip to content

Conversation

@slinder1
Copy link
Contributor

No description provided.

Comment on lines +11 to +135
if: github.event.pull_request.draft == false
runs-on:
group: compiler-generic-runners
env:
PR_SHA: ${{ github.event.pull_request.head.sha != '' && github.event.pull_request.head.sha || github.sha }}
PR_NUMBER: ${{ github.event.pull_request.number != '' && github.event.pull_request.number || 0 }}
PR_URL: ${{ github.event.pull_request.html_url != '' && github.event.pull_request.html_url || '' }}
PR_TITLE: ${{ github.event.pull_request.title != '' && github.event.pull_request.title || '' }}
BASE_BRANCH: ${{ github.event.pull_request.base.ref != '' && github.event.pull_request.base.ref || '' }}
GITHUB_TOKEN: ${{secrets.CI_GITHUB_TOKEN}}

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Set environment variable for container image
run: |
echo "CONTAINER_IMAGE=${{ secrets.BUILDBOT_DOCKER_IMAGE }}" >> $GITHUB_ENV
echo "CONTAINER_NAME=my_container_${{ github.run_id }}" >> $GITHUB_ENV

- name: Pull container image
run: docker pull "${{env.CONTAINER_IMAGE}}"

- name: Run container
run: |
docker run -d --name "${{env.CONTAINER_NAME}}" $CONTAINER_IMAGE sleep infinity
docker exec "${{env.CONTAINER_NAME}}" /bin/bash -c "echo 'Running commands inside the container'"

- name: Escape pull request title
run: |
import json
import os
import shlex
with open('${{ github.event_path }}') as fh:
event = json.load(fh)
escaped = event['pull_request']['title']
with open(os.environ['GITHUB_ENV'], 'a') as fh:
print(f'PR_TITLE={escaped}', file=fh)
shell: python3 {0}

- name: Trigger Buildbot Build
run: |
echo "${{ secrets.BUILDBOT_HOST }}:${{ secrets.BUILDBOT_WORKER_PORT }}"
docker exec -e PR_TITLE="$PR_TITLE" "${{env.CONTAINER_NAME}}" /bin/bash -c 'buildbot sendchange -W ${{ secrets.BUILDBOT_USER }} -a ${{secrets.BUILDBOT_USER}}:${{secrets.BUILDBOT_PWD}} --master="${{ secrets.BUILDBOT_HOST }}:${{ secrets.BUILDBOT_WORKER_PORT }}" --branch=${{ env.BASE_BRANCH }} --revision=${{ env.PR_SHA }} -p PR_NUMBER:${{ env.PR_NUMBER }} -p PR_TITLE:"$PR_TITLE" -p PR_URL:${{ env.PR_URL }} -p SHA:${{ env.PR_SHA }}'

- name: Set Initial Status to Pending
run: |
docker exec -e PR_SHA=$PR_SHA -e GITHUB_TOKEN=$GITHUB_TOKEN "${{env.CONTAINER_NAME}}" /bin/bash -c "python3 -c \"
import os
import requests
GITHUB_TOKEN = os.getenv('GITHUB_TOKEN')
TARGET_SHA = os.getenv('PR_SHA')
print('debug', TARGET_SHA)
api_url = f'https://api.github.com/repos/AMD-Lightning-Internal/llvm-project/statuses/{TARGET_SHA}'
headers = {
'Authorization': f'token {GITHUB_TOKEN}',
'Content-Type': 'application/json'
}
payload = {
'state': 'pending',
'context': 'buildbot',
'description': 'Build is in queue'
}
response = requests.post(api_url, json=payload, headers=headers)
if response.status_code == 201:
print('Status set to pending successfully.')
else:
print(f'Failed to set status: {response.status_code} {response.text}')
\""

- name: Poll Buildbot build status
run: |
python3 -c "
import os
import time
import requests
GITHUB_TOKEN = os.getenv('GITHUB_TOKEN')
BUILD_URL = 'http://${{ secrets.BUILDBOT_HOST }}:${{ secrets.BUILDBOT_MASTER_PORT }}/api/v2/builds'
TARGET_SHA = os.getenv('PR_SHA')
print('debug', TARGET_SHA)
MAX_RETRIES = 10
RETRY_INTERVAL = 30 # seconds

def get_build_properties(build_id):
build_properties_url = f'http://${{ secrets.BUILDBOT_HOST }}:${{ secrets.BUILDBOT_MASTER_PORT }}/api/v2/builds/{build_id}/properties'
response = requests.get(build_properties_url, headers={'Accept': 'application/json', 'Authorization': f'token {GITHUB_TOKEN}'})
return response.json()

for i in range(MAX_RETRIES):
response = requests.get(BUILD_URL, headers={'Accept': 'application/json'})
response_json = response.json()
print(f'Attempt {i + 1}: Buildbot response:', response_json)

# Check if any build has the target SHA
builds = response_json.get('builds', [])
print (builds)
build_with_sha = None
for build in builds:
build_id = build['buildid']
properties = get_build_properties(build_id)
#print(properties)
#prop = properties.get('revision', [])

if 'properties' in properties:
print (properties['properties'])
if 'revision' in properties['properties'][0]:
print(properties['properties'][0])
if 'revision' in properties['properties'][0] and properties['properties'][0]['revision'] [0] == TARGET_SHA:
build_with_sha = build
break

if build_with_sha:
print('Build started successfully for SHA:', TARGET_SHA)
break
else:
print('Build for SHA not started yet, retrying in', RETRY_INTERVAL, 'seconds')
time.sleep(RETRY_INTERVAL)
else:
print('Build did not start for SHA:', TARGET_SHA, 'after maximum retries')
exit(1)
"

- name: Stop and remove container
if: always()
run: |
docker stop "${{env.CONTAINER_NAME}}"
docker rm "${{env.CONTAINER_NAME}}"

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
@github-actions
Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff origin/main HEAD --extensions cpp,h,cl,c -- clang/test/CodeGen/debug-info-block-expr-heterogeneous-dwarf.c clang/test/CodeGen/debug-info-global-constant-heterogeneous-dwarf.c clang/test/CodeGenCXX/heterogeneous-debug-info-structured-binding-bitfield.cpp clang/test/CodeGenCXX/heterogeneous-debug-info-structured-binding.cpp clang/test/Driver/amdgpu-debug.cl llvm/unittests/rocm-gdb-symbols/AsmParserTest.cpp llvm/unittests/rocm-gdb-symbols/AsmWriterTest.cpp clang/include/clang/Basic/CodeGenOptions.h clang/lib/CodeGen/CGDebugInfo.cpp clang/lib/CodeGen/CGDebugInfo.h clang/lib/Driver/ToolChains/Clang.cpp clang/test/CodeGenOpenCL/amdgpu-debug-info-pointer-address-space.cl clang/test/CodeGenOpenCL/amdgpu-debug-info-variable-expression.cl clang/test/CodeGenOpenCL/spir-debug-info-pointer-address-space.cl llvm/include/llvm-c/DebugInfo.h llvm/include/llvm/ADT/Hashing.h llvm/include/llvm/AsmParser/LLParser.h llvm/include/llvm/AsmParser/LLToken.h llvm/include/llvm/BinaryFormat/Dwarf.h llvm/include/llvm/CodeGen/AsmPrinter.h llvm/include/llvm/CodeGen/MachineFunction.h llvm/include/llvm/CodeGen/TargetFrameLowering.h llvm/include/llvm/CodeGen/TargetRegisterInfo.h llvm/include/llvm/DebugInfo/DIContext.h llvm/include/llvm/IR/DIBuilder.h llvm/include/llvm/IR/DebugInfoMetadata.h llvm/include/llvm/MC/MCAsmInfo.h llvm/include/llvm/MC/MCDwarf.h llvm/include/llvm/MC/MCStreamer.h llvm/include/llvm/Target/TargetMachine.h llvm/include/llvm/Transforms/Utils/Local.h llvm/lib/AsmParser/LLLexer.cpp llvm/lib/AsmParser/LLParser.cpp llvm/lib/BinaryFormat/Dwarf.cpp llvm/lib/Bitcode/Reader/MetadataLoader.cpp llvm/lib/Bitcode/Writer/BitcodeWriter.cpp llvm/lib/Bitcode/Writer/ValueEnumerator.cpp llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h llvm/lib/CodeGen/AsmPrinter/DebugLocStream.cpp llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h llvm/lib/CodeGen/CFIInstrInserter.cpp llvm/lib/CodeGen/CodeGenPrepare.cpp llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp llvm/lib/CodeGen/MIRParser/MILexer.cpp llvm/lib/CodeGen/MIRParser/MILexer.h llvm/lib/CodeGen/MIRParser/MIParser.cpp llvm/lib/CodeGen/MachineFunction.cpp llvm/lib/CodeGen/MachineInstr.cpp llvm/lib/CodeGen/MachineOperand.cpp llvm/lib/CodeGen/PrologEpilogInserter.cpp llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp llvm/lib/DWARFCFIChecker/DWARFCFIState.cpp llvm/lib/DebugInfo/DWARF/DWARFDie.cpp llvm/lib/DebugInfo/DWARF/DWARFExpressionPrinter.cpp llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp llvm/lib/IR/AsmWriter.cpp llvm/lib/IR/DIBuilder.cpp llvm/lib/IR/DIExpressionOptimizer.cpp llvm/lib/IR/DebugInfo.cpp llvm/lib/IR/DebugInfoMetadata.cpp llvm/lib/IR/LLVMContextImpl.h llvm/lib/IR/TypeFinder.cpp llvm/lib/IR/Verifier.cpp llvm/lib/MC/MCAsmStreamer.cpp llvm/lib/MC/MCDwarf.cpp llvm/lib/MC/MCParser/AsmParser.cpp llvm/lib/MC/MCParser/MasmParser.cpp llvm/lib/MC/MCStreamer.cpp llvm/lib/Target/AMDGPU/AMDGPUFrameLowering.cpp llvm/lib/Target/AMDGPU/AMDGPUFrameLowering.h llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp llvm/lib/Target/AMDGPU/SIFrameLowering.cpp llvm/lib/Target/AMDGPU/SIFrameLowering.h llvm/lib/Target/AMDGPU/SIInsertHardClauses.cpp llvm/lib/Target/AMDGPU/SIInstrInfo.cpp llvm/lib/Target/AMDGPU/SIInstrInfo.h llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp llvm/lib/Target/AMDGPU/SIRegisterInfo.h llvm/lib/Transforms/Coroutines/CoroFrame.cpp llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp llvm/lib/Transforms/Scalar/SROA.cpp llvm/lib/Transforms/Utils/CodeExtractor.cpp llvm/lib/Transforms/Utils/Debugify.cpp llvm/lib/Transforms/Utils/Local.cpp llvm/tools/llvm-c-test/debuginfo.c llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp llvm/unittests/IR/DebugInfoTest.cpp llvm/unittests/IR/MetadataTest.cpp mlir/lib/Target/LLVMIR/DebugTranslation.cpp mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp --diff_from_common_commit

⚠️
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing origin/main to the base branch/commit you want to compare against.
⚠️

View the diff from clang-format here.
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index d0d25d13e..a18fa4a16 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -5501,8 +5501,7 @@ llvm::DILocalVariable *CGDebugInfo::EmitDeclareForHeterogeneousDwarf(
   StringRef Name = VD->getName();
 
   llvm::Type *VDMemTy = CGM.getTypes().ConvertTypeForMem(VD->getType());
-  llvm::Type *BlockPtrTy = llvm::PointerType::getUnqual(
-      CGM.getLLVMContext());
+  llvm::Type *BlockPtrTy = llvm::PointerType::getUnqual(CGM.getLLVMContext());
 
   llvm::DIExprBuilder ExprBuilder(CGM.getLLVMContext());
   ExprBuilder.append<llvm::DIOp::Arg>(0u, Storage->getType());
@@ -6108,9 +6107,8 @@ llvm::DIGlobalVariableExpression *CGDebugInfo::CollectAnonRecordDecls(
     // Ignore unnamed fields, but recurse into anonymous records.
     if (FieldName.empty()) {
       if (const auto *RT = dyn_cast<RecordType>(Field->getType()))
-        GVE = CollectAnonRecordDecls(
-            RT->getDecl()->getDefinitionOrSelf(), Unit, LineNo,
-            LinkageName, MS, Var, DContext);
+        GVE = CollectAnonRecordDecls(RT->getDecl()->getDefinitionOrSelf(), Unit,
+                                     LineNo, LinkageName, MS, Var, DContext);
       continue;
     }
     // Use VarDecl's Tag, Scope and Line number.
@@ -6139,8 +6137,8 @@ CGDebugInfo::CollectAnonRecordDeclsForHeterogeneousDwarf(
     if (FieldName.empty()) {
       if (const auto *RT = dyn_cast<RecordType>(Field->getType()))
         GVE = CollectAnonRecordDeclsForHeterogeneousDwarf(
-            RT->getDecl()->getDefinitionOrSelf(), Unit, LineNo,
-            LinkageName, MS, Var, DContext);
+            RT->getDecl()->getDefinitionOrSelf(), Unit, LineNo, LinkageName, MS,
+            Var, DContext);
       continue;
     }
     // Use VarDecl's Tag, Scope and Line number.
@@ -6607,14 +6605,13 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD, const APValue &Init) {
       TemplateParameters, MS, Align));
 }
 
-void CGDebugInfo::EmitGlobalVariableForHeterogeneousDwarf(
-    const ValueDecl *VD, const APValue &Init) {
+void CGDebugInfo::EmitGlobalVariableForHeterogeneousDwarf(const ValueDecl *VD,
+                                                          const APValue &Init) {
   assert(CGM.getCodeGenOpts().hasReducedDebugInfo());
   if (VD->hasAttr<NoDebugAttr>())
     return;
-  llvm::TimeTraceScope TimeScope("DebugConstGlobalVariable", [&]() {
-    return GetName(VD, true);
-  });
+  llvm::TimeTraceScope TimeScope("DebugConstGlobalVariable",
+                                 [&]() { return GetName(VD, true); });
 
   auto Align = getDeclAlignIfRequired(VD, CGM.getContext());
   // Create the descriptor for the variable.
diff --git a/llvm/include/llvm/ADT/Hashing.h b/llvm/include/llvm/ADT/Hashing.h
index cdf7ee204..62ecff2bb 100644
--- a/llvm/include/llvm/ADT/Hashing.h
+++ b/llvm/include/llvm/ADT/Hashing.h
@@ -132,7 +132,6 @@ template <typename T> hash_code hash_value(const std::optional<T> &arg);
 /// Compute a hash_code for a variant.
 template <typename... Ts> hash_code hash_value(const std::variant<Ts...> &arg);
 
-
 // All of the implementation details of actually computing the various hash
 // code values are held within this namespace. These routines are included in
 // the header file mainly to allow inlining and constant propagation.
diff --git a/llvm/include/llvm/IR/DebugInfoMetadata.h b/llvm/include/llvm/IR/DebugInfoMetadata.h
index 0cfd11bba..300921f07 100644
--- a/llvm/include/llvm/IR/DebugInfoMetadata.h
+++ b/llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -1310,9 +1310,9 @@ private:
 
   DIDerivedType(LLVMContext &C, StorageType Storage, unsigned Tag,
                 unsigned Line, uint32_t AlignInBits,
-                std::optional<unsigned> DWARFAddressSpace, dwarf::MemorySpace MS,
-                std::optional<PtrAuthData> PtrAuthData, DIFlags Flags,
-                ArrayRef<Metadata *> Ops)
+                std::optional<unsigned> DWARFAddressSpace,
+                dwarf::MemorySpace MS, std::optional<PtrAuthData> PtrAuthData,
+                DIFlags Flags, ArrayRef<Metadata *> Ops)
       : DIType(C, DIDerivedTypeKind, Storage, Tag, Line, AlignInBits, 0, Flags,
                Ops),
         DWARFAddressSpace(DWARFAddressSpace), DWARFMemorySpace(MS) {
@@ -1364,8 +1364,8 @@ private:
           bool ShouldCreate = true) {
     return getImpl(Context, Tag, getCanonicalMDString(Context, Name), File,
                    Line, Scope, BaseType, SizeInBits, AlignInBits, OffsetInBits,
-                   DWARFAddressSpace, MS, PtrAuthData, Flags, ExtraData, Annotations.get(),
-                   Storage, ShouldCreate);
+                   DWARFAddressSpace, MS, PtrAuthData, Flags, ExtraData,
+                   Annotations.get(), Storage, ShouldCreate);
   }
   LLVM_ABI static DIDerivedType *
   getImpl(LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
@@ -1380,56 +1380,58 @@ private:
     return getTemporary(
         getContext(), getTag(), getRawName(), getFile(), getLine(), getScope(),
         getBaseType(), getRawSizeInBits(), getAlignInBits(),
-        getRawOffsetInBits(), getDWARFAddressSpace(), getDWARFMemorySpace(), getPtrAuthData(),
-        getFlags(), getExtraData(), getRawAnnotations());
+        getRawOffsetInBits(), getDWARFAddressSpace(), getDWARFMemorySpace(),
+        getPtrAuthData(), getFlags(), getExtraData(), getRawAnnotations());
   }
 
 public:
-  DEFINE_MDNODE_GET(DIDerivedType,
-                    (unsigned Tag, MDString *Name, Metadata *File,
-                     unsigned Line, Metadata *Scope, Metadata *BaseType,
-                     Metadata *SizeInBits, uint32_t AlignInBits,
-                     Metadata *OffsetInBits,
-                     std::optional<unsigned> DWARFAddressSpace, dwarf::MemorySpace MS,
-                     std::optional<PtrAuthData> PtrAuthData, DIFlags Flags,
-                     Metadata *ExtraData = nullptr,
-                     Metadata *Annotations = nullptr),
-                    (Tag, Name, File, Line, Scope, BaseType, SizeInBits,
-                     AlignInBits, OffsetInBits, DWARFAddressSpace, MS, PtrAuthData,
-                     Flags, ExtraData, Annotations))
+  DEFINE_MDNODE_GET(
+      DIDerivedType,
+      (unsigned Tag, MDString *Name, Metadata *File, unsigned Line,
+       Metadata *Scope, Metadata *BaseType, Metadata *SizeInBits,
+       uint32_t AlignInBits, Metadata *OffsetInBits,
+       std::optional<unsigned> DWARFAddressSpace, dwarf::MemorySpace MS,
+       std::optional<PtrAuthData> PtrAuthData, DIFlags Flags,
+       Metadata *ExtraData = nullptr, Metadata *Annotations = nullptr),
+      (Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits,
+       OffsetInBits, DWARFAddressSpace, MS, PtrAuthData, Flags, ExtraData,
+       Annotations))
   DEFINE_MDNODE_GET(DIDerivedType,
                     (unsigned Tag, StringRef Name, DIFile *File, unsigned Line,
                      DIScope *Scope, DIType *BaseType, Metadata *SizeInBits,
                      uint32_t AlignInBits, Metadata *OffsetInBits,
-                     std::optional<unsigned> DWARFAddressSpace, dwarf::MemorySpace MS,
+                     std::optional<unsigned> DWARFAddressSpace,
+                     dwarf::MemorySpace MS,
                      std::optional<PtrAuthData> PtrAuthData, DIFlags Flags,
                      Metadata *ExtraData = nullptr,
                      DINodeArray Annotations = nullptr),
                     (Tag, Name, File, Line, Scope, BaseType, SizeInBits,
-                     AlignInBits, OffsetInBits, DWARFAddressSpace, MS, PtrAuthData,
-                     Flags, ExtraData, Annotations))
+                     AlignInBits, OffsetInBits, DWARFAddressSpace, MS,
+                     PtrAuthData, Flags, ExtraData, Annotations))
   DEFINE_MDNODE_GET(DIDerivedType,
                     (unsigned Tag, MDString *Name, DIFile *File, unsigned Line,
                      DIScope *Scope, DIType *BaseType, uint64_t SizeInBits,
                      uint32_t AlignInBits, uint64_t OffsetInBits,
-                     std::optional<unsigned> DWARFAddressSpace, dwarf::MemorySpace MS,
+                     std::optional<unsigned> DWARFAddressSpace,
+                     dwarf::MemorySpace MS,
                      std::optional<PtrAuthData> PtrAuthData, DIFlags Flags,
                      Metadata *ExtraData = nullptr,
                      DINodeArray Annotations = nullptr),
                     (Tag, Name, File, Line, Scope, BaseType, SizeInBits,
-                     AlignInBits, OffsetInBits, DWARFAddressSpace, MS, PtrAuthData,
-                     Flags, ExtraData, Annotations))
+                     AlignInBits, OffsetInBits, DWARFAddressSpace, MS,
+                     PtrAuthData, Flags, ExtraData, Annotations))
   DEFINE_MDNODE_GET(DIDerivedType,
                     (unsigned Tag, StringRef Name, DIFile *File, unsigned Line,
                      DIScope *Scope, DIType *BaseType, uint64_t SizeInBits,
                      uint32_t AlignInBits, uint64_t OffsetInBits,
-                     std::optional<unsigned> DWARFAddressSpace, dwarf::MemorySpace MS, 
+                     std::optional<unsigned> DWARFAddressSpace,
+                     dwarf::MemorySpace MS,
                      std::optional<PtrAuthData> PtrAuthData, DIFlags Flags,
                      Metadata *ExtraData = nullptr,
                      DINodeArray Annotations = nullptr),
                     (Tag, Name, File, Line, Scope, BaseType, SizeInBits,
-                     AlignInBits, OffsetInBits, DWARFAddressSpace, MS, PtrAuthData, Flags,
-                     ExtraData, Annotations))
+                     AlignInBits, OffsetInBits, DWARFAddressSpace, MS,
+                     PtrAuthData, Flags, ExtraData, Annotations))
 
   TempDIDerivedType clone() const { return cloneImpl(); }
 
@@ -4500,8 +4502,8 @@ public:
   template <typename T, typename... ArgsT>
   Iterator insert(Iterator I, ArgsT &&...Args) {
     // FIXME: SmallVector doesn't define an ::emplace(iterator, ...)
-    return Elements.insert(
-        I.Op, DIOp::Variant{std::in_place_type<T>, std::forward<ArgsT>(Args)...});
+    return Elements.insert(I.Op, DIOp::Variant{std::in_place_type<T>,
+                                               std::forward<ArgsT>(Args)...});
   }
 
   template <typename RangeTy> Iterator insert(Iterator I, RangeTy &&R) {
diff --git a/llvm/include/llvm/MC/MCDwarf.h b/llvm/include/llvm/MC/MCDwarf.h
index c457a2be6..2d91c24ae 100644
--- a/llvm/include/llvm/MC/MCDwarf.h
+++ b/llvm/include/llvm/MC/MCDwarf.h
@@ -838,8 +838,8 @@ public:
            Operation == OpSameValue || Operation == OpDefCfaRegister ||
            Operation == OpLLVMVectorRegisters ||
            Operation == OpLLVMRegisterPair || Operation == OpLLVMVectorOffset ||
-           Operation == OpLLVMVectorRegisterMask ||
-           Operation == OpRelOffset || Operation == OpValOffset);
+           Operation == OpLLVMVectorRegisterMask || Operation == OpRelOffset ||
+           Operation == OpValOffset);
     return U.RI.Register;
   }
 
@@ -859,8 +859,7 @@ public:
     assert(Operation == OpDefCfa || Operation == OpOffset ||
            Operation == OpRelOffset || Operation == OpDefCfaOffset ||
            Operation == OpAdjustCfaOffset || Operation == OpGnuArgsSize ||
-           Operation == OpLLVMVectorOffset ||
-           Operation == OpValOffset);
+           Operation == OpLLVMVectorOffset || Operation == OpValOffset);
     return U.RI.Offset;
   }
 
diff --git a/llvm/include/llvm/Transforms/Utils/Local.h b/llvm/include/llvm/Transforms/Utils/Local.h
index 7ceed39ad..6b55b6b5f 100644
--- a/llvm/include/llvm/Transforms/Utils/Local.h
+++ b/llvm/include/llvm/Transforms/Utils/Local.h
@@ -368,7 +368,8 @@ salvageDebugInfoImpl(Instruction &I, uint64_t CurrentLocOps,
 /// introducing a use-before-def, it is either salvaged (\ref salvageDebugInfo)
 /// or deleted. Returns true if any debug users were updated.
 LLVM_ABI bool replaceAllDbgUsesWith(Instruction &From, Value &To,
-                                    Instruction &DomPoint, const DominatorTree &DT);
+                                    Instruction &DomPoint,
+                                    const DominatorTree &DT);
 
 /// If a terminator in an unreachable basic block has an operand of type
 /// Instruction, transform it into poison. Return true if any operands
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 54e5455bc..e582b0e33 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -5766,7 +5766,7 @@ bool LLParser::parseDIDerivedType(MDNode *&Result, bool IsDistinct) {
   OPTIONAL(offset, MDUnsignedOrMDField, (0, UINT64_MAX));                      \
   OPTIONAL(flags, DIFlagField, );                                              \
   OPTIONAL(extraData, MDField, );                                              \
-  OPTIONAL(addressSpace, MDUnsignedField, (UINT32_MAX, UINT32_MAX));      \
+  OPTIONAL(addressSpace, MDUnsignedField, (UINT32_MAX, UINT32_MAX));           \
   OPTIONAL(memorySpace, DwarfMSpaceField, );                                   \
   OPTIONAL(annotations, MDField, );                                            \
   OPTIONAL(ptrAuthKey, MDUnsignedField, (0, 7));                               \
@@ -5778,7 +5778,7 @@ bool LLParser::parseDIDerivedType(MDNode *&Result, bool IsDistinct) {
 #undef VISIT_MD_FIELDS
 
   std::optional<unsigned> DWARFAddressSpace;
-  
+
   if (addressSpace.Val != UINT32_MAX)
     DWARFAddressSpace = addressSpace.Val;
   std::optional<DIDerivedType::PtrAuthData> PtrAuthData;
@@ -5789,11 +5789,11 @@ bool LLParser::parseDIDerivedType(MDNode *&Result, bool IsDistinct) {
         ptrAuthAuthenticatesNullValues.Val);
 
   Result = GET_OR_DISTINCT(
-      DIDerivedType, (Context, tag.Val, name.Val, file.Val, line.Val, scope.Val,
-                      baseType.Val, size.getValueAsMetadata(Context), align.Val,
-                      offset.getValueAsMetadata(Context), DWARFAddressSpace,
-                      memorySpace.val(),
-                      PtrAuthData, flags.Val, extraData.Val, annotations.Val));
+      DIDerivedType,
+      (Context, tag.Val, name.Val, file.Val, line.Val, scope.Val, baseType.Val,
+       size.getValueAsMetadata(Context), align.Val,
+       offset.getValueAsMetadata(Context), DWARFAddressSpace, memorySpace.val(),
+       PtrAuthData, flags.Val, extraData.Val, annotations.Val));
   return false;
 }
 
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
index 95674dad6..c67f68403 100644
--- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
@@ -1844,8 +1844,8 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
                          getMDOrNull(Record[3]), Record[4],
                          getDITypeRefOrNull(Record[5]),
                          getDITypeRefOrNull(Record[6]), SizeInBits, Record[8],
-                         OffsetInBits, DWARFAddressSpace, *MSpace, PtrAuthData, Flags,
-                         getDITypeRefOrNull(Record[11]), Annotations)),
+                         OffsetInBits, DWARFAddressSpace, *MSpace, PtrAuthData,
+                         Flags, getDITypeRefOrNull(Record[11]), Annotations)),
         NextMetadataNo);
     NextMetadataNo++;
     break;
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 656e6e96d..6b4f485a6 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1333,14 +1333,14 @@ bool AsmPrinter::emitDebugComment(const MachineInstr *MI) {
   if (!isVerbose())
     return true;
 
-  switch(MI->getOpcode()) {
-      case TargetOpcode::DBG_VALUE:
-      case TargetOpcode::DBG_VALUE_LIST:
-        return emitDebugValueComment(MI, *this);
-      case TargetOpcode::DBG_LABEL:
-        return emitDebugLabelComment(MI, *this);
-      default:
-        break;
+  switch (MI->getOpcode()) {
+  case TargetOpcode::DBG_VALUE:
+  case TargetOpcode::DBG_VALUE_LIST:
+    return emitDebugValueComment(MI, *this);
+  case TargetOpcode::DBG_LABEL:
+    return emitDebugLabelComment(MI, *this);
+  default:
+    break;
   }
   return false;
 }
@@ -2053,7 +2053,7 @@ void AsmPrinter::emitFunctionBody() {
       case TargetOpcode::DBG_VALUE:
       case TargetOpcode::DBG_VALUE_LIST:
       case TargetOpcode::DBG_LABEL:
-        if(!emitDebugComment(&MI)) {
+        if (!emitDebugComment(&MI)) {
           emitInstruction(&MI);
         }
         break;
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index b08ebadf6..1be2f085d 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -301,8 +301,8 @@ void DwarfCompileUnit::addLocationAttribute(
       }
       DwarfExpr->addFragmentOffset(Expr);
 
-      std::optional<DIExpression::NewElementsRef> NewElementsRef
-          = Expr ? Expr->getNewElementsRef() : std::nullopt;
+      std::optional<DIExpression::NewElementsRef> NewElementsRef =
+          Expr ? Expr->getNewElementsRef() : std::nullopt;
       if (NewElementsRef) {
         SmallVector<DbgValueLocEntry> ArgLocEntries;
         if (Global)
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
index 6c212fc6d..01d85aca4 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
@@ -18,8 +18,8 @@
 #include "llvm/CodeGen/Register.h"
 #include "llvm/CodeGen/TargetRegisterInfo.h"
 #include "llvm/IR/DataLayout.h"
-#include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCAsmInfo.h"
+#include "llvm/MC/MCContext.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <algorithm>
 #include <stack>
@@ -1271,8 +1271,8 @@ std::optional<NewOpResult> DwarfExpression::traverse(DIOp::Composite Composite,
   return NewOpResult{Composite.getResultType(), ValueKind::LocationDesc};
 }
 
-std::optional<NewOpResult>
-DwarfExpression::traverseMathOp(uint8_t DwarfOp, ChildrenT Children) {
+std::optional<NewOpResult> DwarfExpression::traverseMathOp(uint8_t DwarfOp,
+                                                           ChildrenT Children) {
   auto LHS = traverse(Children[0].get(), ValueKind::Value);
   if (!LHS)
     return std::nullopt;
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h
index 41386b7a5..cc70daa7f 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h
@@ -347,9 +347,7 @@ public:
     bool &isLowered() { return IsLowered; }
     Type *getResultType() { return ResultType; }
 
-    void setIsLowered(bool IL = true) {
-      IsLowered = IL;
-    }
+    void setIsLowered(bool IL = true) { IsLowered = IL; }
     void setResultType(Type *RT) { ResultType = RT; }
   };
 
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index b8fc58197..0f7bf65f2 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -322,8 +322,9 @@ DIStringType *DIBuilder::createStringType(StringRef Name,
 
 DIDerivedType *DIBuilder::createQualifiedType(unsigned Tag, DIType *FromTy) {
   return DIDerivedType::get(VMContext, Tag, "", nullptr, 0, nullptr, FromTy,
-                            (uint64_t)0, 0, (uint64_t)0, std::nullopt, dwarf::DW_MSPACE_LLVM_none,
-                            std::nullopt, DINode::FlagZero);
+                            (uint64_t)0, 0, (uint64_t)0, std::nullopt,
+                            dwarf::DW_MSPACE_LLVM_none, std::nullopt,
+                            DINode::FlagZero);
 }
 
 DIDerivedType *DIBuilder::createPtrAuthQualifiedType(
@@ -347,10 +348,10 @@ DIBuilder::createPointerType(DIType *PointeeTy, uint64_t SizeInBits,
                              dwarf::MemorySpace DWARFMemorySpace,
                              StringRef Name, DINodeArray Annotations) {
   // FIXME: Why is there a name here?
-  return DIDerivedType::get(VMContext, dwarf::DW_TAG_pointer_type, Name,
-                            nullptr, 0, nullptr, PointeeTy, SizeInBits,
-                            AlignInBits, 0, DWARFAddressSpace, DWARFMemorySpace, std::nullopt,
-                            DINode::FlagZero, nullptr, Annotations);
+  return DIDerivedType::get(
+      VMContext, dwarf::DW_TAG_pointer_type, Name, nullptr, 0, nullptr,
+      PointeeTy, SizeInBits, AlignInBits, 0, DWARFAddressSpace,
+      DWARFMemorySpace, std::nullopt, DINode::FlagZero, nullptr, Annotations);
 }
 
 DIDerivedType *DIBuilder::createMemberPointerType(DIType *PointeeTy,
@@ -358,10 +359,10 @@ DIDerivedType *DIBuilder::createMemberPointerType(DIType *PointeeTy,
                                                   uint64_t SizeInBits,
                                                   uint32_t AlignInBits,
                                                   DINode::DIFlags Flags) {
-  return DIDerivedType::get(VMContext, dwarf::DW_TAG_ptr_to_member_type, "",
-                            nullptr, 0, nullptr, PointeeTy, SizeInBits,
-                            AlignInBits, 0, std::nullopt,
-                            dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags, Base);
+  return DIDerivedType::get(
+      VMContext, dwarf::DW_TAG_ptr_to_member_type, "", nullptr, 0, nullptr,
+      PointeeTy, SizeInBits, AlignInBits, 0, std::nullopt,
+      dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags, Base);
 }
 
 DIDerivedType *DIBuilder::createReferenceType(
@@ -370,8 +371,8 @@ DIDerivedType *DIBuilder::createReferenceType(
 
   assert(RTy && "Unable to create reference type");
   return DIDerivedType::get(VMContext, Tag, "", nullptr, 0, nullptr, RTy,
-                            SizeInBits, AlignInBits, 0, DWARFAddressSpace, MS, {},
-                            DINode::FlagZero);
+                            SizeInBits, AlignInBits, 0, DWARFAddressSpace, MS,
+                            {}, DINode::FlagZero);
 }
 
 DIDerivedType *DIBuilder::createTypedef(DIType *Ty, StringRef Name,
@@ -381,8 +382,9 @@ DIDerivedType *DIBuilder::createTypedef(DIType *Ty, StringRef Name,
                                         DINodeArray Annotations) {
   return DIDerivedType::get(VMContext, dwarf::DW_TAG_typedef, Name, File,
                             LineNo, getNonCompileUnitScope(Context), Ty,
-                            (uint64_t)0, AlignInBits, (uint64_t)0, std::nullopt, dwarf::DW_MSPACE_LLVM_none,
-                            std::nullopt, Flags, nullptr, Annotations);
+                            (uint64_t)0, AlignInBits, (uint64_t)0, std::nullopt,
+                            dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags,
+                            nullptr, Annotations);
 }
 
 DIDerivedType *
@@ -393,8 +395,8 @@ DIBuilder::createTemplateAlias(DIType *Ty, StringRef Name, DIFile *File,
   return DIDerivedType::get(VMContext, dwarf::DW_TAG_template_alias, Name, File,
                             LineNo, getNonCompileUnitScope(Context), Ty,
                             (uint64_t)0, AlignInBits, (uint64_t)0, std::nullopt,
-                            dwarf::DW_MSPACE_LLVM_none,
-                            std::nullopt, Flags, TParams.get(), Annotations);
+                            dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags,
+                            TParams.get(), Annotations);
 }
 
 DIDerivedType *DIBuilder::createFriend(DIType *Ty, DIType *FriendTy) {
@@ -402,8 +404,8 @@ DIDerivedType *DIBuilder::createFriend(DIType *Ty, DIType *FriendTy) {
   assert(FriendTy && "Invalid friend type!");
   return DIDerivedType::get(VMContext, dwarf::DW_TAG_friend, "", nullptr, 0, Ty,
                             FriendTy, (uint64_t)0, 0, (uint64_t)0, std::nullopt,
-                            dwarf::DW_MSPACE_LLVM_none,
-                            std::nullopt, DINode::FlagZero);
+                            dwarf::DW_MSPACE_LLVM_none, std::nullopt,
+                            DINode::FlagZero);
 }
 
 DIDerivedType *DIBuilder::createInheritance(DIType *Ty, DIType *BaseTy,
@@ -415,17 +417,19 @@ DIDerivedType *DIBuilder::createInheritance(DIType *Ty, DIType *BaseTy,
       ConstantInt::get(IntegerType::get(VMContext, 32), VBPtrOffset));
   return DIDerivedType::get(VMContext, dwarf::DW_TAG_inheritance, "", nullptr,
                             0, Ty, BaseTy, 0, 0, BaseOffset, std::nullopt,
-                            dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags, ExtraData);
+                            dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags,
+                            ExtraData);
 }
 
 DIDerivedType *DIBuilder::createMemberType(
     DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
     uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
     DINode::DIFlags Flags, DIType *Ty, DINodeArray Annotations) {
-  return DIDerivedType::get(
-      VMContext, dwarf::DW_TAG_member, Name, File, LineNumber,
-      getNonCompileUnitScope(Scope), Ty, SizeInBits, AlignInBits, OffsetInBits,
-      std::nullopt, dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags, nullptr, Annotations);
+  return DIDerivedType::get(VMContext, dwarf::DW_TAG_member, Name, File,
+                            LineNumber, getNonCompileUnitScope(Scope), Ty,
+                            SizeInBits, AlignInBits, OffsetInBits, std::nullopt,
+                            dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags,
+                            nullptr, Annotations);
 }
 
 DIDerivedType *DIBuilder::createMemberType(
@@ -435,8 +439,8 @@ DIDerivedType *DIBuilder::createMemberType(
   return DIDerivedType::get(VMContext, dwarf::DW_TAG_member, Name, File,
                             LineNumber, getNonCompileUnitScope(Scope), Ty,
                             SizeInBits, AlignInBits, OffsetInBits, std::nullopt,
-                            dwarf::DW_MSPACE_LLVM_none,
-                            std::nullopt, Flags, nullptr, Annotations);
+                            dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags,
+                            nullptr, Annotations);
 }
 
 static ConstantAsMetadata *getConstantOrNull(Constant *C) {
@@ -481,7 +485,8 @@ DIDerivedType *DIBuilder::createBitFieldMemberType(
   return DIDerivedType::get(
       VMContext, dwarf::DW_TAG_member, Name, File, LineNumber,
       getNonCompileUnitScope(Scope), Ty, SizeInBits, /*AlignInBits=*/0,
-      OffsetInBits, std::nullopt, dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags,
+      OffsetInBits, std::nullopt, dwarf::DW_MSPACE_LLVM_none, std::nullopt,
+      Flags,
       ConstantAsMetadata::get(ConstantInt::get(IntegerType::get(VMContext, 64),
                                                StorageOffsetInBits)),
       Annotations);
@@ -495,7 +500,8 @@ DIDerivedType *DIBuilder::createBitFieldMemberType(
   return DIDerivedType::get(
       VMContext, dwarf::DW_TAG_member, Name, File, LineNumber,
       getNonCompileUnitScope(Scope), Ty, SizeInBits, /*AlignInBits=*/0,
-      OffsetInBits, std::nullopt, dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags,
+      OffsetInBits, std::nullopt, dwarf::DW_MSPACE_LLVM_none, std::nullopt,
+      Flags,
       ConstantAsMetadata::get(ConstantInt::get(IntegerType::get(VMContext, 64),
                                                StorageOffsetInBits)),
       Annotations);
@@ -507,11 +513,10 @@ DIBuilder::createStaticMemberType(DIScope *Scope, StringRef Name, DIFile *File,
                                   DINode::DIFlags Flags, llvm::Constant *Val,
                                   unsigned Tag, uint32_t AlignInBits) {
   Flags |= DINode::FlagStaticMember;
-  return DIDerivedType::get(VMContext, Tag, Name, File, LineNumber,
-                            getNonCompileUnitScope(Scope), Ty, (uint64_t)0,
-                            AlignInBits, (uint64_t)0, std::nullopt,
-                            dwarf::DW_MSPACE_LLVM_none,
-                            std::nullopt, Flags, getConstantOrNull(Val));
+  return DIDerivedType::get(
+      VMContext, Tag, Name, File, LineNumber, getNonCompileUnitScope(Scope), Ty,
+      (uint64_t)0, AlignInBits, (uint64_t)0, std::nullopt,
+      dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags, getConstantOrNull(Val));
 }
 
 DIDerivedType *
@@ -522,7 +527,8 @@ DIBuilder::createObjCIVar(StringRef Name, DIFile *File, unsigned LineNumber,
   return DIDerivedType::get(VMContext, dwarf::DW_TAG_member, Name, File,
                             LineNumber, getNonCompileUnitScope(File), Ty,
                             SizeInBits, AlignInBits, OffsetInBits, std::nullopt,
-                            dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags, PropertyNode);
+                            dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags,
+                            PropertyNode);
 }
 
 DIObjCProperty *
@@ -677,10 +683,10 @@ DIDerivedType *DIBuilder::createSetType(DIScope *Scope, StringRef Name,
                                         DIFile *File, unsigned LineNo,
                                         uint64_t SizeInBits,
                                         uint32_t AlignInBits, DIType *Ty) {
-  auto *R = DIDerivedType::get(VMContext, dwarf::DW_TAG_set_type, Name, File,
-                               LineNo, getNonCompileUnitScope(Scope), Ty,
-                               SizeInBits, AlignInBits, 0, std::nullopt,
-                               dwarf::DW_MSPACE_LLVM_none, std::nullopt, DINode::FlagZero);
+  auto *R = DIDerivedType::get(
+      VMContext, dwarf::DW_TAG_set_type, Name, File, LineNo,
+      getNonCompileUnitScope(Scope), Ty, SizeInBits, AlignInBits, 0,
+      std::nullopt, dwarf::DW_MSPACE_LLVM_none, std::nullopt, DINode::FlagZero);
   trackIfUnresolved(R);
   return R;
 }
@@ -927,8 +933,7 @@ DIGlobalVariable *DIBuilder::createTempGlobalVariableFwdDecl(
 }
 
 static DILocalVariable *createLocalVariable(
-    LLVMContext &VMContext,
-    SmallVectorImpl<TrackingMDNodeRef> &PreservedNodes,
+    LLVMContext &VMContext, SmallVectorImpl<TrackingMDNodeRef> &PreservedNodes,
     DIScope *Context, StringRef Name, unsigned ArgNo, DIFile *File,
     unsigned LineNo, DIType *Ty, bool AlwaysPreserve, DINode::DIFlags Flags,
     dwarf::MemorySpace MS, uint32_t AlignInBits,
@@ -967,9 +972,10 @@ DILocalVariable *DIBuilder::createParameterVariable(
   assert(ArgNo && "Expected non-zero argument number for parameter");
   assert(Scope && isa<DILocalScope>(Scope) &&
          "Unexpected scope for a local variable.");
-  return createLocalVariable(
-      VMContext, getSubprogramNodesTrackingVector(Scope), Scope, Name, ArgNo,
-      File, LineNo, Ty, AlwaysPreserve, Flags, MS, /*AlignInBits=*/0, Annotations);
+  return createLocalVariable(VMContext, getSubprogramNodesTrackingVector(Scope),
+                             Scope, Name, ArgNo, File, LineNo, Ty,
+                             AlwaysPreserve, Flags, MS, /*AlignInBits=*/0,
+                             Annotations);
 }
 
 DILabel *DIBuilder::createLabel(DIScope *Context, StringRef Name, DIFile *File,
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp
index 5ac476641..daf6a28a1 100644
--- a/llvm/lib/IR/DebugInfoMetadata.cpp
+++ b/llvm/lib/IR/DebugInfoMetadata.cpp
@@ -998,7 +998,7 @@ DIDerivedType *DIDerivedType::getImpl(
   assert(isCanonical(Name) && "Expected canonical MDString");
   DEFINE_GETIMPL_LOOKUP(DIDerivedType,
                         (Tag, Name, File, Line, Scope, BaseType, SizeInBits,
-                         AlignInBits, OffsetInBits, DWARFAddressSpace, MS, 
+                         AlignInBits, OffsetInBits, DWARFAddressSpace, MS,
                          PtrAuthData, Flags, ExtraData, Annotations));
   Metadata *Ops[] = {File,         Scope,    Name,      SizeInBits,
                      OffsetInBits, BaseType, ExtraData, Annotations};
@@ -1805,17 +1805,16 @@ public:
                           "DIOpArg type must be same size in bits as argument");
   }
 
-  bool visit(DIOp::Reinterpret Op, Type *ResultType,
-             ArrayRef<StackEntry> Ins) {
+  bool visit(DIOp::Reinterpret Op, Type *ResultType, ArrayRef<StackEntry> Ins) {
     return expectSameSize(ResultType, Ins[0].ResultType,
                           "DIOpReinterpret must not alter bitsize of child");
   }
 
-  bool visit(DIOp::Composite Op, Type *ResultType,
-             ArrayRef<StackEntry> Ins) {
+  bool visit(DIOp::Composite Op, Type *ResultType, ArrayRef<StackEntry> Ins) {
     assert(Op.getCount() == Ins.size());
 
-    std::optional<uint64_t> ResultSizeInBits = getSizeInBits(Op.getResultType());
+    std::optional<uint64_t> ResultSizeInBits =
+        getSizeInBits(Op.getResultType());
     if (!ResultSizeInBits)
       return true;
 
@@ -3042,7 +3041,8 @@ StringRef DIOp::getAsmName(const Variant &V) {
 }
 
 unsigned DIOp::getBitcodeID(const Variant &V) {
-  return std::visit(makeVisitor([](auto &&Op) { return Op.getBitcodeID(); }), V);
+  return std::visit(makeVisitor([](auto &&Op) { return Op.getBitcodeID(); }),
+                    V);
 }
 
 unsigned DIOp::getNumInputs(Variant V) {
diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h
index 57050b4ca..d42845e51 100644
--- a/llvm/lib/IR/LLVMContextImpl.h
+++ b/llvm/lib/IR/LLVMContextImpl.h
@@ -610,19 +610,21 @@ template <> struct MDNodeKeyImpl<DIDerivedType> {
                 Metadata *Scope, Metadata *BaseType, Metadata *SizeInBits,
                 uint32_t AlignInBits, Metadata *OffsetInBits,
                 std::optional<unsigned> DWARFAddressSpace,
-                dwarf::MemorySpace DWARFMemorySpace, std::optional<DIDerivedType::PtrAuthData> PtrAuthData,
+                dwarf::MemorySpace DWARFMemorySpace,
+                std::optional<DIDerivedType::PtrAuthData> PtrAuthData,
                 unsigned Flags, Metadata *ExtraData, Metadata *Annotations)
       : Tag(Tag), Name(Name), File(File), Line(Line), Scope(Scope),
         BaseType(BaseType), SizeInBits(SizeInBits), OffsetInBits(OffsetInBits),
         AlignInBits(AlignInBits), DWARFAddressSpace(DWARFAddressSpace),
-        DWARFMemorySpace(DWARFMemorySpace), PtrAuthData(PtrAuthData), Flags(Flags), ExtraData(ExtraData),
-        Annotations(Annotations) {}
+        DWARFMemorySpace(DWARFMemorySpace), PtrAuthData(PtrAuthData),
+        Flags(Flags), ExtraData(ExtraData), Annotations(Annotations) {}
   MDNodeKeyImpl(const DIDerivedType *N)
       : Tag(N->getTag()), Name(N->getRawName()), File(N->getRawFile()),
         Line(N->getLine()), Scope(N->getRawScope()),
         BaseType(N->getRawBaseType()), SizeInBits(N->getRawSizeInBits()),
         OffsetInBits(N->getRawOffsetInBits()), AlignInBits(N->getAlignInBits()),
-        DWARFAddressSpace(N->getDWARFAddressSpace()), DWARFMemorySpace(N->getDWARFMemorySpace()),
+        DWARFAddressSpace(N->getDWARFAddressSpace()),
+        DWARFMemorySpace(N->getDWARFMemorySpace()),
         PtrAuthData(N->getPtrAuthData()), Flags(N->getFlags()),
         ExtraData(N->getRawExtraData()), Annotations(N->getRawAnnotations()) {}
 
@@ -634,8 +636,9 @@ template <> struct MDNodeKeyImpl<DIDerivedType> {
            AlignInBits == RHS->getAlignInBits() &&
            OffsetInBits == RHS->getRawOffsetInBits() &&
            DWARFAddressSpace == RHS->getDWARFAddressSpace() &&
-           DWARFMemorySpace == RHS->getDWARFMemorySpace() && PtrAuthData == RHS->getPtrAuthData() &&
-           Flags == RHS->getFlags() && ExtraData == RHS->getRawExtraData() &&
+           DWARFMemorySpace == RHS->getDWARFMemorySpace() &&
+           PtrAuthData == RHS->getPtrAuthData() && Flags == RHS->getFlags() &&
+           ExtraData == RHS->getRawExtraData() &&
            Annotations == RHS->getRawAnnotations();
   }
 
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp b/llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp
index 940c1e3c2..4eded3e0a 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp
@@ -347,7 +347,7 @@ void AMDGPUAsmPrinter::emitInstruction(const MachineInstr *MI) {
     MachineBasicBlock::const_instr_iterator I = ++MI->getIterator();
     while (I != MBB->instr_end() && I->isInsideBundle()) {
       bool HandledByEmitDbgComment = I->isDebugInstr() && emitDebugComment(&*I);
-      if(!HandledByEmitDbgComment)
+      if (!HandledByEmitDbgComment)
         emitInstruction(&*I);
       ++I;
     }
diff --git a/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp b/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
index 2b1cfeb15..c844fa8fe 100644
--- a/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
@@ -491,9 +491,8 @@ public:
       : MI(MI), MBB(MBB), MF(*MBB.getParent()),
         ST(MF.getSubtarget<GCNSubtarget>()), MFI(MF.getFrameInfo()),
         FuncInfo(MF.getInfo<SIMachineFunctionInfo>()), TII(TII), TRI(TRI),
-        MCRI(MF.getContext().getRegisterInfo()),
-        TFI(ST.getFrameLowering()), SuperReg(Reg), SI(SI), LiveUnits(LiveUnits),
-        DL(DL), FrameReg(FrameReg),
+        MCRI(MF.getContext().getRegisterInfo()), TFI(ST.getFrameLowering()),
+        SuperReg(Reg), SI(SI), LiveUnits(LiveUnits), DL(DL), FrameReg(FrameReg),
         IsFramePtrPrologSpill(IsFramePtrPrologSpill) {
     const TargetRegisterClass *RC = TRI.getPhysRegBaseClass(SuperReg);
     SplitParts = TRI.getRegSplitParts(RC, EltSize);
@@ -707,8 +706,8 @@ Register SIFrameLowering::getEntryFunctionReservedScratchRsrcReg(
 
   Register ScratchRsrcReg = MFI->getScratchRSrcReg();
 
-  if (!ScratchRsrcReg || (!MRI.isPhysRegUsed(ScratchRsrcReg) &&
-                          allStackObjectsAreDead(MF)))
+  if (!ScratchRsrcReg ||
+      (!MRI.isPhysRegUsed(ScratchRsrcReg) && allStackObjectsAreDead(MF)))
     return Register();
 
   if (ST.hasSGPRInitBug() ||
@@ -1933,8 +1932,7 @@ void SIFrameLowering::determinePrologEpilogSGPRSaves(
   //
   // FIXME: Is this really hasReservedCallFrame?
   const bool WillHaveFP =
-      FrameInfo.hasCalls() &&
-      (SavedVGPRs.any() || !allStackObjectsAreDead(MF));
+      FrameInfo.hasCalls() && (SavedVGPRs.any() || !allStackObjectsAreDead(MF));
 
   if (WillHaveFP || hasFP(MF)) {
     Register FramePtrReg = MFI->getFrameOffsetReg();
diff --git a/llvm/lib/Target/AMDGPU/SIFrameLowering.h b/llvm/lib/Target/AMDGPU/SIFrameLowering.h
index a64164f9e..526404eb8 100644
--- a/llvm/lib/Target/AMDGPU/SIFrameLowering.h
+++ b/llvm/lib/Target/AMDGPU/SIFrameLowering.h
@@ -138,8 +138,10 @@ public:
   /// a VGPR and build a MachineInstr around it.
   MachineInstr *buildCFIForSGPRToVGPRSpill(MachineBasicBlock &MBB,
                                            MachineBasicBlock::iterator MBBI,
-                                           const DebugLoc &DL, const Register SGPR,
-                                           const Register VGPR, const int Lane) const;
+                                           const DebugLoc &DL,
+                                           const Register SGPR,
+                                           const Register VGPR,
+                                           const int Lane) const;
   /// Create a CFI index describing a spill of an SGPR to multiple lanes of
   /// VGPRs and build a MachineInstr around it.
   MachineInstr *buildCFIForSGPRToVGPRSpill(
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
index d2eddd20e..b5bee3dc9 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -1622,11 +1622,14 @@ static unsigned getVGPRSpillSaveOpcode(unsigned Size, bool NeedsCFI) {
 static unsigned getAVSpillSaveOpcode(unsigned Size, bool NeedsCFI) {
   switch (Size) {
   case 4:
-    return NeedsCFI ? AMDGPU::SI_SPILL_AV32_CFI_SAVE : AMDGPU::SI_SPILL_AV32_SAVE;
+    return NeedsCFI ? AMDGPU::SI_SPILL_AV32_CFI_SAVE
+                    : AMDGPU::SI_SPILL_AV32_SAVE;
   case 8:
-    return NeedsCFI ? AMDGPU::SI_SPILL_AV64_CFI_SAVE : AMDGPU::SI_SPILL_AV64_SAVE;
+    return NeedsCFI ? AMDGPU::SI_SPILL_AV64_CFI_SAVE
+                    : AMDGPU::SI_SPILL_AV64_SAVE;
   case 12:
-    return NeedsCFI ? AMDGPU::SI_SPILL_AV96_CFI_SAVE : AMDGPU::SI_SPILL_AV96_SAVE;
+    return NeedsCFI ? AMDGPU::SI_SPILL_AV96_CFI_SAVE
+                    : AMDGPU::SI_SPILL_AV96_SAVE;
   case 16:
     return NeedsCFI ? AMDGPU::SI_SPILL_AV128_CFI_SAVE
                     : AMDGPU::SI_SPILL_AV128_SAVE;
@@ -1692,8 +1695,8 @@ unsigned SIInstrInfo::getVectorRegSpillSaveOpcode(
 void SIInstrInfo::storeRegToStackSlotImpl(
     MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register SrcReg,
     bool isKill, int FrameIndex, const TargetRegisterClass *RC,
-    const TargetRegisterInfo *TRI, Register VReg,
-    MachineInstr::MIFlag Flags, bool NeedsCFI) const {
+    const TargetRegisterInfo *TRI, Register VReg, MachineInstr::MIFlag Flags,
+    bool NeedsCFI) const {
   MachineFunction *MF = MBB.getParent();
   SIMachineFunctionInfo *MFI = MF->getInfo<SIMachineFunctionInfo>();
   MachineFrameInfo &FrameInfo = MF->getFrameInfo();
@@ -1753,7 +1756,7 @@ void SIInstrInfo::storeRegToStackSlot(
     const TargetRegisterInfo *TRI, Register VReg,
     MachineInstr::MIFlag Flags) const {
   storeRegToStackSlotImpl(MBB, MI, SrcReg, isKill, FrameIndex, RC, TRI, VReg,
-                         Flags, false);
+                          Flags, false);
 }
 
 void SIInstrInfo::storeRegToStackSlotCFI(MachineBasicBlock &MBB,
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.h b/llvm/lib/Target/AMDGPU/SIInstrInfo.h
index f7953d25c..9c0a80bbc 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.h
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.h
@@ -307,7 +307,7 @@ public:
                               bool isKill, int FrameIndex,
                               const TargetRegisterClass *RC,
                               const TargetRegisterInfo *TRI) const;
-                              
+
   bool getConstValDefinedInReg(const MachineInstr &MI, const Register Reg,
                                int64_t &ImmVal) const override;
 
diff --git a/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp b/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
index 7700b2b28..57ff52334 100644
--- a/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
+++ b/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
@@ -102,8 +102,7 @@ char &llvm::SILowerSGPRSpillsLegacyID = SILowerSGPRSpillsLegacy::ID;
 
 /// Insert spill code for the callee-saved registers used in the function.
 static void insertCSRSaves(const GCNSubtarget &ST, MachineBasicBlock &SaveBlock,
-                           ArrayRef<CalleeSavedInfo> CSI,
-                           SlotIndexes *Indexes,
+                           ArrayRef<CalleeSavedInfo> CSI, SlotIndexes *Indexes,
                            LiveIntervals *LIS) {
   const TargetFrameLowering *TFI = ST.getFrameLowering();
   const TargetRegisterInfo *TRI = ST.getRegisterInfo();
diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
index 4be92bf50..8ca34d10d 100644
--- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
+++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
@@ -840,8 +840,7 @@ public:
 
   /// If \p ResetSGPRSpillStackIDs is true, reset the stack ID from sgpr-spill
   /// to the default stack.
-  bool removeDeadFrameIndices(MachineFunction &MF,
-                              bool ResetSGPRSpillStackIDs);
+  bool removeDeadFrameIndices(MachineFunction &MF, bool ResetSGPRSpillStackIDs);
 
   int getScavengeFI(MachineFrameInfo &MFI, const SIRegisterInfo &TRI);
   std::optional<int> getOptionalScavengeFI() const { return ScavengeFI; }
diff --git a/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp b/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
index f1926a0df..c42f0c48d 100644
--- a/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
@@ -2628,7 +2628,7 @@ bool SIRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI,
 
       auto *MBB = MI->getParent();
       bool IsWWMRegSpill = TII->isWWMRegSpillOpcode(MI->getOpcode());
-      if (IsWWMRegSpill){
+      if (IsWWMRegSpill) {
         TII->insertScratchExecCopy(*MF, *MBB, MI, DL, MFI->getSGPRForEXECCopy(),
                                    RS->isRegUsed(AMDGPU::SCC));
       }
@@ -2713,7 +2713,7 @@ bool SIRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI,
 
       auto *MBB = MI->getParent();
       bool IsWWMRegSpill = TII->isWWMRegSpillOpcode(MI->getOpcode());
-      if (IsWWMRegSpill){
+      if (IsWWMRegSpill) {
         TII->insertScratchExecCopy(*MF, *MBB, MI, DL, MFI->getSGPRForEXECCopy(),
                                    RS->isRegUsed(AMDGPU::SCC));
       }
diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp
index 491685f9a..728d20e52 100644
--- a/llvm/lib/Transforms/Scalar/SROA.cpp
+++ b/llvm/lib/Transforms/Scalar/SROA.cpp
@@ -5694,7 +5694,8 @@ bool SROA::splitAlloca(AllocaInst &AI, AllocaSlices &AS) {
       ArrayRef<uint64_t> PoisonElems = NoOffsetDIOpExpr->getElements();
       PostOffsetOps.append(PoisonElems.begin(), PoisonElems.end());
     } else if (!getAddressExpression(DbgVariable)
-             ->extractLeadingOffset(CurrentExprOffsetInBytes, PostOffsetOps))
+                    ->extractLeadingOffset(CurrentExprOffsetInBytes,
+                                           PostOffsetOps))
       return; // Couldn't interpret this DIExpression - drop the var.
 
     // Offset defined by a DW_OP_LLVM_extract_bits_[sz]ext.
diff --git a/llvm/lib/Transforms/Utils/CodeExtractor.cpp b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
index 40de78a1d..a7c524603 100644
--- a/llvm/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
@@ -1324,8 +1324,7 @@ static void fixupDebugInfoPostExtraction(Function &OldFunc, Function &NewFunc,
       NewVar = DIB.createAutoVariable(
           NewScope, OldVar->getName(), OldVar->getFile(), OldVar->getLine(),
           OldVar->getType(), /*AlwaysPreserve=*/false, DINode::FlagZero,
-          OldVar->getDWARFMemorySpace(),
-          OldVar->getAlignInBits());
+          OldVar->getDWARFMemorySpace(), OldVar->getAlignInBits());
     }
     return cast<DILocalVariable>(NewVar);
   };
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 4464a6c06..671ab81db 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -2171,7 +2171,8 @@ getNewSalvageOpsForGEP(GetElementPtrInst *GEP, const DataLayout &DL,
                        SmallVectorImpl<Value *> &AdditionalValues) {
   LLVMContext &Ctx = GEP->getContext();
   Type *PointerTy = GEP->getPointerOperand()->getType();
-  auto *IntPtrTy = IntegerType::get(Ctx, DL.getPointerTypeSizeInBits(PointerTy));
+  auto *IntPtrTy =
+      IntegerType::get(Ctx, DL.getPointerTypeSizeInBits(PointerTy));
   unsigned BitWidth = DL.getIndexSizeInBits(GEP->getPointerAddressSpace());
 
   // Rewrite a GEP into a DIExpression.
@@ -2245,7 +2246,8 @@ static Value *salvageNewDebugInfo(Instruction &I, uint64_t CurrentLocOps,
   if (auto *BI = dyn_cast<BinaryOperator>(&I))
     return getNewSalvageOpsForBinOp(BI, CurrentLocOps, Ops, AdditionalValues);
   if (auto *GEP = dyn_cast<GetElementPtrInst>(&I))
-    return getNewSalvageOpsForGEP(GEP, DL, CurrentLocOps, Ops, AdditionalValues);
+    return getNewSalvageOpsForGEP(GEP, DL, CurrentLocOps, Ops,
+                                  AdditionalValues);
 
   return nullptr;
 }
diff --git a/llvm/unittests/IR/DebugInfoTest.cpp b/llvm/unittests/IR/DebugInfoTest.cpp
index 3d9faf591..536f27bf3 100644
--- a/llvm/unittests/IR/DebugInfoTest.cpp
+++ b/llvm/unittests/IR/DebugInfoTest.cpp
@@ -1425,8 +1425,9 @@ TEST(DIBuilder, DynamicOffsetAndSize) {
       DINode::FlagZero, DISubprogram::SPFlagZero, nullptr);
   DIFile *F = DIB.createFile("main.adb", "/");
 
-  DIVariable *Len = DIB.createAutoVariable(Scope, "length", F, 0, nullptr,
-                                           false, DINode::FlagZero, dwarf::DW_MSPACE_LLVM_none, 0);
+  DIVariable *Len =
+      DIB.createAutoVariable(Scope, "length", F, 0, nullptr, false,
+                             DINode::FlagZero, dwarf::DW_MSPACE_LLVM_none, 0);
 
   DICompositeType *Struct = DIB.createStructType(
       Scope, "some_record", F, 18, Len, 8, DINode::FlagZero, nullptr, {});
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp
index 97e1f4427..caf4d9dc9 100644
--- a/llvm/unittests/IR/MetadataTest.cpp
+++ b/llvm/unittests/IR/MetadataTest.cpp
@@ -470,7 +470,8 @@ TEST_F(MDNodeTest, PrintTree) {
     auto *StructTy = cast<DICompositeType>(getCompositeType());
     DIType *PointerTy = DIDerivedType::getDistinct(
         Context, dwarf::DW_TAG_pointer_type, "", nullptr, 0, nullptr, StructTy,
-        1, 2, 0, std::nullopt, dwarf::DW_MSPACE_LLVM_none, {}, DINode::FlagZero);
+        1, 2, 0, std::nullopt, dwarf::DW_MSPACE_LLVM_none, {},
+        DINode::FlagZero);
     StructTy->replaceElements(MDTuple::get(Context, PointerTy));
 
     auto *Var = DILocalVariable::get(Context, Scope, "foo", File,
@@ -2321,9 +2322,9 @@ TEST_F(DIDerivedTypeTest, get) {
       DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type, "something", File,
                          1, Scope, BaseType, 2, 3, 4, DWARFAddressSpace,
                          DWARFMemorySpace, std::nullopt, Flags5, ExtraData);
-  auto *N1 = DIDerivedType::get(Context, dwarf::DW_TAG_LLVM_ptrauth_type, "",
-                                File, 1, Scope, N, 2, 3, 4, DWARFAddressSpace,
-                                DWARFMemorySpace, PtrAuthData, Flags5, ExtraData);
+  auto *N1 = DIDerivedType::get(
+      Context, dwarf::DW_TAG_LLVM_ptrauth_type, "", File, 1, Scope, N, 2, 3, 4,
+      DWARFAddressSpace, DWARFMemorySpace, PtrAuthData, Flags5, ExtraData);
 
   EXPECT_EQ(dwarf::DW_TAG_pointer_type, N->getTag());
   EXPECT_EQ("something", N->getName());
@@ -2352,8 +2353,8 @@ TEST_F(DIDerivedTypeTest, get) {
                                   std::nullopt, Flags5, ExtraData));
   EXPECT_NE(N, DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type, "else",
                                   File, 1, Scope, BaseType, 2, 3, 4,
-                                  DWARFAddressSpace, DWARFMemorySpace, std::nullopt, Flags5,
-                                  ExtraData));
+                                  DWARFAddressSpace, DWARFMemorySpace,
+                                  std::nullopt, Flags5, ExtraData));
   EXPECT_NE(N, DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type,
                                   "something", getFile(), 1, Scope, BaseType, 2,
                                   3, 4, DWARFAddressSpace, DWARFMemorySpace,
@@ -2362,10 +2363,10 @@ TEST_F(DIDerivedTypeTest, get) {
                                   "something", File, 2, Scope, BaseType, 2, 3,
                                   4, DWARFAddressSpace, DWARFMemorySpace,
                                   std::nullopt, Flags5, ExtraData));
-  EXPECT_NE(N, DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type,
-                                  "something", File, 1, getSubprogram(),
-                                  BaseType, 2, 3, 4, DWARFAddressSpace,
-                                  DWARFMemorySpace, std::nullopt, Flags5, ExtraData));
+  EXPECT_NE(N, DIDerivedType::get(
+                   Context, dwarf::DW_TAG_pointer_type, "something", File, 1,
+                   getSubprogram(), BaseType, 2, 3, 4, DWARFAddressSpace,
+                   DWARFMemorySpace, std::nullopt, Flags5, ExtraData));
   EXPECT_NE(N, DIDerivedType::get(
                    Context, dwarf::DW_TAG_pointer_type, "something", File, 1,
                    Scope, getBasicType("basic2"), 2, 3, 4, DWARFAddressSpace,
@@ -2394,10 +2395,11 @@ TEST_F(DIDerivedTypeTest, get) {
                                   "something", File, 1, Scope, BaseType, 2, 3,
                                   4, DWARFAddressSpace, DWARFMemorySpace,
                                   std::nullopt, Flags5, getTuple()));
-  EXPECT_NE(N, DIDerivedType::get(
-                   Context, dwarf::DW_TAG_pointer_type, "something", File, 1,
-                   Scope, BaseType, 2, 3, 4, DWARFAddressSpace,
-                   dwarf::DW_MSPACE_LLVM_global, std::nullopt, Flags5, ExtraData));
+  EXPECT_NE(N,
+            DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type, "something",
+                               File, 1, Scope, BaseType, 2, 3, 4,
+                               DWARFAddressSpace, dwarf::DW_MSPACE_LLVM_global,
+                               std::nullopt, Flags5, ExtraData));
 
   TempDIDerivedType Temp = N->clone();
   EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));
@@ -2412,10 +2414,10 @@ TEST_F(DIDerivedTypeTest, getWithLargeValues) {
   MDTuple *ExtraData = getTuple();
   DINode::DIFlags Flags = static_cast<DINode::DIFlags>(5);
 
-  auto *N = DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type, "something",
-                               File, 1, Scope, BaseType, UINT64_MAX,
-                               UINT32_MAX - 1, UINT64_MAX - 2, UINT32_MAX - 3,
-                               dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags, ExtraData);
+  auto *N = DIDerivedType::get(
+      Context, dwarf::DW_TAG_pointer_type, "something", File, 1, Scope,
+      BaseType, UINT64_MAX, UINT32_MAX - 1, UINT64_MAX - 2, UINT32_MAX - 3,
+      dwarf::DW_MSPACE_LLVM_none, std::nullopt, Flags, ExtraData);
   EXPECT_EQ(UINT64_MAX, N->getSizeInBits());
   EXPECT_EQ(UINT32_MAX - 1, N->getAlignInBits());
   EXPECT_EQ(UINT64_MAX - 2, N->getOffsetInBits());
@@ -2424,8 +2426,9 @@ TEST_F(DIDerivedTypeTest, getWithLargeValues) {
   auto *N1 = DIDerivedType::get(
       Context, dwarf::DW_TAG_LLVM_ptrauth_type, "", File, 1, Scope, N,
       UINT64_MAX, UINT32_MAX - 1, UINT64_MAX - 2, UINT32_MAX - 3,
-      dwarf::DW_MSPACE_LLVM_none, DIDerivedType::PtrAuthData(7, true, 0xffff, true, false),
-      Flags, ExtraData);
+      dwarf::DW_MSPACE_LLVM_none,
+      DIDerivedType::PtrAuthData(7, true, 0xffff, true, false), Flags,
+      ExtraData);
   EXPECT_EQ(7U, N1->getPtrAuthData()->key());
   EXPECT_EQ(true, N1->getPtrAuthData()->isAddressDiscriminated());
   EXPECT_EQ(0xffffU, N1->getPtrAuthData()->extraDiscriminator());
@@ -4536,8 +4539,7 @@ TEST_F(DIExpressionTest, DIOpisEqualExpression) {
       DIExpression::isEqualExpression(EmptyOld, false, EmptyNew, false));
   EXPECT_FALSE(
       DIExpression::isEqualExpression(EmptyNew, true, EmptyNew, false));
-  EXPECT_TRUE(
-      DIExpression::isEqualExpression(EmptyNew, true, EmptyNew, true));
+  EXPECT_TRUE(DIExpression::isEqualExpression(EmptyNew, true, EmptyNew, true));
 }
 
 TEST_F(DIExpressionTest, poisonedFragments) {
diff --git a/mlir/lib/Target/LLVMIR/DebugTranslation.cpp b/mlir/lib/Target/LLVMIR/DebugTranslation.cpp
index 060f76f13..3c50a750f 100644
--- a/mlir/lib/Target/LLVMIR/DebugTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/DebugTranslation.cpp
@@ -202,7 +202,8 @@ llvm::DIDerivedType *DebugTranslation::translateImpl(DIDerivedTypeAttr attr) {
       /*File=*/nullptr, /*Line=*/0,
       /*Scope=*/nullptr, translate(attr.getBaseType()), attr.getSizeInBits(),
       attr.getAlignInBits(), attr.getOffsetInBits(),
-      attr.getDwarfAddressSpace(), llvm::dwarf::DW_MSPACE_LLVM_none, /*PtrAuthData=*/std::nullopt,
+      attr.getDwarfAddressSpace(), llvm::dwarf::DW_MSPACE_LLVM_none,
+      /*PtrAuthData=*/std::nullopt,
       /*Flags=*/llvm::DINode::FlagZero, translate(attr.getExtraData()));
 }
 
@@ -255,8 +256,7 @@ DebugTranslation::translateImpl(DILocalVariableAttr attr) {
       llvmCtx, translate(attr.getScope()), getMDStringOrNull(attr.getName()),
       translate(attr.getFile()), attr.getLine(), translate(attr.getType()),
       attr.getArg(), static_cast<llvm::DINode::DIFlags>(attr.getFlags()),
-      llvm::dwarf::DW_MSPACE_LLVM_none,
-      attr.getAlignInBits(),
+      llvm::dwarf::DW_MSPACE_LLVM_none, attr.getAlignInBits(),
       /*Annotations=*/nullptr);
 }
 

@github-actions
Copy link

⚠️ undef deprecator found issues in your code. ⚠️

You can test this locally with the following command:
git diff -U0 --pickaxe-regex -S '([^a-zA-Z0-9#_-]undef([^a-zA-Z0-9_-]|$)|UndefValue::get)' 'HEAD~1' HEAD clang/test/CodeGen/debug-info-block-expr-heterogeneous-dwarf.c clang/test/CodeGen/debug-info-global-constant-heterogeneous-dwarf.c clang/test/CodeGenCXX/heterogeneous-debug-info-structured-binding-bitfield.cpp clang/test/CodeGenCXX/heterogeneous-debug-info-structured-binding.cpp llvm/test/Assembler/DIExpressionNew.ll llvm/test/Assembler/DIExpressionNewDebugRecords.ll llvm/test/Bitcode/DILocalVariable-address-space.ll llvm/test/Bitcode/bcanalyzer-metadata-diexpression.ll llvm/test/CodeGen/AMDGPU/amdgpu-spill-cfi-saved-regs.ll llvm/test/CodeGen/AMDGPU/debug-frame.ll llvm/test/CodeGen/AMDGPU/debug-type-mutate.ll llvm/test/DebugInfo/AMDGPU/dwarfdump-address-spaces.ll llvm/test/DebugInfo/AMDGPU/heterogeneous-dwarf-diop-diexpression-address-spaces.ll llvm/test/DebugInfo/AMDGPU/heterogeneous-dwarf-diop-diexpression-args.ll llvm/test/DebugInfo/AMDGPU/heterogeneous-dwarf-instruction-bundle.ll llvm/test/DebugInfo/AMDGPU/heterogeneous-dwarf-pointer-parameters-isel.ll llvm/test/DebugInfo/AMDGPU/reg-sequence-salvage.ll llvm/test/DebugInfo/heterogeneous-diop-in-diexpression-conversion.ll llvm/test/DebugInfo/heterogeneous-diop-in-diexpression.ll llvm/test/DebugInfo/verify-diop-based-diexpression.ll llvm/test/Transforms/InferAddressSpaces/AMDGPU/diop-diexpression.ll llvm/test/Transforms/InstCombine/heterogeneous-poison-dbg-rauw.ll llvm/test/Transforms/InstCombine/heterogeneous-poison-lower-dbg-declare.ll llvm/test/Transforms/SROA/heterogeneous-poison.ll llvm/unittests/rocm-gdb-symbols/AsmParserTest.cpp llvm/unittests/rocm-gdb-symbols/AsmWriterTest.cpp clang/include/clang/Basic/CodeGenOptions.h clang/lib/CodeGen/CGDebugInfo.cpp clang/lib/CodeGen/CGDebugInfo.h clang/lib/Driver/ToolChains/Clang.cpp llvm/include/llvm-c/DebugInfo.h llvm/include/llvm/ADT/Hashing.h llvm/include/llvm/AsmParser/LLParser.h llvm/include/llvm/AsmParser/LLToken.h llvm/include/llvm/BinaryFormat/Dwarf.h llvm/include/llvm/CodeGen/AsmPrinter.h llvm/include/llvm/CodeGen/MachineFunction.h llvm/include/llvm/CodeGen/TargetFrameLowering.h llvm/include/llvm/CodeGen/TargetRegisterInfo.h llvm/include/llvm/DebugInfo/DIContext.h llvm/include/llvm/IR/DIBuilder.h llvm/include/llvm/IR/DebugInfoMetadata.h llvm/include/llvm/MC/MCAsmInfo.h llvm/include/llvm/MC/MCDwarf.h llvm/include/llvm/MC/MCStreamer.h llvm/include/llvm/Target/TargetMachine.h llvm/include/llvm/Transforms/Utils/Local.h llvm/lib/AsmParser/LLLexer.cpp llvm/lib/AsmParser/LLParser.cpp llvm/lib/BinaryFormat/Dwarf.cpp llvm/lib/Bitcode/Reader/MetadataLoader.cpp llvm/lib/Bitcode/Writer/BitcodeWriter.cpp llvm/lib/Bitcode/Writer/ValueEnumerator.cpp llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h llvm/lib/CodeGen/AsmPrinter/DebugLocStream.cpp llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h llvm/lib/CodeGen/CFIInstrInserter.cpp llvm/lib/CodeGen/CodeGenPrepare.cpp llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp llvm/lib/CodeGen/MIRParser/MILexer.cpp llvm/lib/CodeGen/MIRParser/MILexer.h llvm/lib/CodeGen/MIRParser/MIParser.cpp llvm/lib/CodeGen/MachineFunction.cpp llvm/lib/CodeGen/MachineInstr.cpp llvm/lib/CodeGen/MachineOperand.cpp llvm/lib/CodeGen/PrologEpilogInserter.cpp llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp llvm/lib/DWARFCFIChecker/DWARFCFIState.cpp llvm/lib/DebugInfo/DWARF/DWARFDie.cpp llvm/lib/DebugInfo/DWARF/DWARFExpressionPrinter.cpp llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp llvm/lib/IR/AsmWriter.cpp llvm/lib/IR/DIBuilder.cpp llvm/lib/IR/DIExpressionOptimizer.cpp llvm/lib/IR/DebugInfo.cpp llvm/lib/IR/DebugInfoMetadata.cpp llvm/lib/IR/LLVMContextImpl.h llvm/lib/IR/TypeFinder.cpp llvm/lib/IR/Verifier.cpp llvm/lib/MC/MCAsmStreamer.cpp llvm/lib/MC/MCDwarf.cpp llvm/lib/MC/MCParser/AsmParser.cpp llvm/lib/MC/MCParser/MasmParser.cpp llvm/lib/MC/MCStreamer.cpp llvm/lib/Target/AMDGPU/AMDGPUFrameLowering.cpp llvm/lib/Target/AMDGPU/AMDGPUFrameLowering.h llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp llvm/lib/Target/AMDGPU/SIFrameLowering.cpp llvm/lib/Target/AMDGPU/SIFrameLowering.h llvm/lib/Target/AMDGPU/SIInsertHardClauses.cpp llvm/lib/Target/AMDGPU/SIInstrInfo.cpp llvm/lib/Target/AMDGPU/SIInstrInfo.h llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp llvm/lib/Target/AMDGPU/SIRegisterInfo.h llvm/lib/Transforms/Coroutines/CoroFrame.cpp llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp llvm/lib/Transforms/Scalar/SROA.cpp llvm/lib/Transforms/Utils/CodeExtractor.cpp llvm/lib/Transforms/Utils/Debugify.cpp llvm/lib/Transforms/Utils/Local.cpp llvm/test/Assembler/debug-info.ll llvm/test/Bindings/llvm-c/debug_info_new_format.ll llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-extract-used-by-dbg.ll llvm/test/CodeGen/AArch64/dwarf-eh-prepare-dbg.ll llvm/test/CodeGen/AMDGPU/GlobalISel/assert-align.ll llvm/test/CodeGen/AMDGPU/GlobalISel/call-outgoing-stack-args.ll llvm/test/CodeGen/AMDGPU/GlobalISel/dynamic-alloca-uniform.ll llvm/test/CodeGen/AMDGPU/GlobalISel/localizer.ll llvm/test/CodeGen/AMDGPU/GlobalISel/memory-legalizer-atomic-fence.ll llvm/test/CodeGen/AMDGPU/GlobalISel/non-entry-alloca.ll llvm/test/CodeGen/AMDGPU/a-v-flat-atomicrmw.ll llvm/test/CodeGen/AMDGPU/a-v-global-atomicrmw.ll llvm/test/CodeGen/AMDGPU/abi-attribute-hints-undefined-behavior.ll llvm/test/CodeGen/AMDGPU/agpr-copy-no-free-registers.ll llvm/test/CodeGen/AMDGPU/amdgcn-call-whole-wave.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.256bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.320bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.512bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.576bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.640bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.704bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.768bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.832bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.896bit.ll llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.960bit.ll llvm/test/CodeGen/AMDGPU/amdgpu-cs-chain-cc.ll llvm/test/CodeGen/AMDGPU/amdgpu-cs-chain-preserve-cc.ll llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-pow-codegen.ll llvm/test/CodeGen/AMDGPU/attributor-flatscratchinit-undefined-behavior2.ll llvm/test/CodeGen/AMDGPU/bf16.ll llvm/test/CodeGen/AMDGPU/branch-folding-implicit-def-subreg.ll llvm/test/CodeGen/AMDGPU/branch-relax-spill.ll llvm/test/CodeGen/AMDGPU/call-args-inreg.ll llvm/test/CodeGen/AMDGPU/call-argument-types.ll llvm/test/CodeGen/AMDGPU/call-graph-register-usage.ll llvm/test/CodeGen/AMDGPU/call-preserved-registers.ll llvm/test/CodeGen/AMDGPU/callee-frame-setup.ll llvm/test/CodeGen/AMDGPU/callee-special-input-vgprs-packed.ll llvm/test/CodeGen/AMDGPU/callee-special-input-vgprs.ll llvm/test/CodeGen/AMDGPU/cross-block-use-is-not-abi-copy.ll llvm/test/CodeGen/AMDGPU/dbg-info-inline-at.ll llvm/test/CodeGen/AMDGPU/debug-value.ll llvm/test/CodeGen/AMDGPU/debug-value2.ll llvm/test/CodeGen/AMDGPU/dwarf-multi-register-use-crash.ll llvm/test/CodeGen/AMDGPU/dynamic-vgpr-reserve-stack-for-cwsr.ll llvm/test/CodeGen/AMDGPU/dynamic_stackalloc.ll llvm/test/CodeGen/AMDGPU/fix-frame-reg-in-custom-csr-spills.ll llvm/test/CodeGen/AMDGPU/frame-setup-without-sgpr-to-vgpr-spills.ll llvm/test/CodeGen/AMDGPU/function-args-inreg.ll llvm/test/CodeGen/AMDGPU/gfx-call-non-gfx-func.ll llvm/test/CodeGen/AMDGPU/gfx-callable-argument-types.ll llvm/test/CodeGen/AMDGPU/gfx-callable-preserved-registers.ll llvm/test/CodeGen/AMDGPU/gfx-callable-return-types.ll llvm/test/CodeGen/AMDGPU/global-alias.ll llvm/test/CodeGen/AMDGPU/identical-subrange-spill-infloop.ll llvm/test/CodeGen/AMDGPU/indirect-call.ll llvm/test/CodeGen/AMDGPU/insert-delay-alu-bug.ll llvm/test/CodeGen/AMDGPU/insert-waitcnts-crash.ll llvm/test/CodeGen/AMDGPU/llvm.amdgcn.readfirstlane.ll llvm/test/CodeGen/AMDGPU/llvm.dbg.value.ll llvm/test/CodeGen/AMDGPU/llvm.maximum.f64.ll llvm/test/CodeGen/AMDGPU/llvm.minimum.f64.ll llvm/test/CodeGen/AMDGPU/local-stack-alloc-block-sp-reference.ll llvm/test/CodeGen/AMDGPU/materialize-frame-index-sgpr.gfx10.ll llvm/test/CodeGen/AMDGPU/materialize-frame-index-sgpr.ll llvm/test/CodeGen/AMDGPU/maximumnum.bf16.ll llvm/test/CodeGen/AMDGPU/memintrinsic-unroll.ll llvm/test/CodeGen/AMDGPU/minimumnum.bf16.ll llvm/test/CodeGen/AMDGPU/mul24-pass-ordering.ll llvm/test/CodeGen/AMDGPU/need-fp-from-vgpr-spills.ll llvm/test/CodeGen/AMDGPU/nested-calls.ll llvm/test/CodeGen/AMDGPU/no-source-locations-in-prologue.ll llvm/test/CodeGen/AMDGPU/non-entry-alloca.ll llvm/test/CodeGen/AMDGPU/partial-regcopy-and-spill-missed-at-regalloc.ll llvm/test/CodeGen/AMDGPU/post-ra-soft-clause-dbg-info.ll llvm/test/CodeGen/AMDGPU/preserve-wwm-copy-dst-reg.ll llvm/test/CodeGen/AMDGPU/prologue-epilogue-markers.ll llvm/test/CodeGen/AMDGPU/ptr-arg-dbg-value.ll llvm/test/CodeGen/AMDGPU/s-getpc-b64-remat.ll llvm/test/CodeGen/AMDGPU/sgpr-spills-split-regalloc.ll llvm/test/CodeGen/AMDGPU/shufflevector.v2i64.v8i64.ll llvm/test/CodeGen/AMDGPU/si-optimize-vgpr-live-range-dbg-instr.ll llvm/test/CodeGen/AMDGPU/sibling-call.ll llvm/test/CodeGen/AMDGPU/spill-vgpr-block.ll llvm/test/CodeGen/AMDGPU/spill_more_than_wavesize_csr_sgprs.ll llvm/test/CodeGen/AMDGPU/split-arg-dbg-value.ll llvm/test/CodeGen/AMDGPU/stack-realign.ll llvm/test/CodeGen/AMDGPU/stacksave_stackrestore.ll llvm/test/CodeGen/AMDGPU/strictfp_f16_abi_promote.ll llvm/test/CodeGen/AMDGPU/swdev504645-global-fold.ll llvm/test/CodeGen/AMDGPU/tail-call-inreg-arguments.error.ll llvm/test/CodeGen/AMDGPU/transform-block-with-return-to-epilog.ll llvm/test/CodeGen/AMDGPU/tuple-allocation-failure.ll llvm/test/CodeGen/AMDGPU/unfold-masked-merge-scalar-variablemask.ll llvm/test/CodeGen/AMDGPU/unspill-vgpr-after-rewrite-vgpr-mfma.ll llvm/test/CodeGen/AMDGPU/unstructured-cfg-def-use-issue.ll llvm/test/CodeGen/AMDGPU/vgpr-tuple-allocation.ll llvm/test/CodeGen/AMDGPU/wave32.ll llvm/test/CodeGen/AMDGPU/whole-wave-functions.ll llvm/test/CodeGen/AMDGPU/whole-wave-register-copy.ll llvm/test/CodeGen/AMDGPU/whole-wave-register-spill.ll llvm/test/CodeGen/AMDGPU/wwm-reserved-spill.ll llvm/test/CodeGen/PowerPC/regalloc-fast-debug-spill.ll llvm/test/CodeGen/SPIRV/debug-info/debug-type-pointer.ll llvm/test/DebugInfo/AMDGPU/cfi.ll llvm/test/DebugInfo/AMDGPU/debug-loc-copy.ll llvm/test/DebugInfo/AMDGPU/pointer-address-space.ll llvm/test/DebugInfo/COFF/global_rust.ll llvm/test/DebugInfo/Generic/address_space_rvalue.ll llvm/test/DebugInfo/NVPTX/debug-info.ll llvm/test/DebugInfo/X86/dbg-rust-valid-enum-as-scope.ll llvm/test/DebugInfo/X86/stack_adjustments_trigger_cfa_frame_base.ll llvm/test/Transforms/InstCombine/cast-mul-select.ll llvm/test/Transforms/InstCombine/debuginfo-variables.ll llvm/test/Verifier/diderivedtype-address-space-atomic-type.ll llvm/test/Verifier/diderivedtype-address-space-const-type.ll llvm/test/Verifier/diderivedtype-address-space-friend.ll llvm/test/Verifier/diderivedtype-address-space-inheritance.ll llvm/test/Verifier/diderivedtype-address-space-member.ll llvm/test/Verifier/diderivedtype-address-space-ptr-to-member-type.ll llvm/test/Verifier/diderivedtype-address-space-restrict-type.ll llvm/test/Verifier/diderivedtype-address-space-rvalue-reference-type.ll llvm/test/Verifier/diderivedtype-address-space-typedef.ll llvm/test/Verifier/diderivedtype-address-space-volatile-type.ll llvm/tools/llvm-c-test/debuginfo.c llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp llvm/unittests/IR/DebugInfoTest.cpp llvm/unittests/IR/MetadataTest.cpp mlir/lib/Target/LLVMIR/DebugTranslation.cpp mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp mlir/test/Target/LLVMIR/Import/debug-info.ll

The following files introduce new uses of undef:

  • llvm/test/Assembler/DIExpressionNew.ll
  • llvm/test/CodeGen/AMDGPU/dwarf-multi-register-use-crash.ll
  • llvm/test/DebugInfo/verify-diop-based-diexpression.ll

Undef is now deprecated and should only be used in the rare cases where no replacement is possible. For example, a load of uninitialized memory yields undef. You should use poison values for placeholders instead.

In tests, avoid using undef and having tests that trigger undefined behavior. If you need an operand with some unimportant value, you can add a new argument to the function and use that instead.

For example, this is considered a bad practice:

define void @fn() {
  ...
  br i1 undef, ...
}

Please use the following instead:

define void @fn(i1 %cond) {
  ...
  br i1 %cond, ...
}

Please refer to the Undefined Behavior Manual for more information.

@slinder1
Copy link
Contributor Author

Opened against wrong branch (and remote!) sorry!

@slinder1 slinder1 closed this Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants