Use ImmToIdxMap.count in PPCRegisterInfo
authorHal Finkel <hfinkel@anl.gov>
Mon, 1 Apr 2013 17:02:06 +0000 (17:02 +0000)
committerHal Finkel <hfinkel@anl.gov>
Mon, 1 Apr 2013 17:02:06 +0000 (17:02 +0000)
Code improvement suggested by Jakob (in review of r178450). No functionality
change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178473 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCRegisterInfo.cpp

index c3231868768ce561ed0a9f36db04a0c0badb3025..1d61a3a8eac2b1370d9ecd32d13d21ce3a52b91c 100644 (file)
@@ -528,8 +528,7 @@ PPCRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
 
   // If the instruction is not present in ImmToIdxMap, then it has no immediate
   // form (and must be r+r).
-  bool noImmForm = !MI.isInlineAsm() &&
-    (ImmToIdxMap.find(OpC) == ImmToIdxMap.end());
+  bool noImmForm = !MI.isInlineAsm() && !ImmToIdxMap.count(OpC);
 
   // Now add the frame object offset to the offset from r1.
   int Offset = MFI->getObjectOffset(FrameIndex);