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;
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.
3238class CSEMIRBuilder : public MachineIRBuilder {
You can’t perform that action at this time.
0 commit comments