Skip to content

Commit 4bc38cf

Browse files
committed
[X86ISelDAGToDAG] Move initialization of OptForSize and OptForMinSize from PreprocessISelDAG to runOnMachineFunction. NFCI
This makes more sense as a place to initialize these. I don't think runOnMachineFunction was overriden when these cached values were originally created. llvm-svn: 357123
1 parent 495156d commit 4bc38cf

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ namespace {
181181
Subtarget = &MF.getSubtarget<X86Subtarget>();
182182
IndirectTlsSegRefs = MF.getFunction().hasFnAttribute(
183183
"indirect-tls-seg-refs");
184+
185+
// OptFor[Min]Size are used in pattern predicates that isel is matching.
186+
OptForSize = MF.getFunction().optForSize();
187+
OptForMinSize = MF.getFunction().optForMinSize();
188+
assert((!OptForMinSize || OptForSize) &&
189+
"OptForMinSize implies OptForSize");
190+
184191
SelectionDAGISel::runOnMachineFunction(MF);
185192
return true;
186193
}
@@ -738,11 +745,6 @@ static bool isCalleeLoad(SDValue Callee, SDValue &Chain, bool HasCallSeq) {
738745
}
739746

740747
void X86DAGToDAGISel::PreprocessISelDAG() {
741-
// OptFor[Min]Size are used in pattern predicates that isel is matching.
742-
OptForSize = MF->getFunction().optForSize();
743-
OptForMinSize = MF->getFunction().optForMinSize();
744-
assert((!OptForMinSize || OptForSize) && "OptForMinSize implies OptForSize");
745-
746748
for (SelectionDAG::allnodes_iterator I = CurDAG->allnodes_begin(),
747749
E = CurDAG->allnodes_end(); I != E; ) {
748750
SDNode *N = &*I++; // Preincrement iterator to avoid invalidation issues.

0 commit comments

Comments
 (0)