File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
llvm/include/llvm/CodeGen/GlobalISel Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,19 @@ class GISelInstProfileBuilder;
20
20
// / Defines a builder that does CSE of MachineInstructions using GISelCSEInfo.
21
21
// / Eg usage.
22
22
// /
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
23
35
// /
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);
30
36
// / Explicitly passing in a register would materialize a copy if possible.
31
37
// / CSEMIRBuilder also does trivial constant folding for binary ops.
32
38
class CSEMIRBuilder : public MachineIRBuilder {
You can’t perform that action at this time.
0 commit comments