Skip to content

Commit ab5de9a

Browse files
authored
[NFC][X86][ISel] Remove the unused assert (#133029)
The condition of assert is always true, so just remove it. OptForMinSize means hasMinSize(), which is hasFnAttribute(Attribute::MinSize). hasOptSize() is hasFnAttribute(Attribute::OptimizeForSize) || hasMinSize(). So, '!hasMinSize() || hasFnAttribute(Attribute::OptimizeForSize) || hasMinSize()' is awalys true. --------------------------------- llvm/include/llvm/IR/Function.h ``` /// Optimize this function for minimum size (-Oz). bool hasMinSize() const { return hasFnAttribute(Attribute::MinSize); } /// Optimize this function for size (-Os) or minimum size (-Oz). bool hasOptSize() const { return hasFnAttribute(Attribute::OptimizeForSize) || hasMinSize(); } ```
1 parent 529feec commit ab5de9a

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ namespace {
184184

185185
// OptFor[Min]Size are used in pattern predicates that isel is matching.
186186
OptForMinSize = MF.getFunction().hasMinSize();
187-
assert((!OptForMinSize || MF.getFunction().hasOptSize()) &&
188-
"OptForMinSize implies OptForSize");
189187
return SelectionDAGISel::runOnMachineFunction(MF);
190188
}
191189

0 commit comments

Comments
 (0)