diff options
author | Stephen Hines <srhines@google.com> | 2015-03-23 12:10:34 -0700 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2015-03-23 12:10:34 -0700 |
commit | ebe69fe11e48d322045d5949c83283927a0d790b (patch) | |
tree | c92f1907a6b8006628a4b01615f38264d29834ea /test/CodeGen/X86/float-conv-elim.ll | |
parent | b7d2e72b02a4cb8034f32f8247a2558d2434e121 (diff) | |
download | external_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.zip external_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.tar.gz external_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.tar.bz2 |
Update aosp/master LLVM for rebase to r230699.
Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9
Diffstat (limited to 'test/CodeGen/X86/float-conv-elim.ll')
-rw-r--r-- | test/CodeGen/X86/float-conv-elim.ll | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/CodeGen/X86/float-conv-elim.ll b/test/CodeGen/X86/float-conv-elim.ll new file mode 100644 index 0000000..3feff85 --- /dev/null +++ b/test/CodeGen/X86/float-conv-elim.ll @@ -0,0 +1,32 @@ +; RUN: llc -march=x86-64 -mcpu=x86-64 < %s | FileCheck %s + +; Make sure the float conversion is folded away as it should be. +; CHECK-LABEL: foo +; CHECK-NOT: cvt +; CHECK: movzbl +define i32 @foo(i8 %a) #0 { + %conv = uitofp i8 %a to float + %conv1 = fptosi float %conv to i32 + ret i32 %conv1 +} + +; CHECK-LABEL: foo2 +; CHECK-NOT: cvt +; CHECK: movsbl +define i32 @foo2(i8 %a) #0 { + %conv = sitofp i8 %a to float + %conv1 = fptosi float %conv to i32 + ret i32 %conv1 +} + +; CHECK-LABEL: bar +; CHECK-NOT: cvt +; CHECK: movl +define zeroext i8 @bar(i8 zeroext %a) #0 { + %conv = uitofp i8 %a to float + %conv1 = fptoui float %conv to i8 + ret i8 %conv1 +} + +attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } + |