From 0ec1d25d3322064fdcd458c5e8e8342d4809952c Mon Sep 17 00:00:00 2001 From: Mikael Holmen Date: Thu, 5 Oct 2017 07:07:09 +0000 Subject: Minor refactoring regarding Cast::isNoopCast(), NFC Summary: FastISel::hasTrivialKill() was the only user of the "IntPtrTy" version of Cast::isNoopCast(). According to review comments in D37894 we could instead use the "DataLayout" version of the method, and thus get rid of the "IntPtrTy" versions of isNoopCast() completely. With the above done, the remaining isNoopCast() could then be simplified a bit more. Reviewers: arsenm Reviewed By: arsenm Subscribers: wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D38497 llvm-svn: 314969 --- llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG') diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 959735d66c4..491c56a7314 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -168,8 +168,7 @@ bool FastISel::hasTrivialKill(const Value *V) { // No-op casts are trivially coalesced by fast-isel. if (const auto *Cast = dyn_cast(I)) - if (Cast->isNoopCast(DL.getIntPtrType(Cast->getContext())) && - !hasTrivialKill(Cast->getOperand(0))) + if (Cast->isNoopCast(DL) && !hasTrivialKill(Cast->getOperand(0))) return false; // Even the value might have only one use in the LLVM IR, it is possible that -- cgit v1.2.3