simplify this check, GetConstantStringInfo validates that a
authorChris Lattner <sabre@nondot.org>
Fri, 27 Jun 2008 03:18:41 +0000 (03:18 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 27 Jun 2008 03:18:41 +0000 (03:18 +0000)
global is constant already.  No functionality change.

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

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 9c5997df45d2322a6c9a35066217c6645e816a25..65d2d6ba38001795feb1f919e1a1c9785df7a840 100644 (file)
@@ -2594,11 +2594,9 @@ static bool isMemSrcFromString(SDOperand Src, std::string &Str,
     return false;
 
   GlobalVariable *GV = dyn_cast<GlobalVariable>(G->getGlobal());
-  if (GV && GV->isConstant()) {
-    if (GetConstantStringInfo(GV, Str)) {
-      SrcOff += SrcDelta;
-      return true;
-    }
+  if (GV && GetConstantStringInfo(GV, Str)) {
+    SrcOff += SrcDelta;
+    return true;
   }
 
   return false;