[PATCH] D114082: [WIP] Normalize String Attributes
serge via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 17 05:15:11 PST 2021
serge-sans-paille created this revision.
serge-sans-paille added a reviewer: nikic.
Herald added subscribers: ormris, dexonsmith, ecnelises, wenlei, lxfind, okura, jdoerfert, kuter, laytonio, pengfei, haicheng, hiraditya, eraman.
serge-sans-paille requested review of this revision.
Herald added subscribers: llvm-commits, cfe-commits, sstefan1, aheejin.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
Herald added a reviewer: baziotis.
Herald added projects: clang, LLVM.
LLVM IR supports free form string attributes. Those are used both internally in various passes, or to convey information from the front-end to the middle-end, and externally by third party projects.
This patch normalizes the internal part while still being open to extension for third-party project. The basic idea is to have one immutable object per string attribute, with its hash computed at compile-time. Then instead of referencing attributes per their name, one must reference them by their key.
Pros:
- avoid typos in attribute spelling etc, turn them in compile-time error
- it is possible to list all internal keys in one place, and eventually (not implemented in this patch) to normalize them (we currently have a mixture of underscores and hyphens). And to document them.
- hashes are precomputed, which leads to faster indexing and faster testing for attribute presence
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D114082
Files:
clang/lib/CodeGen/CGBlocks.cpp
clang/lib/CodeGen/CGCall.cpp
clang/lib/CodeGen/CGClass.cpp
clang/lib/CodeGen/CGDecl.cpp
clang/lib/CodeGen/CGDeclCXX.cpp
clang/lib/CodeGen/CGExpr.cpp
clang/lib/CodeGen/CGOpenMPRuntime.cpp
clang/lib/CodeGen/CGVTables.cpp
clang/lib/CodeGen/CodeGenFunction.cpp
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/MicrosoftCXXABI.cpp
clang/lib/CodeGen/TargetInfo.cpp
llvm/include/llvm/Analysis/SyncDependenceAnalysis.h
llvm/include/llvm/Analysis/TargetLibraryInfo.h
llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
llvm/include/llvm/Analysis/VectorUtils.h
llvm/include/llvm/CodeGen/CommandFlags.h
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/include/llvm/IR/Assumptions.h
llvm/include/llvm/IR/Attributes.h
llvm/include/llvm/IR/Attributes.td
llvm/include/llvm/IR/Function.h
llvm/include/llvm/IR/GlobalVariable.h
llvm/include/llvm/IR/InstrTypes.h
llvm/include/llvm/ProfileData/SampleProf.h
llvm/lib/Analysis/IVDescriptors.cpp
llvm/lib/Analysis/InlineAdvisor.cpp
llvm/lib/Analysis/InlineCost.cpp
llvm/lib/Analysis/VectorUtils.cpp
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/CodeGen/AsmPrinter/WinException.cpp
llvm/lib/CodeGen/CommandFlags.cpp
llvm/lib/CodeGen/FEntryInserter.cpp
llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/lib/CodeGen/MachineFunction.cpp
llvm/lib/CodeGen/MachineFunctionSplitter.cpp
llvm/lib/CodeGen/MachineOutliner.cpp
llvm/lib/CodeGen/PatchableFunction.cpp
llvm/lib/CodeGen/PrologEpilogInserter.cpp
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/lib/CodeGen/StackProtector.cpp
llvm/lib/CodeGen/TargetLoweringBase.cpp
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
llvm/lib/CodeGen/TargetOptionsImpl.cpp
llvm/lib/CodeGen/TargetRegisterInfo.cpp
llvm/lib/CodeGen/XRayInstrumentation.cpp
llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
llvm/lib/IR/Assumptions.cpp
llvm/lib/IR/AttributeImpl.h
llvm/lib/IR/Attributes.cpp
llvm/lib/IR/AutoUpgrade.cpp
llvm/lib/IR/Core.cpp
llvm/lib/IR/DiagnosticInfo.cpp
llvm/lib/IR/Function.cpp
llvm/lib/IR/Instructions.cpp
llvm/lib/IR/Statepoint.cpp
llvm/lib/IR/Verifier.cpp
llvm/lib/Target/TargetLoweringObjectFile.cpp
llvm/lib/Target/TargetMachine.cpp
llvm/lib/Target/X86/X86DynAllocaExpander.cpp
llvm/lib/Target/X86/X86FastISel.cpp
llvm/lib/Target/X86/X86FrameLowering.cpp
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86MCInstLower.cpp
llvm/lib/Target/X86/X86RegisterInfo.cpp
llvm/lib/Target/X86/X86TargetMachine.cpp
llvm/lib/Target/X86/X86WinEHState.cpp
llvm/lib/Transforms/CFGuard/CFGuard.cpp
llvm/lib/Transforms/Coroutines/CoroEarly.cpp
llvm/lib/Transforms/Coroutines/CoroElide.cpp
llvm/lib/Transforms/Coroutines/CoroInternal.h
llvm/lib/Transforms/Coroutines/CoroSplit.cpp
llvm/lib/Transforms/IPO/Attributor.cpp
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/lib/Transforms/IPO/CrossDSOCFI.cpp
llvm/lib/Transforms/IPO/FunctionImport.cpp
llvm/lib/Transforms/IPO/GlobalOpt.cpp
llvm/lib/Transforms/IPO/LowerTypeTests.cpp
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
llvm/lib/Transforms/Utils/CodeExtractor.cpp
llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp
llvm/lib/Transforms/Utils/FunctionImportUtils.cpp
llvm/lib/Transforms/Utils/InlineFunction.cpp
llvm/lib/Transforms/Utils/Local.cpp
llvm/lib/Transforms/Utils/ModuleUtils.cpp
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/tools/bugpoint-passes/TestPasses.cpp
llvm/unittests/IR/InstructionsTest.cpp
llvm/unittests/ProfileData/SampleProfTest.cpp
llvm/unittests/Transforms/Utils/VFABIUtils.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114082.387907.patch
Type: text/x-patch
Size: 189615 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211117/cc9860da/attachment-0001.bin>
More information about the llvm-commits
mailing list