[llvm] r265271 - [CodeGenPrepare] Fix r265264 (again).
Peter Zotov via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 3 12:32:13 PDT 2016
Author: whitequark
Date: Sun Apr 3 14:32:13 2016
New Revision: 265271
URL: http://llvm.org/viewvc/llvm-project?rev=265271&view=rev
Log:
[CodeGenPrepare] Fix r265264 (again).
Don't require TLI for SinkCmpExpression, like it wasn't before
r265264.
Modified:
llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp
Modified: llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp?rev=265271&r1=265270&r2=265271&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp (original)
+++ llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp Sun Apr 3 14:32:13 2016
@@ -855,11 +855,11 @@ static bool CombineUAddWithOverflow(CmpI
/// lose; some adjustment may be wanted there.
///
/// Return true if any changes are made.
-static bool SinkCmpExpression(CmpInst *CI, const TargetLowering &TLI) {
+static bool SinkCmpExpression(CmpInst *CI, const TargetLowering *TLI) {
BasicBlock *DefBB = CI->getParent();
// Avoid sinking soft-FP comparisons, since this can move them into a loop.
- if (TLI.useSoftFloat() && isa<FCmpInst>(CI))
+ if (TLI && TLI->useSoftFloat() && isa<FCmpInst>(CI))
return false;
// Only insert a cmp in each block once.
@@ -911,7 +911,7 @@ static bool SinkCmpExpression(CmpInst *C
}
static bool OptimizeCmpExpression(CmpInst *CI, const TargetLowering *TLI) {
- if (TLI && SinkCmpExpression(CI, *TLI))
+ if (SinkCmpExpression(CI, TLI))
return true;
if (CombineUAddWithOverflow(CI))
More information about the llvm-commits
mailing list