summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ConstantFolding.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2007-08-04 01:51:18 +0000
committerChandler Carruth <chandlerc@gmail.com>2007-08-04 01:51:18 +0000
commit7132e00de7a2f6a84fc08bd9418be404441d3e16 (patch)
tree9dcf4acd7f8e030357b327c675105fda4ef7afb7 /llvm/lib/Analysis/ConstantFolding.cpp
parent886a41a00724bedf542c945aec94e5b25963d2a4 (diff)
downloadbcm5719-llvm-7132e00de7a2f6a84fc08bd9418be404441d3e16.tar.gz
bcm5719-llvm-7132e00de7a2f6a84fc08bd9418be404441d3e16.zip
This is the patch to provide clean intrinsic function overloading support in LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future.
This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported. llvm-svn: 40807
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index e85d150204e..dedeb4edf30 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -448,13 +448,13 @@ llvm::ConstantFoldCall(Function *F, Constant** Operands, unsigned NumOperands) {
return ConstantInt::get(Op->getValue().byteSwap());
} else if (Name.size() > 11 && !memcmp(&Name[0],"llvm.ctpop",10)) {
uint64_t ctpop = Op->getValue().countPopulation();
- return ConstantInt::get(Type::Int32Ty, ctpop);
+ return ConstantInt::get(Ty, ctpop);
} else if (Name.size() > 10 && !memcmp(&Name[0], "llvm.cttz", 9)) {
uint64_t cttz = Op->getValue().countTrailingZeros();
- return ConstantInt::get(Type::Int32Ty, cttz);
+ return ConstantInt::get(Ty, cttz);
} else if (Name.size() > 10 && !memcmp(&Name[0], "llvm.ctlz", 9)) {
uint64_t ctlz = Op->getValue().countLeadingZeros();
- return ConstantInt::get(Type::Int32Ty, ctlz);
+ return ConstantInt::get(Ty, ctlz);
}
}
} else if (NumOperands == 2) {
OpenPOWER on IntegriCloud