[llvm] [NFC] Reformat comment (PR #116003)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 12 22:41:25 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-globalisel
Author: Serge Pavlov (spavloff)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/116003.diff
1 Files Affected:
- (modified) llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h (+12-6)
``````````diff
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h b/llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h
index 488df12f13f8df..c8982af254217a 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h
@@ -20,13 +20,19 @@ class GISelInstProfileBuilder;
/// Defines a builder that does CSE of MachineInstructions using GISelCSEInfo.
/// Eg usage.
///
+/// \code
+/// GISelCSEInfo *Info =
+/// &getAnalysis<GISelCSEAnalysisWrapperPass>().getCSEInfo();
+/// CSEMIRBuilder CB(Builder.getState());
+/// CB.setCSEInfo(Info);
+/// auto A = CB.buildConstant(s32, 42);
+/// auto B = CB.buildConstant(s32, 42);
+/// assert(A == B);
+/// unsigned CReg = MRI.createGenericVirtualRegister(s32);
+/// auto C = CB.buildConstant(CReg, 42);
+/// assert(C->getOpcode() == TargetOpcode::COPY);
+/// \endcode
///
-/// GISelCSEInfo *Info =
-/// &getAnalysis<GISelCSEAnalysisWrapperPass>().getCSEInfo(); CSEMIRBuilder
-/// CB(Builder.getState()); CB.setCSEInfo(Info); auto A = CB.buildConstant(s32,
-/// 42); auto B = CB.buildConstant(s32, 42); assert(A == B); unsigned CReg =
-/// MRI.createGenericVirtualRegister(s32); auto C = CB.buildConstant(CReg, 42);
-/// assert(C->getOpcode() == TargetOpcode::COPY);
/// Explicitly passing in a register would materialize a copy if possible.
/// CSEMIRBuilder also does trivial constant folding for binary ops.
class CSEMIRBuilder : public MachineIRBuilder {
``````````
</details>
https://github.com/llvm/llvm-project/pull/116003
More information about the llvm-commits
mailing list