summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorDylan McKay <dylanmckay34@gmail.com>2016-12-31 01:07:14 +0000
committerDylan McKay <dylanmckay34@gmail.com>2016-12-31 01:07:14 +0000
commit97cf837b465e9e95fc31368f02ca20036811efba (patch)
treef7f70e8cca69e94b5954d4ba35738fce169765d6 /llvm/lib/Target
parentf947f3914839eae86206cf09e79bd662bd179cc9 (diff)
downloadbcm5719-llvm-97cf837b465e9e95fc31368f02ca20036811efba.tar.gz
bcm5719-llvm-97cf837b465e9e95fc31368f02ca20036811efba.zip
[AVR] Optimize 16-bit ANDs with '1'
Summary: Fixes PR 31345 Reviewers: dylanmckay Subscribers: fhahn, llvm-commits Differential Revision: https://reviews.llvm.org/D28186 llvm-svn: 290778
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp b/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
index 65a58cd31c3..1b2f2cec0bc 100644
--- a/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
+++ b/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
@@ -203,6 +203,10 @@ expandLogic(unsigned Op, Block &MBB, BlockIt MBBI) {
bool AVRExpandPseudo::
isLogicImmOpRedundant(unsigned Op, unsigned ImmVal) const {
+ // ANDI Rd, 0xff is redundant.
+ if (Op == AVR::ANDIRdK && ImmVal == 0xff)
+ return true;
+
// ORI Rd, 0x0 is redundant.
if (Op == AVR::ORIRdK && ImmVal == 0x0)
return true;
OpenPOWER on IntegriCloud