summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorMikael Holmen <mikael.holmen@ericsson.com>2017-10-05 07:07:09 +0000
committerMikael Holmen <mikael.holmen@ericsson.com>2017-10-05 07:07:09 +0000
commit0ec1d25d3322064fdcd458c5e8e8342d4809952c (patch)
tree16a05280533232736c0ed0e13682bc542af21b87 /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
parent8dcba551d940b58d4f40e481fe0e517089487088 (diff)
downloadbcm5719-llvm-0ec1d25d3322064fdcd458c5e8e8342d4809952c.tar.gz
bcm5719-llvm-0ec1d25d3322064fdcd458c5e8e8342d4809952c.zip
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
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp3
1 files changed, 1 insertions, 2 deletions
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<CastInst>(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
OpenPOWER on IntegriCloud