[llvm-commits] CVS: llvm/lib/Target/IA64/IA64ISelPattern.cpp

Duraid Madina duraid at octopus.com.au
Mon May 9 06:18:46 PDT 2005



Changes in directory llvm/lib/Target/IA64:

IA64ISelPattern.cpp updated: 1.35 -> 1.36
---
Log message:

fix and cleanup constmul code a bit, this fixes mediabench/toast and
probably a couple of other tests.



---
Diffs of the changes:  (+10 -13)

 IA64ISelPattern.cpp |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)


Index: llvm/lib/Target/IA64/IA64ISelPattern.cpp
diff -u llvm/lib/Target/IA64/IA64ISelPattern.cpp:1.35 llvm/lib/Target/IA64/IA64ISelPattern.cpp:1.36
--- llvm/lib/Target/IA64/IA64ISelPattern.cpp:1.35	Wed May  4 14:25:37 2005
+++ llvm/lib/Target/IA64/IA64ISelPattern.cpp	Mon May  9 08:18:34 2005
@@ -680,11 +680,11 @@
   }
 
   for(unsigned i=0; i<u.length(); i++) {
-    if(u.c_str()[i]=='P' || u.c_str()[i]=='N')
+    if(u[i]=='P' || u[i]=='N')
       u.replace(i, 1, "0");
-    if(u.c_str()[i]=='p')
+    if(u[i]=='p')
       u.replace(i, 1, "P");
-    if(u.c_str()[i]=='n')
+    if(u[i]=='n')
       u.replace(i, 1, "N");
   }
 
@@ -694,21 +694,18 @@
   } else
     f=false;
   
-  bool hit=true;
-  for(unsigned i=0; i<u.length(); i++) {
-    if(u[i]!='0')
-      if(u[i]!='N') {
-	hit=false;
-	break;
-      }
-  }
+  int pos=0;
+  while(u[pos]=='0')
+    pos++;
+
+  bool hit=(u[pos]=='N');
 
   int g=0;
   if(hit) {
     g=1;
     for(unsigned p=0; p<u.length(); p++) {
-      bool isP=(u.c_str()[p]=='P');
-      bool isN=(u.c_str()[p]=='N');
+      bool isP=(u[p]=='P');
+      bool isN=(u[p]=='N');
 
       if(isP)
 	u.replace(p, 1, "N");






More information about the llvm-commits mailing list