Skip to content

Commit 0341da5

Browse files
authored
[NFC] Reformat comment (#116003)
1 parent 0b54e33 commit 0341da5

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@ class GISelInstProfileBuilder;
2020
/// Defines a builder that does CSE of MachineInstructions using GISelCSEInfo.
2121
/// Eg usage.
2222
///
23+
/// \code
24+
/// GISelCSEInfo *Info =
25+
/// &getAnalysis<GISelCSEAnalysisWrapperPass>().getCSEInfo();
26+
/// CSEMIRBuilder CB(Builder.getState());
27+
/// CB.setCSEInfo(Info);
28+
/// auto A = CB.buildConstant(s32, 42);
29+
/// auto B = CB.buildConstant(s32, 42);
30+
/// assert(A == B);
31+
/// unsigned CReg = MRI.createGenericVirtualRegister(s32);
32+
/// auto C = CB.buildConstant(CReg, 42);
33+
/// assert(C->getOpcode() == TargetOpcode::COPY);
34+
/// \endcode
2335
///
24-
/// GISelCSEInfo *Info =
25-
/// &getAnalysis<GISelCSEAnalysisWrapperPass>().getCSEInfo(); CSEMIRBuilder
26-
/// CB(Builder.getState()); CB.setCSEInfo(Info); auto A = CB.buildConstant(s32,
27-
/// 42); auto B = CB.buildConstant(s32, 42); assert(A == B); unsigned CReg =
28-
/// MRI.createGenericVirtualRegister(s32); auto C = CB.buildConstant(CReg, 42);
29-
/// assert(C->getOpcode() == TargetOpcode::COPY);
3036
/// Explicitly passing in a register would materialize a copy if possible.
3137
/// CSEMIRBuilder also does trivial constant folding for binary ops.
3238
class CSEMIRBuilder : public MachineIRBuilder {

0 commit comments

Comments
 (0)