From: Craig Topper Date: Tue, 4 Jul 2017 06:50:48 +0000 (+0000) Subject: [InstCombine] Add TODOs for a couple things that should maybe be in InstSimplify... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8913e9099ea887ae40be423f7f52b79049fdf9bf;p=llvm [InstCombine] Add TODOs for a couple things that should maybe be in InstSimplify instead. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307065 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp index 3770021de10..394a55a1294 100644 --- a/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -1965,9 +1965,10 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { Value *IIOperand = II->getArgOperand(0); Value *X = nullptr; + // TODO should this be in InstSimplify? // bswap(bswap(x)) -> x if (match(IIOperand, m_BSwap(m_Value(X)))) - return replaceInstUsesWith(CI, X); + return replaceInstUsesWith(CI, X); // bswap(trunc(bswap(x))) -> trunc(lshr(x, c)) if (match(IIOperand, m_Trunc(m_BSwap(m_Value(X))))) { @@ -1984,6 +1985,7 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { Value *IIOperand = II->getArgOperand(0); Value *X = nullptr; + // TODO should this be in InstSimplify? // bitreverse(bitreverse(x)) -> x if (match(IIOperand, m_BitReverse(m_Value(X)))) return replaceInstUsesWith(CI, X);