diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-12-12 04:26:04 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-12-12 04:26:04 +0000 |
commit | ccbf1e36d34c2d66600748bdd8767dc122629a58 (patch) | |
tree | 0da7fdd6443280bb7511025247baf08f1c27df04 /include | |
parent | 9f756cf4e293e5ac75db4636f7ea45ee85123f25 (diff) | |
download | external_llvm-ccbf1e36d34c2d66600748bdd8767dc122629a58.zip external_llvm-ccbf1e36d34c2d66600748bdd8767dc122629a58.tar.gz external_llvm-ccbf1e36d34c2d66600748bdd8767dc122629a58.tar.bz2 |
Switch llvm.cttz and llvm.ctlz to accept a second i1 parameter which
indicates whether the intrinsic has a defined result for a first
argument equal to zero. This will eventually allow these intrinsics to
accurately model the semantics of GCC's __builtin_ctz and __builtin_clz
and the X86 instructions (prior to AVX) which implement them.
This patch merely sets the stage by extending the signature of these
intrinsics and establishing auto-upgrade logic so that the old spelling
still works both in IR and in bitcode. The upgrade logic preserves the
existing (inefficient) semantics. This patch should not change any
behavior. CodeGen isn't updated because it can use the existing
semantics regardless of the flag's value.
Note that this will be followed by API updates to Clang and DragonEgg.
Reviewed by Nick Lewycky!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146357 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Intrinsics.td | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/Intrinsics.td b/include/llvm/Intrinsics.td index 84a39ad..7ceeb9c 100644 --- a/include/llvm/Intrinsics.td +++ b/include/llvm/Intrinsics.td @@ -284,8 +284,8 @@ def int_expect : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, let Properties = [IntrNoMem] in { def int_bswap: Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>]>; def int_ctpop: Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>]>; - def int_ctlz : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>]>; - def int_cttz : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>]>; + def int_ctlz : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, llvm_i1_ty]>; + def int_cttz : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, llvm_i1_ty]>; } //===------------------------ Debugger Intrinsics -------------------------===// |