diff options
author | Duncan Sands <baldrick@free.fr> | 2007-11-25 14:10:56 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2007-11-25 14:10:56 +0000 |
commit | 827cde1c8319e51463007078a7ce3660ebc93036 (patch) | |
tree | a14ff574ff8b56c6eafd7d864d2cf756451a9d8d /test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll | |
parent | 789d34f8c3d78cf439f0da2f1ba7856bdaed01a4 (diff) | |
download | llvm-827cde1c8319e51463007078a7ce3660ebc93036.tar.gz llvm-827cde1c8319e51463007078a7ce3660ebc93036.tar.bz2 llvm-827cde1c8319e51463007078a7ce3660ebc93036.tar.xz |
Fix PR1816. If a bitcast of a function only exists because of a
trivial difference in function attributes, allow calls to it to
be converted to direct calls. Based on a patch by Török Edwin.
While there, move the various lists of mutually incompatible
parameters etc out of the verifier and into ParameterAttributes.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44315 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll')
-rw-r--r-- | test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll b/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll new file mode 100644 index 0000000000..60a4b3b4ab --- /dev/null +++ b/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast +; PR1716 + +@.str = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] + +define i32 @main(i32 %argc, i8** %argv) { +entry: + %tmp32 = tail call i32 (i8* noalias , ...) nounwind * bitcast (i32 (i8*, ...) nounwind * @printf to i32 (i8* noalias , ...) nounwind *)( i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0) noalias , i32 0 ) nounwind ; <i32> [#uses=0] + ret i32 undef +} + +declare i32 @printf(i8*, ...) nounwind |