[llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.y
Reid Spencer
reid at x10sys.com
Sun Apr 1 19:08:23 PDT 2007
Changes in directory llvm/tools/llvm-upgrade:
UpgradeParser.y updated: 1.76 -> 1.77
---
Log message:
Upgrade the bit count intrinsics to have an i32 result.
---
Diffs of the changes: (+19 -0)
UpgradeParser.y | 19 +++++++++++++++++++
1 files changed, 19 insertions(+)
Index: llvm/tools/llvm-upgrade/UpgradeParser.y
diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.76 llvm/tools/llvm-upgrade/UpgradeParser.y:1.77
--- llvm/tools/llvm-upgrade/UpgradeParser.y:1.76 Sun Apr 1 20:13:36 2007
+++ llvm/tools/llvm-upgrade/UpgradeParser.y Sun Apr 1 21:08:05 2007
@@ -1466,6 +1466,25 @@
return new CallInst(F, Args[0]);
}
break;
+ case 'c':
+ if ((Name.length() <= 14 && !memcmp(&Name[5], "ctpop.i", 7)) ||
+ (Name.length() <= 13 && !memcmp(&Name[5], "ctlz.i", 6)) ||
+ (Name.length() <= 13 && !memcmp(&Name[5], "cttz.i", 6))) {
+ // These intrinsics changed their result type.
+ const Type* ArgTy = Args[0]->getType();
+ Function *OldF = CurModule.CurrentModule->getFunction(Name);
+ if (OldF)
+ OldF->setName("upgrd.rm." + Name);
+
+ Function *NewF = cast<Function>(
+ CurModule.CurrentModule->getOrInsertFunction(Name, Type::Int32Ty,
+ ArgTy, (void*)0));
+
+ Instruction *Call = new CallInst(NewF, Args[0], "", CurBB);
+ return CastInst::createIntegerCast(Call, RetTy, false);
+ }
+ break;
+
case 'v' : {
const Type* PtrTy = PointerType::get(Type::Int8Ty);
std::vector<const Type*> Params;
More information about the llvm-commits
mailing list