Subzero: Use Cfg::getOptLevel() instead of ClFlags version.
The opt level (O2 versus Om1) should be tested using Cfg::getOptLevel() instead of getFlags().getOptLevel() whenever possible.
This is because if you run "-Om1 -force-O2=foo", and you're compiling foo, the first form tells you O2 while the second form tells you Om1.
BUG= none
R=eholk@chromium.org
Review URL: https://codereview.chromium.org/2210773002 .
diff --git a/src/IceTargetLoweringARM32.cpp b/src/IceTargetLoweringARM32.cpp
index 20536d2..0add99a 100644
--- a/src/IceTargetLoweringARM32.cpp
+++ b/src/IceTargetLoweringARM32.cpp
@@ -2222,7 +2222,7 @@
const uint32_t Alignment =
std::max(AlignmentParam, ARM32_STACK_ALIGNMENT_BYTES);
const bool OverAligned = Alignment > ARM32_STACK_ALIGNMENT_BYTES;
- const bool OptM1 = getFlags().getOptLevel() == Opt_m1;
+ const bool OptM1 = Func->getOptLevel() == Opt_m1;
const bool AllocaWithKnownOffset = Instr->getKnownFrameOffset();
const bool UseFramePointer =
hasFramePointer() || OverAligned || !AllocaWithKnownOffset || OptM1;
@@ -3326,7 +3326,7 @@
return;
}
case InstArithmetic::Mul: {
- const bool OptM1 = getFlags().getOptLevel() == Opt_m1;
+ const bool OptM1 = Func->getOptLevel() == Opt_m1;
if (!OptM1 && Srcs.hasConstOperand()) {
constexpr std::size_t MaxShifts = 4;
std::array<StrengthReduction::AggregationElement, MaxShifts> Shifts;
@@ -6372,7 +6372,7 @@
}
void TargetARM32::postLower() {
- if (getFlags().getOptLevel() == Opt_m1)
+ if (Func->getOptLevel() == Opt_m1)
return;
markRedefinitions();
Context.availabilityUpdate();