<div dir="ltr">Generally renames in parts of the code your working with are culturally considered "marginally acceptable" - moreso if there's an inconsistency within a single class/file, etc (sometihng where the old and new naming conventions get confusing - two similar names in different but often-used-together classes that are just off by case, etc). It's a... case by case basis, if you will.<br><br>(things that are more culturally considered below the bar (not worth the churn) are whitespace (removing trailing whitespace, reformatting a line etc) only changes - unless, again, you're dealing with a mixed up file/about to completely rework a piece of code, etc)</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 1, 2016 at 7:19 PM, Sanjay Patel via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ah, sorry about that. I used these functions in patches earlier today, and thought I'd just end the formatting inconsistency (for them at least) with a 'replace all'. I didn't consider the pain for non-trunk users. I'll resist the urge to fix the half of LLVM that's still wrong. :)<div class="HOEnZb"><div class="h5"><br><br>On Monday, February 1, 2016, Philip Reames <<a href="mailto:listmail@philipreames.com" target="_blank">listmail@philipreames.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I generally don't want to discourage cleanup changes, but I'll note this was a particular low value change which causes us a bit of headache when merging into our downstream branch. Nothing major, but I question the value/cost tradeoff here. (Please, please, don't revert!)<br>
<br>
Philip<br>
<br>
On 02/01/2016 02:23 PM, Sanjay Patel via llvm-commits wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: spatel<br>
Date: Mon Feb 1 16:23:39 2016<br>
New Revision: 259425<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=259425&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=259425&view=rev</a><br>
Log:<br>
function names start with a lowercase letter; NFC<br>
<br>
Modified:<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombinePHI.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp<br>
<br>
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp?rev=259425&r1=259424&r2=259425&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp?rev=259425&r1=259424&r2=259425&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp Mon Feb 1 16:23:39 2016<br>
@@ -1052,15 +1052,15 @@ Instruction *InstCombiner::visitAdd(Bina<br>
Value *LHS = I.getOperand(0), *RHS = I.getOperand(1);<br>
if (Value *V = SimplifyVectorOp(I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
if (Value *V = SimplifyAddInst(LHS, RHS, I.hasNoSignedWrap(),<br>
I.hasNoUnsignedWrap(), DL, TLI, DT, AC))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
// (A*B)+(A*C) -> A*(B+C) etc<br>
if (Value *V = SimplifyUsingDistributiveLaws(I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
if (ConstantInt *CI = dyn_cast<ConstantInt>(RHS)) {<br>
// X + (signbit) --> X ^ signbit<br>
@@ -1157,7 +1157,7 @@ Instruction *InstCombiner::visitAdd(Bina<br>
return BinaryOperator::CreateSub(LHS, V);<br>
if (Value *V = checkForNegativeOperand(I, Builder))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
// A+B --> A|B iff A and B have no bits set in common.<br>
if (haveNoCommonBitsSet(LHS, RHS, DL, AC, &I, DT))<br>
@@ -1317,11 +1317,11 @@ Instruction *InstCombiner::visitFAdd(Bin<br>
Value *LHS = I.getOperand(0), *RHS = I.getOperand(1);<br>
if (Value *V = SimplifyVectorOp(I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
if (Value *V =<br>
SimplifyFAddInst(LHS, RHS, I.getFastMathFlags(), DL, TLI, DT, AC))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
if (isa<Constant>(RHS)) {<br>
if (isa<PHINode>(LHS))<br>
@@ -1415,7 +1415,7 @@ Instruction *InstCombiner::visitFAdd(Bin<br>
if (I.hasUnsafeAlgebra()) {<br>
if (Value *V = FAddCombine(Builder).simplify(&I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
}<br>
return Changed ? &I : nullptr;<br>
@@ -1493,15 +1493,15 @@ Instruction *InstCombiner::visitSub(Bina<br>
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);<br>
if (Value *V = SimplifyVectorOp(I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
if (Value *V = SimplifySubInst(Op0, Op1, I.hasNoSignedWrap(),<br>
I.hasNoUnsignedWrap(), DL, TLI, DT, AC))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
// (A*B)-(A*C) -> A*(B-C) etc<br>
if (Value *V = SimplifyUsingDistributiveLaws(I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
// If this is a 'B = x-(-A)', change to B = x+A.<br>
if (Value *V = dyn_castNegVal(Op1)) {<br>
@@ -1667,13 +1667,13 @@ Instruction *InstCombiner::visitSub(Bina<br>
if (match(Op0, m_PtrToInt(m_Value(LHSOp))) &&<br>
match(Op1, m_PtrToInt(m_Value(RHSOp))))<br>
if (Value *Res = OptimizePointerDifference(LHSOp, RHSOp, I.getType()))<br>
- return ReplaceInstUsesWith(I, Res);<br>
+ return replaceInstUsesWith(I, Res);<br>
// trunc(p)-trunc(q) -> trunc(p-q)<br>
if (match(Op0, m_Trunc(m_PtrToInt(m_Value(LHSOp)))) &&<br>
match(Op1, m_Trunc(m_PtrToInt(m_Value(RHSOp)))))<br>
if (Value *Res = OptimizePointerDifference(LHSOp, RHSOp, I.getType()))<br>
- return ReplaceInstUsesWith(I, Res);<br>
+ return replaceInstUsesWith(I, Res);<br>
bool Changed = false;<br>
if (!I.hasNoSignedWrap() && WillNotOverflowSignedSub(Op0, Op1, I)) {<br>
@@ -1692,11 +1692,11 @@ Instruction *InstCombiner::visitFSub(Bin<br>
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);<br>
if (Value *V = SimplifyVectorOp(I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
if (Value *V =<br>
SimplifyFSubInst(Op0, Op1, I.getFastMathFlags(), DL, TLI, DT, AC))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
// fsub nsz 0, X ==> fsub nsz -0.0, X<br>
if (I.getFastMathFlags().noSignedZeros() && match(Op0, m_Zero())) {<br>
@@ -1736,7 +1736,7 @@ Instruction *InstCombiner::visitFSub(Bin<br>
if (I.hasUnsafeAlgebra()) {<br>
if (Value *V = FAddCombine(Builder).simplify(&I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
}<br>
return nullptr;<br>
<br>
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp?rev=259425&r1=259424&r2=259425&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp?rev=259425&r1=259424&r2=259425&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp Mon Feb 1 16:23:39 2016<br>
@@ -243,7 +243,7 @@ Instruction *InstCombiner::OptAndOp(Inst<br>
if (CI->getValue() == ShlMask)<br>
// Masking out bits that the shift already masks.<br>
- return ReplaceInstUsesWith(TheAnd, Op); // No need for the and.<br>
+ return replaceInstUsesWith(TheAnd, Op); // No need for the and.<br>
if (CI != AndRHS) { // Reducing bits set in and.<br>
TheAnd.setOperand(1, CI);<br>
@@ -263,7 +263,7 @@ Instruction *InstCombiner::OptAndOp(Inst<br>
if (CI->getValue() == ShrMask)<br>
// Masking out bits that the shift already masks.<br>
- return ReplaceInstUsesWith(TheAnd, Op);<br>
+ return replaceInstUsesWith(TheAnd, Op);<br>
if (CI != AndRHS) {<br>
TheAnd.setOperand(1, CI); // Reduce bits set in and cst.<br>
@@ -1248,14 +1248,14 @@ Instruction *InstCombiner::visitAnd(Bina<br>
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);<br>
if (Value *V = SimplifyVectorOp(I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
if (Value *V = SimplifyAndInst(Op0, Op1, DL, TLI, DT, AC))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
// (A|B)&(A|C) -> A|(B&C) etc<br>
if (Value *V = SimplifyUsingDistributiveLaws(I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
// See if we can simplify any instructions used by the instruction whose sole<br>
// purpose is to compute bits we don't care about.<br>
@@ -1263,7 +1263,7 @@ Instruction *InstCombiner::visitAnd(Bina<br>
return &I;<br>
if (Value *V = SimplifyBSwap(I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
if (ConstantInt *AndRHS = dyn_cast<ConstantInt>(Op1)) {<br>
const APInt &AndRHSMask = AndRHS->getValue();<br>
@@ -1451,7 +1451,7 @@ Instruction *InstCombiner::visitAnd(Bina<br>
ICmpInst *RHS = dyn_cast<ICmpInst>(Op1);<br>
if (LHS && RHS)<br>
if (Value *Res = FoldAndOfICmps(LHS, RHS))<br>
- return ReplaceInstUsesWith(I, Res);<br>
+ return replaceInstUsesWith(I, Res);<br>
// TODO: Make this recursive; it's a little tricky because an arbitrary<br>
// number of 'and' instructions might have to be created.<br>
@@ -1459,18 +1459,18 @@ Instruction *InstCombiner::visitAnd(Bina<br>
if (LHS && match(Op1, m_OneUse(m_And(m_Value(X), m_Value(Y))))) {<br>
if (auto *Cmp = dyn_cast<ICmpInst>(X))<br>
if (Value *Res = FoldAndOfICmps(LHS, Cmp))<br>
- return ReplaceInstUsesWith(I, Builder->CreateAnd(Res, Y));<br>
+ return replaceInstUsesWith(I, Builder->CreateAnd(Res, Y));<br>
if (auto *Cmp = dyn_cast<ICmpInst>(Y))<br>
if (Value *Res = FoldAndOfICmps(LHS, Cmp))<br>
- return ReplaceInstUsesWith(I, Builder->CreateAnd(Res, X));<br>
+ return replaceInstUsesWith(I, Builder->CreateAnd(Res, X));<br>
}<br>
if (RHS && match(Op0, m_OneUse(m_And(m_Value(X), m_Value(Y))))) {<br>
if (auto *Cmp = dyn_cast<ICmpInst>(X))<br>
if (Value *Res = FoldAndOfICmps(Cmp, RHS))<br>
- return ReplaceInstUsesWith(I, Builder->CreateAnd(Res, Y));<br>
+ return replaceInstUsesWith(I, Builder->CreateAnd(Res, Y));<br>
if (auto *Cmp = dyn_cast<ICmpInst>(Y))<br>
if (Value *Res = FoldAndOfICmps(Cmp, RHS))<br>
- return ReplaceInstUsesWith(I, Builder->CreateAnd(Res, X));<br>
+ return replaceInstUsesWith(I, Builder->CreateAnd(Res, X));<br>
}<br>
}<br>
@@ -1478,7 +1478,7 @@ Instruction *InstCombiner::visitAnd(Bina<br>
if (FCmpInst *LHS = dyn_cast<FCmpInst>(I.getOperand(0)))<br>
if (FCmpInst *RHS = dyn_cast<FCmpInst>(I.getOperand(1)))<br>
if (Value *Res = FoldAndOfFCmps(LHS, RHS))<br>
- return ReplaceInstUsesWith(I, Res);<br>
+ return replaceInstUsesWith(I, Res);<br>
if (CastInst *Op0C = dyn_cast<CastInst>(Op0)) {<br>
@@ -2055,14 +2055,14 @@ Instruction *InstCombiner::visitOr(Binar<br>
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);<br>
if (Value *V = SimplifyVectorOp(I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
if (Value *V = SimplifyOrInst(Op0, Op1, DL, TLI, DT, AC))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
// (A&B)|(A&C) -> A&(B|C) etc<br>
if (Value *V = SimplifyUsingDistributiveLaws(I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
// See if we can simplify any instructions used by the instruction whose sole<br>
// purpose is to compute bits we don't care about.<br>
@@ -2070,7 +2070,7 @@ Instruction *InstCombiner::visitOr(Binar<br>
return &I;<br>
if (Value *V = SimplifyBSwap(I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
if (ConstantInt *RHS = dyn_cast<ConstantInt>(Op1)) {<br>
ConstantInt *C1 = nullptr; Value *X = nullptr;<br>
@@ -2335,7 +2335,7 @@ Instruction *InstCombiner::visitOr(Binar<br>
ICmpInst *RHS = dyn_cast<ICmpInst>(Op1);<br>
if (LHS && RHS)<br>
if (Value *Res = FoldOrOfICmps(LHS, RHS, &I))<br>
- return ReplaceInstUsesWith(I, Res);<br>
+ return replaceInstUsesWith(I, Res);<br>
// TODO: Make this recursive; it's a little tricky because an arbitrary<br>
// number of 'or' instructions might have to be created.<br>
@@ -2343,18 +2343,18 @@ Instruction *InstCombiner::visitOr(Binar<br>
if (LHS && match(Op1, m_OneUse(m_Or(m_Value(X), m_Value(Y))))) {<br>
if (auto *Cmp = dyn_cast<ICmpInst>(X))<br>
if (Value *Res = FoldOrOfICmps(LHS, Cmp, &I))<br>
- return ReplaceInstUsesWith(I, Builder->CreateOr(Res, Y));<br>
+ return replaceInstUsesWith(I, Builder->CreateOr(Res, Y));<br>
if (auto *Cmp = dyn_cast<ICmpInst>(Y))<br>
if (Value *Res = FoldOrOfICmps(LHS, Cmp, &I))<br>
- return ReplaceInstUsesWith(I, Builder->CreateOr(Res, X));<br>
+ return replaceInstUsesWith(I, Builder->CreateOr(Res, X));<br>
}<br>
if (RHS && match(Op0, m_OneUse(m_Or(m_Value(X), m_Value(Y))))) {<br>
if (auto *Cmp = dyn_cast<ICmpInst>(X))<br>
if (Value *Res = FoldOrOfICmps(Cmp, RHS, &I))<br>
- return ReplaceInstUsesWith(I, Builder->CreateOr(Res, Y));<br>
+ return replaceInstUsesWith(I, Builder->CreateOr(Res, Y));<br>
if (auto *Cmp = dyn_cast<ICmpInst>(Y))<br>
if (Value *Res = FoldOrOfICmps(Cmp, RHS, &I))<br>
- return ReplaceInstUsesWith(I, Builder->CreateOr(Res, X));<br>
+ return replaceInstUsesWith(I, Builder->CreateOr(Res, X));<br>
}<br>
}<br>
@@ -2362,7 +2362,7 @@ Instruction *InstCombiner::visitOr(Binar<br>
if (FCmpInst *LHS = dyn_cast<FCmpInst>(I.getOperand(0)))<br>
if (FCmpInst *RHS = dyn_cast<FCmpInst>(I.getOperand(1)))<br>
if (Value *Res = FoldOrOfFCmps(LHS, RHS))<br>
- return ReplaceInstUsesWith(I, Res);<br>
+ return replaceInstUsesWith(I, Res);<br>
// fold (or (cast A), (cast B)) -> (cast (or A, B))<br>
if (CastInst *Op0C = dyn_cast<CastInst>(Op0)) {<br>
@@ -2440,14 +2440,14 @@ Instruction *InstCombiner::visitXor(Bina<br>
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);<br>
if (Value *V = SimplifyVectorOp(I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
if (Value *V = SimplifyXorInst(Op0, Op1, DL, TLI, DT, AC))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
// (A&B)^(A&C) -> A&(B^C) etc<br>
if (Value *V = SimplifyUsingDistributiveLaws(I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
// See if we can simplify any instructions used by the instruction whose sole<br>
// purpose is to compute bits we don't care about.<br>
@@ -2455,7 +2455,7 @@ Instruction *InstCombiner::visitXor(Bina<br>
return &I;<br>
if (Value *V = SimplifyBSwap(I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
// Is this a ~ operation?<br>
if (Value *NotOp = dyn_castNotVal(&I)) {<br>
@@ -2724,7 +2724,7 @@ Instruction *InstCombiner::visitXor(Bina<br>
Value *Op0 = LHS->getOperand(0), *Op1 = LHS->getOperand(1);<br>
unsigned Code = getICmpCode(LHS) ^ getICmpCode(RHS);<br>
bool isSigned = LHS->isSigned() || RHS->isSigned();<br>
- return ReplaceInstUsesWith(I,<br>
+ return replaceInstUsesWith(I,<br>
getNewICmpValue(isSigned, Code, Op0, Op1,<br>
Builder));<br>
}<br>
<br>
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp?rev=259425&r1=259424&r2=259425&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp?rev=259425&r1=259424&r2=259425&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp Mon Feb 1 16:23:39 2016<br>
@@ -780,7 +780,7 @@ static Instruction *simplifyMaskedStore(<br>
// If the mask is all zeros, this instruction does nothing.<br>
if (ConstMask->isNullValue())<br>
- return IC.EraseInstFromFunction(II);<br>
+ return IC.eraseInstFromFunction(II);<br>
// If the mask is all ones, this is a plain vector store of the 1st argument.<br>
if (ConstMask->isAllOnesValue()) {<br>
@@ -796,7 +796,7 @@ static Instruction *simplifyMaskedGather<br>
// If the mask is all zeros, return the "passthru" argument of the gather.<br>
auto *ConstMask = dyn_cast<Constant>(II.getArgOperand(2));<br>
if (ConstMask && ConstMask->isNullValue())<br>
- return IC.ReplaceInstUsesWith(II, II.getArgOperand(3));<br>
+ return IC.replaceInstUsesWith(II, II.getArgOperand(3));<br>
return nullptr;<br>
}<br>
@@ -805,7 +805,7 @@ static Instruction *simplifyMaskedScatte<br>
// If the mask is all zeros, a scatter does nothing.<br>
auto *ConstMask = dyn_cast<Constant>(II.getArgOperand(3));<br>
if (ConstMask && ConstMask->isNullValue())<br>
- return IC.EraseInstFromFunction(II);<br>
+ return IC.eraseInstFromFunction(II);<br>
return nullptr;<br>
}<br>
@@ -817,7 +817,7 @@ Instruction *InstCombiner::visitCallInst<br>
auto Args = CI.arg_operands();<br>
if (Value *V = SimplifyCall(CI.getCalledValue(), Args.begin(), Args.end(), DL,<br>
TLI, DT, AC))<br>
- return ReplaceInstUsesWith(CI, V);<br>
+ return replaceInstUsesWith(CI, V);<br>
if (isFreeCall(&CI, TLI))<br>
return visitFree(CI);<br>
@@ -841,7 +841,7 @@ Instruction *InstCombiner::visitCallInst<br>
// memmove/cpy/set of zero bytes is a noop.<br>
if (Constant *NumBytes = dyn_cast<Constant>(MI->getLength())) {<br>
if (NumBytes->isNullValue())<br>
- return EraseInstFromFunction(CI);<br>
+ return eraseInstFromFunction(CI);<br>
if (ConstantInt *CI = dyn_cast<ConstantInt>(NumBytes))<br>
if (CI->getZExtValue() == 1) {<br>
@@ -874,7 +874,7 @@ Instruction *InstCombiner::visitCallInst<br>
if (MemTransferInst *MTI = dyn_cast<MemTransferInst>(MI)) {<br>
// memmove(x,x,size) -> noop.<br>
if (MTI->getSource() == MTI->getDest())<br>
- return EraseInstFromFunction(CI);<br>
+ return eraseInstFromFunction(CI);<br>
}<br>
// If we can determine a pointer alignment that is bigger than currently<br>
@@ -902,7 +902,7 @@ Instruction *InstCombiner::visitCallInst<br>
case Intrinsic::objectsize: {<br>
uint64_t Size;<br>
if (getObjectSize(II->getArgOperand(0), Size, DL, TLI))<br>
- return ReplaceInstUsesWith(CI, ConstantInt::get(CI.getType(), Size));<br>
+ return replaceInstUsesWith(CI, ConstantInt::get(CI.getType(), Size));<br>
return nullptr;<br>
}<br>
case Intrinsic::bswap: {<br>
@@ -911,7 +911,7 @@ Instruction *InstCombiner::visitCallInst<br>
// bswap(bswap(x)) -> x<br>
if (match(IIOperand, m_BSwap(m_Value(X))))<br>
- return ReplaceInstUsesWith(CI, X);<br>
+ return replaceInstUsesWith(CI, X);<br>
// bswap(trunc(bswap(x))) -> trunc(lshr(x, c))<br>
if (match(IIOperand, m_Trunc(m_BSwap(m_Value(X))))) {<br>
@@ -930,13 +930,13 @@ Instruction *InstCombiner::visitCallInst<br>
// bitreverse(bitreverse(x)) -> x<br>
if (match(IIOperand, m_Intrinsic<Intrinsic::bitreverse>(m_Value(X))))<br>
- return ReplaceInstUsesWith(CI, X);<br>
+ return replaceInstUsesWith(CI, X);<br>
break;<br>
}<br>
case Intrinsic::masked_load:<br>
if (Value *SimplifiedMaskedOp = simplifyMaskedLoad(*II, *Builder))<br>
- return ReplaceInstUsesWith(CI, SimplifiedMaskedOp);<br>
+ return replaceInstUsesWith(CI, SimplifiedMaskedOp);<br>
break;<br>
case Intrinsic::masked_store:<br>
return simplifyMaskedStore(*II, *this);<br>
@@ -949,10 +949,10 @@ Instruction *InstCombiner::visitCallInst<br>
if (ConstantInt *Power = dyn_cast<ConstantInt>(II->getArgOperand(1))) {<br>
// powi(x, 0) -> 1.0<br>
if (Power->isZero())<br>
- return ReplaceInstUsesWith(CI, ConstantFP::get(CI.getType(), 1.0));<br>
+ return replaceInstUsesWith(CI, ConstantFP::get(CI.getType(), 1.0));<br>
// powi(x, 1) -> x<br>
if (Power->isOne())<br>
- return ReplaceInstUsesWith(CI, II->getArgOperand(0));<br>
+ return replaceInstUsesWith(CI, II->getArgOperand(0));<br>
// powi(x, -1) -> 1/x<br>
if (Power->isAllOnesValue())<br>
return BinaryOperator::CreateFDiv(ConstantFP::get(CI.getType(), 1.0),<br>
@@ -972,7 +972,7 @@ Instruction *InstCombiner::visitCallInst<br>
unsigned TrailingZeros = KnownOne.countTrailingZeros();<br>
APInt Mask(APInt::getLowBitsSet(BitWidth, TrailingZeros));<br>
if ((Mask & KnownZero) == Mask)<br>
- return ReplaceInstUsesWith(CI, ConstantInt::get(IT,<br>
+ return replaceInstUsesWith(CI, ConstantInt::get(IT,<br>
APInt(BitWidth, TrailingZeros)));<br>
}<br>
@@ -990,7 +990,7 @@ Instruction *InstCombiner::visitCallInst<br>
unsigned LeadingZeros = KnownOne.countLeadingZeros();<br>
APInt Mask(APInt::getHighBitsSet(BitWidth, LeadingZeros));<br>
if ((Mask & KnownZero) == Mask)<br>
- return ReplaceInstUsesWith(CI, ConstantInt::get(IT,<br>
+ return replaceInstUsesWith(CI, ConstantInt::get(IT,<br>
APInt(BitWidth, LeadingZeros)));<br>
}<br>
@@ -1036,7 +1036,7 @@ Instruction *InstCombiner::visitCallInst<br>
return II;<br>
}<br>
if (Value *V = simplifyMinnumMaxnum(*II))<br>
- return ReplaceInstUsesWith(*II, V);<br>
+ return replaceInstUsesWith(*II, V);<br>
break;<br>
}<br>
case Intrinsic::ppc_altivec_lvx:<br>
@@ -1147,7 +1147,7 @@ Instruction *InstCombiner::visitCallInst<br>
// Constant folding: Convert to generic half to single conversion.<br>
if (isa<ConstantAggregateZero>(Arg))<br>
- return ReplaceInstUsesWith(*II, ConstantAggregateZero::get(RetType));<br>
+ return replaceInstUsesWith(*II, ConstantAggregateZero::get(RetType));<br>
if (isa<ConstantDataVector>(Arg)) {<br>
auto VectorHalfAsShorts = Arg;<br>
@@ -1164,7 +1164,7 @@ Instruction *InstCombiner::visitCallInst<br>
auto VectorHalfs =<br>
Builder->CreateBitCast(VectorHalfAsShorts, VectorHalfType);<br>
auto VectorFloats = Builder->CreateFPExt(VectorHalfs, RetType);<br>
- return ReplaceInstUsesWith(*II, VectorFloats);<br>
+ return replaceInstUsesWith(*II, VectorFloats);<br>
}<br>
// We only use the lowest lanes of the argument.<br>
@@ -1214,7 +1214,7 @@ Instruction *InstCombiner::visitCallInst<br>
case Intrinsic::x86_avx2_pslli_q:<br>
case Intrinsic::x86_avx2_pslli_w:<br>
if (Value *V = simplifyX86immShift(*II, *Builder))<br>
- return ReplaceInstUsesWith(*II, V);<br>
+ return replaceInstUsesWith(*II, V);<br>
break;<br>
case Intrinsic::x86_sse2_psra_d:<br>
@@ -1234,7 +1234,7 @@ Instruction *InstCombiner::visitCallInst<br>
case Intrinsic::x86_avx2_psll_q:<br>
case Intrinsic::x86_avx2_psll_w: {<br>
if (Value *V = simplifyX86immShift(*II, *Builder))<br>
- return ReplaceInstUsesWith(*II, V);<br>
+ return replaceInstUsesWith(*II, V);<br>
// SSE2/AVX2 uses only the first 64-bits of the 128-bit vector<br>
// operand to compute the shift amount.<br>
@@ -1257,7 +1257,7 @@ Instruction *InstCombiner::visitCallInst<br>
case Intrinsic::x86_avx2_pmovsxwd:<br>
case Intrinsic::x86_avx2_pmovsxwq:<br>
if (Value *V = simplifyX86extend(*II, *Builder, true))<br>
- return ReplaceInstUsesWith(*II, V);<br>
+ return replaceInstUsesWith(*II, V);<br>
break;<br>
case Intrinsic::x86_sse41_pmovzxbd:<br>
@@ -1273,12 +1273,12 @@ Instruction *InstCombiner::visitCallInst<br>
case Intrinsic::x86_avx2_pmovzxwd:<br>
case Intrinsic::x86_avx2_pmovzxwq:<br>
if (Value *V = simplifyX86extend(*II, *Builder, false))<br>
- return ReplaceInstUsesWith(*II, V);<br>
+ return replaceInstUsesWith(*II, V);<br>
break;<br>
case Intrinsic::x86_sse41_insertps:<br>
if (Value *V = simplifyX86insertps(*II, *Builder))<br>
- return ReplaceInstUsesWith(*II, V);<br>
+ return replaceInstUsesWith(*II, V);<br>
break;<br>
case Intrinsic::x86_sse4a_extrq: {<br>
@@ -1301,7 +1301,7 @@ Instruction *InstCombiner::visitCallInst<br>
// Attempt to simplify to a constant, shuffle vector or EXTRQI call.<br>
if (Value *V = simplifyX86extrq(*II, Op0, CILength, CIIndex, *Builder))<br>
- return ReplaceInstUsesWith(*II, V);<br>
+ return replaceInstUsesWith(*II, V);<br>
// EXTRQ only uses the lowest 64-bits of the first 128-bit vector<br>
// operands and the lowest 16-bits of the second.<br>
@@ -1330,7 +1330,7 @@ Instruction *InstCombiner::visitCallInst<br>
// Attempt to simplify to a constant or shuffle vector.<br>
if (Value *V = simplifyX86extrq(*II, Op0, CILength, CIIndex, *Builder))<br>
- return ReplaceInstUsesWith(*II, V);<br>
+ return replaceInstUsesWith(*II, V);<br>
// EXTRQI only uses the lowest 64-bits of the first 128-bit vector<br>
// operand.<br>
@@ -1362,7 +1362,7 @@ Instruction *InstCombiner::visitCallInst<br>
APInt Len = V11.zextOrTrunc(6);<br>
APInt Idx = V11.lshr(8).zextOrTrunc(6);<br>
if (Value *V = simplifyX86insertq(*II, Op0, Op1, Len, Idx, *Builder))<br>
- return ReplaceInstUsesWith(*II, V);<br>
+ return replaceInstUsesWith(*II, V);<br>
}<br>
// INSERTQ only uses the lowest 64-bits of the first 128-bit vector<br>
@@ -1395,7 +1395,7 @@ Instruction *InstCombiner::visitCallInst<br>
APInt Len = CILength->getValue().zextOrTrunc(6);<br>
APInt Idx = CIIndex->getValue().zextOrTrunc(6);<br>
if (Value *V = simplifyX86insertq(*II, Op0, Op1, Len, Idx, *Builder))<br>
- return ReplaceInstUsesWith(*II, V);<br>
+ return replaceInstUsesWith(*II, V);<br>
}<br>
// INSERTQI only uses the lowest 64-bits of the first two 128-bit vector<br>
@@ -1429,11 +1429,11 @@ Instruction *InstCombiner::visitCallInst<br>
// fold (blend A, A, Mask) -> A<br>
if (Op0 == Op1)<br>
- return ReplaceInstUsesWith(CI, Op0);<br>
+ return replaceInstUsesWith(CI, Op0);<br>
// Zero Mask - select 1st argument.<br>
if (isa<ConstantAggregateZero>(Mask))<br>
- return ReplaceInstUsesWith(CI, Op0);<br>
+ return replaceInstUsesWith(CI, Op0);<br>
// Constant Mask - select 1st/2nd argument lane based on top bit of mask.<br>
if (auto C = dyn_cast<ConstantDataVector>(Mask)) {<br>
@@ -1501,7 +1501,7 @@ Instruction *InstCombiner::visitCallInst<br>
auto V1 = II->getArgOperand(0);<br>
auto V2 = Constant::getNullValue(II->getType());<br>
auto Shuffle = Builder->CreateShuffleVector(V1, V2, NewC);<br>
- return ReplaceInstUsesWith(CI, Shuffle);<br>
+ return replaceInstUsesWith(CI, Shuffle);<br>
}<br>
case Intrinsic::x86_avx_vpermilvar_ps:<br>
@@ -1541,7 +1541,7 @@ Instruction *InstCombiner::visitCallInst<br>
auto V1 = II->getArgOperand(0);<br>
auto V2 = UndefValue::get(V1->getType());<br>
auto Shuffle = Builder->CreateShuffleVector(V1, V2, NewC);<br>
- return ReplaceInstUsesWith(CI, Shuffle);<br>
+ return replaceInstUsesWith(CI, Shuffle);<br>
}<br>
case Intrinsic::x86_avx_vperm2f128_pd_256:<br>
@@ -1549,7 +1549,7 @@ Instruction *InstCombiner::visitCallInst<br>
case Intrinsic::x86_avx_vperm2f128_si_256:<br>
case Intrinsic::x86_avx2_vperm2i128:<br>
if (Value *V = simplifyX86vperm2(*II, *Builder))<br>
- return ReplaceInstUsesWith(*II, V);<br>
+ return replaceInstUsesWith(*II, V);<br>
break;<br>
case Intrinsic::x86_xop_vpcomb:<br>
@@ -1557,7 +1557,7 @@ Instruction *InstCombiner::visitCallInst<br>
case Intrinsic::x86_xop_vpcomq:<br>
case Intrinsic::x86_xop_vpcomw:<br>
if (Value *V = simplifyX86vpcom(*II, *Builder, true))<br>
- return ReplaceInstUsesWith(*II, V);<br>
+ return replaceInstUsesWith(*II, V);<br>
break;<br>
case Intrinsic::x86_xop_vpcomub:<br>
@@ -1565,7 +1565,7 @@ Instruction *InstCombiner::visitCallInst<br>
case Intrinsic::x86_xop_vpcomuq:<br>
case Intrinsic::x86_xop_vpcomuw:<br>
if (Value *V = simplifyX86vpcom(*II, *Builder, false))<br>
- return ReplaceInstUsesWith(*II, V);<br>
+ return replaceInstUsesWith(*II, V);<br>
break;<br>
case Intrinsic::ppc_altivec_vperm:<br>
@@ -1662,7 +1662,7 @@ Instruction *InstCombiner::visitCallInst<br>
// Handle mul by zero first:<br>
if (isa<ConstantAggregateZero>(Arg0) || isa<ConstantAggregateZero>(Arg1)) {<br>
- return ReplaceInstUsesWith(CI, ConstantAggregateZero::get(II->getType()));<br>
+ return replaceInstUsesWith(CI, ConstantAggregateZero::get(II->getType()));<br>
}<br>
// Check for constant LHS & RHS - in this case we just simplify.<br>
@@ -1674,7 +1674,7 @@ Instruction *InstCombiner::visitCallInst<br>
CV0 = ConstantExpr::getIntegerCast(CV0, NewVT, /*isSigned=*/!Zext);<br>
CV1 = ConstantExpr::getIntegerCast(CV1, NewVT, /*isSigned=*/!Zext);<br>
- return ReplaceInstUsesWith(CI, ConstantExpr::getMul(CV0, CV1));<br>
+ return replaceInstUsesWith(CI, ConstantExpr::getMul(CV0, CV1));<br>
}<br>
// Couldn't simplify - canonicalize constant to the RHS.<br>
@@ -1701,7 +1701,7 @@ Instruction *InstCombiner::visitCallInst<br>
// Only do this if it was exact and therefore not dependent on the<br>
// rounding mode.<br>
if (Status == APFloat::opOK)<br>
- return ReplaceInstUsesWith(CI, ConstantFP::get(II->getContext(), Val));<br>
+ return replaceInstUsesWith(CI, ConstantFP::get(II->getContext(), Val));<br>
}<br>
break;<br>
@@ -1712,7 +1712,7 @@ Instruction *InstCombiner::visitCallInst<br>
if (IntrinsicInst *SS = dyn_cast<IntrinsicInst>(II->getArgOperand(0))) {<br>
if (SS->getIntrinsicID() == Intrinsic::stacksave) {<br>
if (&*++SS->getIterator() == II)<br>
- return EraseInstFromFunction(CI);<br>
+ return eraseInstFromFunction(CI);<br>
}<br>
}<br>
@@ -1730,7 +1730,7 @@ Instruction *InstCombiner::visitCallInst<br>
if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(BCI)) {<br>
// If there is a stackrestore below this one, remove this one.<br>
if (II->getIntrinsicID() == Intrinsic::stackrestore)<br>
- return EraseInstFromFunction(CI);<br>
+ return eraseInstFromFunction(CI);<br>
// Otherwise, ignore the intrinsic.<br>
} else {<br>
// If we found a non-intrinsic call, we can't remove the stack<br>
@@ -1745,7 +1745,7 @@ Instruction *InstCombiner::visitCallInst<br>
// are no allocas or calls between the restore and the return, nuke the<br>
// restore.<br>
if (!CannotRemove && (isa<ReturnInst>(TI) || isa<ResumeInst>(TI)))<br>
- return EraseInstFromFunction(CI);<br>
+ return eraseInstFromFunction(CI);<br>
break;<br>
}<br>
case Intrinsic::lifetime_start: {<br>
@@ -1761,8 +1761,8 @@ Instruction *InstCombiner::visitCallInst<br>
if (LTE->getIntrinsicID() == Intrinsic::lifetime_end) {<br>
if (II->getOperand(0) == LTE->getOperand(0) &&<br>
II->getOperand(1) == LTE->getOperand(1)) {<br>
- EraseInstFromFunction(*LTE);<br>
- return EraseInstFromFunction(*II);<br>
+ eraseInstFromFunction(*LTE);<br>
+ return eraseInstFromFunction(*II);<br>
}<br>
continue;<br>
}<br>
@@ -1780,7 +1780,7 @@ Instruction *InstCombiner::visitCallInst<br>
if (match(IIOperand, m_And(m_Value(A), m_Value(B)))) {<br>
Builder->CreateCall(AssumeIntrinsic, A, II->getName());<br>
Builder->CreateCall(AssumeIntrinsic, B, II->getName());<br>
- return EraseInstFromFunction(*II);<br>
+ return eraseInstFromFunction(*II);<br>
}<br>
// assume(!(a || b)) -> assume(!a); assume(!b);<br>
if (match(IIOperand, m_Not(m_Or(m_Value(A), m_Value(B))))) {<br>
@@ -1788,7 +1788,7 @@ Instruction *InstCombiner::visitCallInst<br>
II->getName());<br>
Builder->CreateCall(AssumeIntrinsic, Builder->CreateNot(B),<br>
II->getName());<br>
- return EraseInstFromFunction(*II);<br>
+ return eraseInstFromFunction(*II);<br>
}<br>
// assume( (load addr) != null ) -> add 'nonnull' metadata to load<br>
@@ -1805,7 +1805,7 @@ Instruction *InstCombiner::visitCallInst<br>
if (isValidAssumeForContext(II, LI, DT)) {<br>
MDNode *MD = MDNode::get(II->getContext(), None);<br>
LI->setMetadata(LLVMContext::MD_nonnull, MD);<br>
- return EraseInstFromFunction(*II);<br>
+ return eraseInstFromFunction(*II);<br>
}<br>
}<br>
// TODO: apply nonnull return attributes to calls and invokes<br>
@@ -1816,7 +1816,7 @@ Instruction *InstCombiner::visitCallInst<br>
APInt KnownZero(1, 0), KnownOne(1, 0);<br>
computeKnownBits(IIOperand, KnownZero, KnownOne, 0, II);<br>
if (KnownOne.isAllOnesValue())<br>
- return EraseInstFromFunction(*II);<br>
+ return eraseInstFromFunction(*II);<br>
break;<br>
}<br>
@@ -1830,7 +1830,7 @@ Instruction *InstCombiner::visitCallInst<br>
// Remove the relocation if unused, note that this check is required<br>
// to prevent the cases below from looping forever.<br>
if (II->use_empty())<br>
- return EraseInstFromFunction(*II);<br>
+ return eraseInstFromFunction(*II);<br>
// Undef is undef, even after relocation.<br>
// TODO: provide a hook for this in GCStrategy. This is clearly legal for<br>
@@ -1838,7 +1838,7 @@ Instruction *InstCombiner::visitCallInst<br>
// about whether it was legal for all possible collectors.<br>
if (isa<UndefValue>(DerivedPtr)) {<br>
// gc_relocate is uncasted. Use undef of gc_relocate's type to replace it.<br>
- return ReplaceInstUsesWith(*II, UndefValue::get(GCRelocateType));<br>
+ return replaceInstUsesWith(*II, UndefValue::get(GCRelocateType));<br>
}<br>
// The relocation of null will be null for most any collector.<br>
@@ -1847,7 +1847,7 @@ Instruction *InstCombiner::visitCallInst<br>
if (isa<ConstantPointerNull>(DerivedPtr)) {<br>
// gc_relocate is uncasted. Use null-pointer of gc_relocate's type to<br>
// replace it.<br>
- return ReplaceInstUsesWith(*II, ConstantPointerNull::get(GCRelocateType));<br>
+ return replaceInstUsesWith(*II, ConstantPointerNull::get(GCRelocateType));<br>
}<br>
// isKnownNonNull -> nonnull attribute<br>
@@ -1915,12 +1915,12 @@ Instruction *InstCombiner::tryOptimizeCa<br>
if (!CI->getCalledFunction()) return nullptr;<br>
auto InstCombineRAUW = [this](Instruction *From, Value *With) {<br>
- ReplaceInstUsesWith(*From, With);<br>
+ replaceInstUsesWith(*From, With);<br>
};<br>
LibCallSimplifier Simplifier(DL, TLI, InstCombineRAUW);<br>
if (Value *With = Simplifier.optimizeCall(CI)) {<br>
++NumSimplified;<br>
- return CI->use_empty() ? CI : ReplaceInstUsesWith(*CI, With);<br>
+ return CI->use_empty() ? CI : replaceInstUsesWith(*CI, With);<br>
}<br>
return nullptr;<br>
@@ -2057,9 +2057,9 @@ Instruction *InstCombiner::visitCallSite<br>
// If OldCall does not return void then replaceAllUsesWith undef.<br>
// This allows ValueHandlers and custom metadata to adjust itself.<br>
if (!OldCall->getType()->isVoidTy())<br>
- ReplaceInstUsesWith(*OldCall, UndefValue::get(OldCall->getType()));<br>
+ replaceInstUsesWith(*OldCall, UndefValue::get(OldCall->getType()));<br>
if (isa<CallInst>(OldCall))<br>
- return EraseInstFromFunction(*OldCall);<br>
+ return eraseInstFromFunction(*OldCall);<br>
// We cannot remove an invoke, because it would change the CFG, just<br>
// change the callee to a null pointer.<br>
@@ -2072,7 +2072,7 @@ Instruction *InstCombiner::visitCallSite<br>
// If CS does not return void then replaceAllUsesWith undef.<br>
// This allows ValueHandlers and custom metadata to adjust itself.<br>
if (!CS.getInstruction()->getType()->isVoidTy())<br>
- ReplaceInstUsesWith(*CS.getInstruction(),<br>
+ replaceInstUsesWith(*CS.getInstruction(),<br>
UndefValue::get(CS.getInstruction()->getType()));<br>
if (isa<InvokeInst>(CS.getInstruction())) {<br>
@@ -2087,7 +2087,7 @@ Instruction *InstCombiner::visitCallSite<br>
UndefValue::get(Type::getInt1PtrTy(Callee->getContext())),<br>
CS.getInstruction());<br>
- return EraseInstFromFunction(*CS.getInstruction());<br>
+ return eraseInstFromFunction(*CS.getInstruction());<br>
}<br>
if (IntrinsicInst *II = findInitTrampoline(Callee))<br>
@@ -2122,7 +2122,7 @@ Instruction *InstCombiner::visitCallSite<br>
Instruction *I = tryOptimizeCall(CI);<br>
// If we changed something return the result, etc. Otherwise let<br>
// the fallthrough check.<br>
- if (I) return EraseInstFromFunction(*I);<br>
+ if (I) return eraseInstFromFunction(*I);<br>
}<br>
return Changed ? CS.getInstruction() : nullptr;<br>
@@ -2389,7 +2389,7 @@ bool InstCombiner::transformConstExprCas<br>
}<br>
if (!Caller->use_empty())<br>
- ReplaceInstUsesWith(*Caller, NV);<br>
+ replaceInstUsesWith(*Caller, NV);<br>
else if (Caller->hasValueHandle()) {<br>
if (OldRetTy == NV->getType())<br>
ValueHandleBase::ValueIsRAUWd(Caller, NV);<br>
@@ -2399,7 +2399,7 @@ bool InstCombiner::transformConstExprCas<br>
ValueHandleBase::ValueIsDeleted(Caller);<br>
}<br>
- EraseInstFromFunction(*Caller);<br>
+ eraseInstFromFunction(*Caller);<br>
return true;<br>
}<br>
<br>
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp?rev=259425&r1=259424&r2=259425&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp?rev=259425&r1=259424&r2=259425&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp Mon Feb 1 16:23:39 2016<br>
@@ -149,9 +149,9 @@ Instruction *InstCombiner::PromoteCastOf<br>
// New is the allocation instruction, pointer typed. AI is the original<br>
// allocation instruction, also pointer typed. Thus, cast to use is BitCast.<br>
Value *NewCast = AllocaBuilder.CreateBitCast(New, AI.getType(), "tmpcast");<br>
- ReplaceInstUsesWith(AI, NewCast);<br>
+ replaceInstUsesWith(AI, NewCast);<br>
}<br>
- return ReplaceInstUsesWith(CI, New);<br>
+ return replaceInstUsesWith(CI, New);<br>
}<br>
/// Given an expression that CanEvaluateTruncated or CanEvaluateSExtd returns<br>
@@ -508,7 +508,7 @@ Instruction *InstCombiner::visitTrunc(Tr<br>
" to avoid cast: " << CI << '\n');<br>
Value *Res = EvaluateInDifferentType(Src, DestTy, false);<br>
assert(Res->getType() == DestTy);<br>
- return ReplaceInstUsesWith(CI, Res);<br>
+ return replaceInstUsesWith(CI, Res);<br>
}<br>
// Canonicalize trunc x to i1 -> (icmp ne (and x, 1), 0), likewise for vector.<br>
@@ -532,7 +532,7 @@ Instruction *InstCombiner::visitTrunc(Tr<br>
// If the shift amount is larger than the size of A, then the result is<br>
// known to be zero because all the input bits got shifted out.<br>
if (Cst->getZExtValue() >= ASize)<br>
- return ReplaceInstUsesWith(CI, Constant::getNullValue(DestTy));<br>
+ return replaceInstUsesWith(CI, Constant::getNullValue(DestTy));<br>
// Since we're doing an lshr and a zero extend, and know that the shift<br>
// amount is smaller than ASize, it is always safe to do the shift in A's<br>
@@ -606,7 +606,7 @@ Instruction *InstCombiner::transformZExt<br>
In = Builder->CreateXor(In, One, In->getName() + ".not");<br>
}<br>
- return ReplaceInstUsesWith(CI, In);<br>
+ return replaceInstUsesWith(CI, In);<br>
}<br>
// zext (X == 0) to i32 --> X^1 iff X has only the low bit set.<br>
@@ -636,7 +636,7 @@ Instruction *InstCombiner::transformZExt<br>
Constant *Res = ConstantInt::get(Type::getInt1Ty(CI.getContext()),<br>
isNE);<br>
Res = ConstantExpr::getZExt(Res, CI.getType());<br>
- return ReplaceInstUsesWith(CI, Res);<br>
+ return replaceInstUsesWith(CI, Res);<br>
}<br>
uint32_t ShAmt = KnownZeroMask.logBase2();<br>
@@ -654,7 +654,7 @@ Instruction *InstCombiner::transformZExt<br>
}<br>
if (CI.getType() == In->getType())<br>
- return ReplaceInstUsesWith(CI, In);<br>
+ return replaceInstUsesWith(CI, In);<br>
return CastInst::CreateIntegerCast(In, CI.getType(), false/*ZExt*/);<br>
}<br>
}<br>
@@ -694,7 +694,7 @@ Instruction *InstCombiner::transformZExt<br>
if (ICI->getPredicate() == ICmpInst::ICMP_EQ)<br>
Result = Builder->CreateXor(Result, ConstantInt::get(ITy, 1));<br>
Result->takeName(ICI);<br>
- return ReplaceInstUsesWith(CI, Result);<br>
+ return replaceInstUsesWith(CI, Result);<br>
}<br>
}<br>
}<br>
@@ -872,7 +872,7 @@ Instruction *InstCombiner::visitZExt(ZEx<br>
APInt::getHighBitsSet(DestBitSize,<br>
DestBitSize-SrcBitsKept),<br>
0, &CI))<br>
- return ReplaceInstUsesWith(CI, Res);<br>
+ return replaceInstUsesWith(CI, Res);<br>
// We need to emit an AND to clear the high bits.<br>
Constant *C = ConstantInt::get(Res->getType(),<br>
@@ -986,7 +986,7 @@ Instruction *InstCombiner::transformSExt<br>
if (Pred == ICmpInst::ICMP_SGT)<br>
In = Builder->CreateNot(In, In->getName()+".not");<br>
- return ReplaceInstUsesWith(CI, In);<br>
+ return replaceInstUsesWith(CI, In);<br>
}<br>
}<br>
@@ -1009,7 +1009,7 @@ Instruction *InstCombiner::transformSExt<br>
Value *V = Pred == ICmpInst::ICMP_NE ?<br>
ConstantInt::getAllOnesValue(CI.getType()) :<br>
ConstantInt::getNullValue(CI.getType());<br>
- return ReplaceInstUsesWith(CI, V);<br>
+ return replaceInstUsesWith(CI, V);<br>
}<br>
if (!Op1C->isZero() == (Pred == ICmpInst::ICMP_NE)) {<br>
@@ -1041,7 +1041,7 @@ Instruction *InstCombiner::transformSExt<br>
}<br>
if (CI.getType() == In->getType())<br>
- return ReplaceInstUsesWith(CI, In);<br>
+ return replaceInstUsesWith(CI, In);<br>
return CastInst::CreateIntegerCast(In, CI.getType(), true/*SExt*/);<br>
}<br>
}<br>
@@ -1137,7 +1137,7 @@ Instruction *InstCombiner::visitSExt(SEx<br>
ComputeSignBit(Src, KnownZero, KnownOne, 0, &CI);<br>
if (KnownZero) {<br>
Value *ZExt = Builder->CreateZExt(Src, DestTy);<br>
- return ReplaceInstUsesWith(CI, ZExt);<br>
+ return replaceInstUsesWith(CI, ZExt);<br>
}<br>
// Attempt to extend the entire input expression tree to the destination<br>
@@ -1158,7 +1158,7 @@ Instruction *InstCombiner::visitSExt(SEx<br>
// If the high bits are already filled with sign bit, just replace this<br>
// cast with the result.<br>
if (ComputeNumSignBits(Res, 0, &CI) > DestBitSize - SrcBitSize)<br>
- return ReplaceInstUsesWith(CI, Res);<br>
+ return replaceInstUsesWith(CI, Res);<br>
// We need to emit a shl + ashr to do the sign extend.<br>
Value *ShAmt = ConstantInt::get(DestTy, DestBitSize-SrcBitSize);<br>
@@ -1451,7 +1451,7 @@ Instruction *InstCombiner::FoldItoFPtoI(<br>
if (FITy->getScalarSizeInBits() < SrcTy->getScalarSizeInBits())<br>
return new TruncInst(SrcI, FITy);<br>
if (SrcTy == FITy)<br>
- return ReplaceInstUsesWith(FI, SrcI);<br>
+ return replaceInstUsesWith(FI, SrcI);<br>
return new BitCastInst(SrcI, FITy);<br>
}<br>
return nullptr;<br>
@@ -1796,7 +1796,7 @@ Instruction *InstCombiner::visitBitCast(<br>
// Get rid of casts from one type to the same type. These are useless and can<br>
// be replaced by the operand.<br>
if (DestTy == Src->getType())<br>
- return ReplaceInstUsesWith(CI, Src);<br>
+ return replaceInstUsesWith(CI, Src);<br>
if (PointerType *DstPTy = dyn_cast<PointerType>(DestTy)) {<br>
PointerType *SrcPTy = cast<PointerType>(SrcTy);<br>
@@ -1854,7 +1854,7 @@ Instruction *InstCombiner::visitBitCast(<br>
// assemble the elements of the vector manually. Try to rip the code out<br>
// and replace it with insertelements.<br>
if (Value *V = optimizeIntegerToVectorInsertions(CI, *this))<br>
- return ReplaceInstUsesWith(CI, V);<br>
+ return replaceInstUsesWith(CI, V);<br>
}<br>
}<br>
<br>
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp?rev=259425&r1=259424&r2=259425&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp?rev=259425&r1=259424&r2=259425&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp Mon Feb 1 16:23:39 2016<br>
@@ -402,7 +402,7 @@ FoldCmpLoadFromIndexedGlobal(GetElementP<br>
if (SecondTrueElement != Overdefined) {<br>
// None true -> false.<br>
if (FirstTrueElement == Undefined)<br>
- return ReplaceInstUsesWith(ICI, Builder->getFalse());<br>
+ return replaceInstUsesWith(ICI, Builder->getFalse());<br>
Value *FirstTrueIdx = ConstantInt::get(Idx->getType(), FirstTrueElement);<br>
@@ -422,7 +422,7 @@ FoldCmpLoadFromIndexedGlobal(GetElementP<br>
if (SecondFalseElement != Overdefined) {<br>
// None false -> true.<br>
if (FirstFalseElement == Undefined)<br>
- return ReplaceInstUsesWith(ICI, Builder->getTrue());<br>
+ return replaceInstUsesWith(ICI, Builder->getTrue());<br>
Value *FirstFalseIdx = ConstantInt::get(Idx->getType(), FirstFalseElement);<br>
@@ -983,7 +983,7 @@ Instruction *InstCombiner::FoldGEPICmp(G<br>
Value *Cmp = Builder->CreateICmp(ICmpInst::getSignedPredicate(Cond),<br>
LOffset, ROffset);<br>
- return ReplaceInstUsesWith(I, Cmp);<br>
+ return replaceInstUsesWith(I, Cmp);<br>
}<br>
// Otherwise, the base pointers are different and the indices are<br>
@@ -1020,7 +1020,7 @@ Instruction *InstCombiner::FoldGEPICmp(G<br>
}<br>
if (NumDifferences == 0) // SAME GEP?<br>
- return ReplaceInstUsesWith(I, // No comparison is needed here.<br>
+ return replaceInstUsesWith(I, // No comparison is needed here.<br>
Builder->getInt1(ICmpInst::isTrueWhenEqual(Cond)));<br>
else if (NumDifferences == 1 && GEPsInBounds) {<br>
@@ -1119,7 +1119,7 @@ Instruction *InstCombiner::FoldAllocaCmp<br>
}<br>
Type *CmpTy = CmpInst::makeCmpResultType(Other->getType());<br>
- return ReplaceInstUsesWith(<br>
+ return replaceInstUsesWith(<br>
ICI,<br>
ConstantInt::get(CmpTy, !CmpInst::isTrueWhenEqual(ICI.getPredicate())));<br>
}<br>
@@ -1290,39 +1290,39 @@ Instruction *InstCombiner::FoldICmpDivCs<br>
default: llvm_unreachable("Unhandled icmp opcode!");<br>
case ICmpInst::ICMP_EQ:<br>
if (LoOverflow && HiOverflow)<br>
- return ReplaceInstUsesWith(ICI, Builder->getFalse());<br>
+ return replaceInstUsesWith(ICI, Builder->getFalse());<br>
if (HiOverflow)<br>
return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SGE :<br>
ICmpInst::ICMP_UGE, X, LoBound);<br>
if (LoOverflow)<br>
return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SLT :<br>
ICmpInst::ICMP_ULT, X, HiBound);<br>
- return ReplaceInstUsesWith(ICI, InsertRangeTest(X, LoBound, HiBound,<br>
+ return replaceInstUsesWith(ICI, InsertRangeTest(X, LoBound, HiBound,<br>
DivIsSigned, true));<br>
case ICmpInst::ICMP_NE:<br>
if (LoOverflow && HiOverflow)<br>
- return ReplaceInstUsesWith(ICI, Builder->getTrue());<br>
+ return replaceInstUsesWith(ICI, Builder->getTrue());<br>
if (HiOverflow)<br>
return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SLT :<br>
ICmpInst::ICMP_ULT, X, LoBound);<br>
if (LoOverflow)<br>
return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SGE :<br>
ICmpInst::ICMP_UGE, X, HiBound);<br>
- return ReplaceInstUsesWith(ICI, InsertRangeTest(X, LoBound, HiBound,<br>
+ return replaceInstUsesWith(ICI, InsertRangeTest(X, LoBound, HiBound,<br>
DivIsSigned, false));<br>
case ICmpInst::ICMP_ULT:<br>
case ICmpInst::ICMP_SLT:<br>
if (LoOverflow == +1) // Low bound is greater than input range.<br>
- return ReplaceInstUsesWith(ICI, Builder->getTrue());<br>
+ return replaceInstUsesWith(ICI, Builder->getTrue());<br>
if (LoOverflow == -1) // Low bound is less than input range.<br>
- return ReplaceInstUsesWith(ICI, Builder->getFalse());<br>
+ return replaceInstUsesWith(ICI, Builder->getFalse());<br>
return new ICmpInst(Pred, X, LoBound);<br>
case ICmpInst::ICMP_UGT:<br>
case ICmpInst::ICMP_SGT:<br>
if (HiOverflow == +1) // High bound greater than input range.<br>
- return ReplaceInstUsesWith(ICI, Builder->getFalse());<br>
+ return replaceInstUsesWith(ICI, Builder->getFalse());<br>
if (HiOverflow == -1) // High bound less than input range.<br>
- return ReplaceInstUsesWith(ICI, Builder->getTrue());<br>
+ return replaceInstUsesWith(ICI, Builder->getTrue());<br>
if (Pred == ICmpInst::ICMP_UGT)<br>
return new ICmpInst(ICmpInst::ICMP_UGE, X, HiBound);<br>
return new ICmpInst(ICmpInst::ICMP_SGE, X, HiBound);<br>
@@ -1394,7 +1394,7 @@ Instruction *InstCombiner::FoldICmpShrCs<br>
if (Comp != CmpRHSV) { // Comparing against a bit that we know is zero.<br>
bool IsICMP_NE = ICI.getPredicate() == ICmpInst::ICMP_NE;<br>
Constant *Cst = Builder->getInt1(IsICMP_NE);<br>
- return ReplaceInstUsesWith(ICI, Cst);<br>
+ return replaceInstUsesWith(ICI, Cst);<br>
}<br>
// Otherwise, check to see if the bits shifted out are known to be zero.<br>
@@ -1426,7 +1426,7 @@ Instruction *InstCombiner::FoldICmpCstSh<br>
auto getConstant = [&I, this](bool IsTrue) {<br>
if (I.getPredicate() == I.ICMP_NE)<br>
IsTrue = !IsTrue;<br>
- return ReplaceInstUsesWith(I, ConstantInt::get(I.getType(), IsTrue));<br>
+ return replaceInstUsesWith(I, ConstantInt::get(I.getType(), IsTrue));<br>
};<br>
auto getICmp = [&I](CmpInst::Predicate Pred, Value *LHS, Value *RHS) {<br>
@@ -1490,7 +1490,7 @@ Instruction *InstCombiner::FoldICmpCstSh<br>
auto getConstant = [&I, this](bool IsTrue) {<br>
if (I.getPredicate() == I.ICMP_NE)<br>
IsTrue = !IsTrue;<br>
- return ReplaceInstUsesWith(I, ConstantInt::get(I.getType(), IsTrue));<br>
+ return replaceInstUsesWith(I, ConstantInt::get(I.getType(), IsTrue));<br>
};<br>
auto getICmp = [&I](CmpInst::Predicate Pred, Value *LHS, Value *RHS) {<br>
@@ -1729,9 +1729,9 @@ Instruction *InstCombiner::visitICmpInst<br>
// As a special case, check to see if this means that the<br>
// result is always true or false now.<br>
if (ICI.getPredicate() == ICmpInst::ICMP_EQ)<br>
- return ReplaceInstUsesWith(ICI, Builder->getFalse());<br>
+ return replaceInstUsesWith(ICI, Builder->getFalse());<br>
if (ICI.getPredicate() == ICmpInst::ICMP_NE)<br>
- return ReplaceInstUsesWith(ICI, Builder->getTrue());<br>
+ return replaceInstUsesWith(ICI, Builder->getTrue());<br>
} else {<br>
ICI.setOperand(1, NewCst);<br>
Constant *NewAndCst;<br>
@@ -1991,7 +1991,7 @@ Instruction *InstCombiner::visitICmpInst<br>
if (Comp != RHS) {// Comparing against a bit that we know is zero.<br>
bool IsICMP_NE = ICI.getPredicate() == ICmpInst::ICMP_NE;<br>
Constant *Cst = Builder->getInt1(IsICMP_NE);<br>
- return ReplaceInstUsesWith(ICI, Cst);<br>
+ return replaceInstUsesWith(ICI, Cst);<br>
}<br>
// If the shift is NUW, then it is just shifting out zeros, no need for an<br>
@@ -2241,7 +2241,7 @@ Instruction *InstCombiner::visitICmpInst<br>
if (ConstantInt *BOC = dyn_cast<ConstantInt>(BO->getOperand(1))) {<br>
Constant *NotCI = ConstantExpr::getNot(RHS);<br>
if (!ConstantExpr::getAnd(BOC, NotCI)->isNullValue())<br>
- return ReplaceInstUsesWith(ICI, Builder->getInt1(isICMP_NE));<br>
+ return replaceInstUsesWith(ICI, Builder->getInt1(isICMP_NE));<br>
}<br>
break;<br>
@@ -2250,7 +2250,7 @@ Instruction *InstCombiner::visitICmpInst<br>
// If bits are being compared against that are and'd out, then the<br>
// comparison can never succeed!<br>
if ((RHSV & ~BOC->getValue()) != 0)<br>
- return ReplaceInstUsesWith(ICI, Builder->getInt1(isICMP_NE));<br>
+ return replaceInstUsesWith(ICI, Builder->getInt1(isICMP_NE));<br>
// If we have ((X & C) == C), turn it into ((X & C) != 0).<br>
if (RHS == BOC && RHSV.isPowerOf2())<br>
@@ -2438,7 +2438,7 @@ Instruction *InstCombiner::visitICmpInst<br>
// Finally, return the value computed.<br>
if (ICI.getPredicate() == ICmpInst::ICMP_ULT)<br>
- return ReplaceInstUsesWith(ICI, Result);<br>
+ return replaceInstUsesWith(ICI, Result);<br>
assert(ICI.getPredicate() == ICmpInst::ICMP_UGT && "ICmp should be folded!");<br>
return BinaryOperator::CreateNot(Result);<br>
@@ -2524,7 +2524,7 @@ static Instruction *ProcessUGT_ADDCST_AD<br>
// The inner add was the result of the narrow add, zero extended to the<br>
// wider type. Replace it with the result computed by the intrinsic.<br>
- IC.ReplaceInstUsesWith(*OrigAdd, ZExt);<br>
+ IC.replaceInstUsesWith(*OrigAdd, ZExt);<br>
// The original icmp gets replaced with the overflow value.<br>
return ExtractValueInst::Create(Call, 1, "sadd.overflow");<br>
@@ -2808,7 +2808,7 @@ static Instruction *ProcessUMulZExtIdiom<br>
continue;<br>
if (TruncInst *TI = dyn_cast<TruncInst>(U)) {<br>
if (TI->getType()->getPrimitiveSizeInBits() == MulWidth)<br>
- IC.ReplaceInstUsesWith(*TI, Mul);<br>
+ IC.replaceInstUsesWith(*TI, Mul);<br>
else<br>
TI->setOperand(0, Mul);<br>
} else if (BinaryOperator *BO = dyn_cast<BinaryOperator>(U)) {<br>
@@ -2820,7 +2820,7 @@ static Instruction *ProcessUMulZExtIdiom<br>
Instruction *Zext =<br>
cast<Instruction>(Builder->CreateZExt(ShortAnd, BO->getType()));<br>
IC.Worklist.Add(Zext);<br>
- IC.ReplaceInstUsesWith(*BO, Zext);<br>
+ IC.replaceInstUsesWith(*BO, Zext);<br>
} else {<br>
llvm_unreachable("Unexpected Binary operation");<br>
}<br>
@@ -3074,7 +3074,7 @@ Instruction *InstCombiner::visitICmpInst<br>
if (Value *V =<br>
SimplifyICmpInst(I.getPredicate(), Op0, Op1, DL, TLI, DT, AC, &I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
// comparing -val or val with non-zero is the same as just comparing val<br>
// ie, abs(val) != 0 -> val != 0<br>
@@ -3292,7 +3292,7 @@ Instruction *InstCombiner::visitICmpInst<br>
default: llvm_unreachable("Unknown icmp opcode!");<br>
case ICmpInst::ICMP_EQ: {<br>
if (Op0Max.ult(Op1Min) || Op0Min.ugt(Op1Max))<br>
- return ReplaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
// If all bits are known zero except for one, then we know at most one<br>
// bit is set. If the comparison is against zero, then this is a check<br>
@@ -3336,7 +3336,7 @@ Instruction *InstCombiner::visitICmpInst<br>
}<br>
case ICmpInst::ICMP_NE: {<br>
if (Op0Max.ult(Op1Min) || Op0Min.ugt(Op1Max))<br>
- return ReplaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
// If all bits are known zero except for one, then we know at most one<br>
// bit is set. If the comparison is against zero, then this is a check<br>
@@ -3380,9 +3380,9 @@ Instruction *InstCombiner::visitICmpInst<br>
}<br>
case ICmpInst::ICMP_ULT:<br>
if (Op0Max.ult(Op1Min)) // A <u B -> true if max(A) < min(B)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
if (Op0Min.uge(Op1Max)) // A <u B -> false if min(A) >= max(B)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
if (Op1Min == Op0Max) // A <u B -> A != B if max(A) == min(B)<br>
return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1);<br>
if (ConstantInt *CI = dyn_cast<ConstantInt>(Op1)) {<br>
@@ -3398,9 +3398,9 @@ Instruction *InstCombiner::visitICmpInst<br>
break;<br>
case ICmpInst::ICMP_UGT:<br>
if (Op0Min.ugt(Op1Max)) // A >u B -> true if min(A) > max(B)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
if (Op0Max.ule(Op1Min)) // A >u B -> false if max(A) <= max(B)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
if (Op1Max == Op0Min) // A >u B -> A != B if min(A) == max(B)<br>
return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1);<br>
@@ -3417,9 +3417,9 @@ Instruction *InstCombiner::visitICmpInst<br>
break;<br>
case ICmpInst::ICMP_SLT:<br>
if (Op0Max.slt(Op1Min)) // A <s B -> true if max(A) < min(C)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
if (Op0Min.sge(Op1Max)) // A <s B -> false if min(A) >= max(C)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
if (Op1Min == Op0Max) // A <s B -> A != B if max(A) == min(B)<br>
return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1);<br>
if (ConstantInt *CI = dyn_cast<ConstantInt>(Op1)) {<br>
@@ -3430,9 +3430,9 @@ Instruction *InstCombiner::visitICmpInst<br>
break;<br>
case ICmpInst::ICMP_SGT:<br>
if (Op0Min.sgt(Op1Max)) // A >s B -> true if min(A) > max(B)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
if (Op0Max.sle(Op1Min)) // A >s B -> false if max(A) <= min(B)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
if (Op1Max == Op0Min) // A >s B -> A != B if min(A) == max(B)<br>
return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1);<br>
@@ -3445,30 +3445,30 @@ Instruction *InstCombiner::visitICmpInst<br>
case ICmpInst::ICMP_SGE:<br>
assert(!isa<ConstantInt>(Op1) && "ICMP_SGE with ConstantInt not folded!");<br>
if (Op0Min.sge(Op1Max)) // A >=s B -> true if min(A) >= max(B)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
if (Op0Max.slt(Op1Min)) // A >=s B -> false if max(A) < min(B)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
break;<br>
case ICmpInst::ICMP_SLE:<br>
assert(!isa<ConstantInt>(Op1) && "ICMP_SLE with ConstantInt not folded!");<br>
if (Op0Max.sle(Op1Min)) // A <=s B -> true if max(A) <= min(B)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
if (Op0Min.sgt(Op1Max)) // A <=s B -> false if min(A) > max(B)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
break;<br>
case ICmpInst::ICMP_UGE:<br>
assert(!isa<ConstantInt>(Op1) && "ICMP_UGE with ConstantInt not folded!");<br>
if (Op0Min.uge(Op1Max)) // A >=u B -> true if min(A) >= max(B)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
if (Op0Max.ult(Op1Min)) // A >=u B -> false if max(A) < min(B)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
break;<br>
case ICmpInst::ICMP_ULE:<br>
assert(!isa<ConstantInt>(Op1) && "ICMP_ULE with ConstantInt not folded!");<br>
if (Op0Max.ule(Op1Min)) // A <=u B -> true if max(A) <= min(B)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
if (Op0Min.ugt(Op1Max)) // A <=u B -> false if min(A) > max(B)<br>
- return ReplaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
break;<br>
}<br>
@@ -3842,9 +3842,9 @@ Instruction *InstCombiner::visitICmpInst<br>
switch (SRem == BO0 ? ICmpInst::getSwappedPredicate(Pred) : Pred) {<br>
default: break;<br>
case ICmpInst::ICMP_EQ:<br>
- return ReplaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));<br>
case ICmpInst::ICMP_NE:<br>
- return ReplaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
+ return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));<br>
case ICmpInst::ICMP_SGT:<br>
case ICmpInst::ICMP_SGE:<br>
return new ICmpInst(ICmpInst::ICMP_SGT, SRem->getOperand(1),<br>
@@ -3971,8 +3971,8 @@ Instruction *InstCombiner::visitICmpInst<br>
Constant *Overflow;<br>
if (OptimizeOverflowCheck(OCF_UNSIGNED_ADD, A, B, *AddI, Result,<br>
Overflow)) {<br>
- ReplaceInstUsesWith(*AddI, Result);<br>
- return ReplaceInstUsesWith(I, Overflow);<br>
+ replaceInstUsesWith(*AddI, Result);<br>
+ return replaceInstUsesWith(I, Overflow);<br>
}<br>
}<br>
@@ -4181,10 +4181,10 @@ Instruction *InstCombiner::FoldFCmp_IntT<br>
RHSRoundInt.roundToIntegral(APFloat::rmNearestTiesToEven);<br>
if (RHS.compare(RHSRoundInt) != APFloat::cmpEqual) {<br>
if (P == FCmpInst::FCMP_OEQ || P == FCmpInst::FCMP_UEQ)<br>
- return ReplaceInstUsesWith(I, Builder->getFalse());<br>
+ return replaceInstUsesWith(I, Builder->getFalse());<br>
assert(P == FCmpInst::FCMP_ONE || P == FCmpInst::FCMP_UNE);<br>
- return ReplaceInstUsesWith(I, Builder->getTrue());<br>
+ return replaceInstUsesWith(I, Builder->getTrue());<br>
}<br>
}<br>
@@ -4250,9 +4250,9 @@ Instruction *InstCombiner::FoldFCmp_IntT<br>
Pred = ICmpInst::ICMP_NE;<br>
break;<br>
case FCmpInst::FCMP_ORD:<br>
- return ReplaceInstUsesWith(I, Builder->getTrue());<br>
+ return replaceInstUsesWith(I, Builder->getTrue());<br>
case FCmpInst::FCMP_UNO:<br>
- return ReplaceInstUsesWith(I, Builder->getFalse());<br>
+ return replaceInstUsesWith(I, Builder->getFalse());<br>
}<br>
// Now we know that the APFloat is a normal number, zero or inf.<br>
@@ -4270,8 +4270,8 @@ Instruction *InstCombiner::FoldFCmp_IntT<br>
if (SMax.compare(RHS) == APFloat::cmpLessThan) { // smax < 13123.0<br>
if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_SLT ||<br>
Pred == ICmpInst::ICMP_SLE)<br>
- return ReplaceInstUsesWith(I, Builder->getTrue());<br>
- return ReplaceInstUsesWith(I, Builder->getFalse());<br>
+ return replaceInstUsesWith(I, Builder->getTrue());<br>
+ return replaceInstUsesWith(I, Builder->getFalse());<br>
}<br>
} else {<br>
// If the RHS value is > UnsignedMax, fold the comparison. This handles<br>
@@ -4282,8 +4282,8 @@ Instruction *InstCombiner::FoldFCmp_IntT<br>
if (UMax.compare(RHS) == APFloat::cmpLessThan) { // umax < 13123.0<br>
if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_ULT ||<br>
Pred == ICmpInst::ICMP_ULE)<br>
- return ReplaceInstUsesWith(I, Builder->getTrue());<br>
- return ReplaceInstUsesWith(I, Builder->getFalse());<br>
+ return replaceInstUsesWith(I, Builder->getTrue());<br>
+ return replaceInstUsesWith(I, Builder->getFalse());<br>
}<br>
}<br>
@@ -4295,8 +4295,8 @@ Instruction *InstCombiner::FoldFCmp_IntT<br>
if (SMin.compare(RHS) == APFloat::cmpGreaterThan) { // smin > 12312.0<br>
if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_SGT ||<br>
Pred == ICmpInst::ICMP_SGE)<br>
- return ReplaceInstUsesWith(I, Builder->getTrue());<br>
- return ReplaceInstUsesWith(I, Builder->getFalse());<br>
+ return replaceInstUsesWith(I, Builder->getTrue());<br>
+ return replaceInstUsesWith(I, Builder->getFalse());<br>
}<br>
} else {<br>
// See if the RHS value is < UnsignedMin.<br>
@@ -4306,8 +4306,8 @@ Instruction *InstCombiner::FoldFCmp_IntT<br>
if (SMin.compare(RHS) == APFloat::cmpGreaterThan) { // umin > 12312.0<br>
if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_UGT ||<br>
Pred == ICmpInst::ICMP_UGE)<br>
- return ReplaceInstUsesWith(I, Builder->getTrue());<br>
- return ReplaceInstUsesWith(I, Builder->getFalse());<br>
+ return replaceInstUsesWith(I, Builder->getTrue());<br>
+ return replaceInstUsesWith(I, Builder->getFalse());<br>
}<br>
}<br>
@@ -4329,14 +4329,14 @@ Instruction *InstCombiner::FoldFCmp_IntT<br>
switch (Pred) {<br>
default: llvm_unreachable("Unexpected integer comparison!");<br>
case ICmpInst::ICMP_NE: // (float)int != 4.4 --> true<br>
- return ReplaceInstUsesWith(I, Builder->getTrue());<br>
+ return replaceInstUsesWith(I, Builder->getTrue());<br>
case ICmpInst::ICMP_EQ: // (float)int == 4.4 --> false<br>
- return ReplaceInstUsesWith(I, Builder->getFalse());<br>
+ return replaceInstUsesWith(I, Builder->getFalse());<br>
case ICmpInst::ICMP_ULE:<br>
// (float)int <= 4.4 --> int <= 4<br>
// (float)int <= -4.4 --> false<br>
if (RHS.isNegative())<br>
- return ReplaceInstUsesWith(I, Builder->getFalse());<br>
+ return replaceInstUsesWith(I, Builder->getFalse());<br>
break;<br>
case ICmpInst::ICMP_SLE:<br>
// (float)int <= 4.4 --> int <= 4<br>
@@ -4348,7 +4348,7 @@ Instruction *InstCombiner::FoldFCmp_IntT<br>
// (float)int < -4.4 --> false<br>
// (float)int < 4.4 --> int <= 4<br>
if (RHS.isNegative())<br>
- return ReplaceInstUsesWith(I, Builder->getFalse());<br>
+ return replaceInstUsesWith(I, Builder->getFalse());<br>
Pred = ICmpInst::ICMP_ULE;<br>
break;<br>
case ICmpInst::ICMP_SLT:<br>
@@ -4361,7 +4361,7 @@ Instruction *InstCombiner::FoldFCmp_IntT<br>
// (float)int > 4.4 --> int > 4<br>
// (float)int > -4.4 --> true<br>
if (RHS.isNegative())<br>
- return ReplaceInstUsesWith(I, Builder->getTrue());<br>
+ return replaceInstUsesWith(I, Builder->getTrue());<br>
break;<br>
case ICmpInst::ICMP_SGT:<br>
// (float)int > 4.4 --> int > 4<br>
@@ -4373,7 +4373,7 @@ Instruction *InstCombiner::FoldFCmp_IntT<br>
// (float)int >= -4.4 --> true<br>
// (float)int >= 4.4 --> int > 4<br>
if (RHS.isNegative())<br>
- return ReplaceInstUsesWith(I, Builder->getTrue());<br>
+ return replaceInstUsesWith(I, Builder->getTrue());<br>
Pred = ICmpInst::ICMP_UGT;<br>
break;<br>
case ICmpInst::ICMP_SGE:<br>
@@ -4406,7 +4406,7 @@ Instruction *InstCombiner::visitFCmpInst<br>
if (Value *V = SimplifyFCmpInst(I.getPredicate(), Op0, Op1,<br>
I.getFastMathFlags(), DL, TLI, DT, AC, &I))<br>
- return ReplaceInstUsesWith(I, V);<br>
+ return replaceInstUsesWith(I, V);<br>
// Simplify 'fcmp pred X, X'<br>
if (Op0 == Op1) {<br>
@@ -4540,7 +4540,7 @@ Instruction *InstCombiner::visitFCmpInst<br>
break;<br>
// fabs(x) < 0 --> false<br>
case FCmpInst::FCMP_OLT:<br>
- return ReplaceInstUsesWith(I, Builder->getFalse());<br>
+ return replaceInstUsesWith(I, Builder->getFalse());<br>
// fabs(x) > 0 --> x != 0<br>
case FCmpInst::FCMP_OGT:<br>
return new FCmpInst(FCmpInst::FCMP_ONE, CI->getArgOperand(0), RHSC);<br>
<br>
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h?rev=259425&r1=259424&r2=259425&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h?rev=259425&r1=259424&r2=259425&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h (original)<br>
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h Mon Feb 1 16:23:39 2016<br>
@@ -417,7 +417,7 @@ public:<br>
/// replaceable with another preexisting expression. Here we add all uses of<br>
/// I to the worklist, replace all uses of I with the new value, then return<br>
/// I, so that the inst combiner will know that I was modified.<br>
- Instruction *ReplaceInstUsesWith(Instruction &I, Value *V) {<br>
+ Instruction *replaceInstUsesWith(Instruction &I, Value *V) {<br>
// If there are no uses to replace, then we return nullptr to indicate that<br>
// no changes were made to the program.<br>
if (I.use_empty()) return nullptr;<br>
@@ -451,7 +451,7 @@ public:<br>
/// When dealing with an instruction that has side effects or produces a void<br>
/// value, we can't rely on DCE to delete the instruction. Instead, visit<br>
/// methods should return the value returned by this function.<br>
- Instruction *EraseInstFromFunction(Instruction &I) {<br>
+ Instruction *eraseInstFromFunction(Instruction &I) {<br>
DEBUG(dbgs() << "IC: ERASE " << I << '\n');<br>
assert(I.use_empty() && "Cannot erase instruction that is used!");<br>
<br>
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=259425&r1=259424&r2=259425&view=diff" target="_blank"></a></blockquote></blockquote>
</div></div><br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>