Code review cleanup for r175697
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Thu, 21 Feb 2013 14:35:42 +0000 (14:35 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Thu, 21 Feb 2013 14:35:42 +0000 (14:35 +0000)
llvm-svn: 175739

llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp

index 8663dd4..561099b 100644 (file)
@@ -1524,20 +1524,16 @@ void PPCDAGToDAGISel::PostprocessISelDAG() {
     // If the relocation information isn't already present on the
     // immediate operand, add it now.
     if (ReplaceFlags) {
-      GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(ImmOpnd);
-
-      if (GA) {
+      if (GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(ImmOpnd)) {
         DebugLoc dl = GA->getDebugLoc();
         const GlobalValue *GV = GA->getGlobal();
         ImmOpnd = CurDAG->getTargetGlobalAddress(GV, dl, MVT::i64, 0, Flags);
-      } else {
-        ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(ImmOpnd);
-        if (CP) {
-          const Constant *C = CP->getConstVal();
-          ImmOpnd = CurDAG->getTargetConstantPool(C, MVT::i64,
-                                                  CP->getAlignment(),
-                                                  0, Flags);
-        }
+      }
+      else if (ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(ImmOpnd)) {
+        const Constant *C = CP->getConstVal();
+        ImmOpnd = CurDAG->getTargetConstantPool(C, MVT::i64,
+                                                CP->getAlignment(),
+                                                0, Flags);
       }
     }