[PATCH] D45572: [X86] Replace action Promote with Custom for operation ISD::SINT_TO_FP

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 17 07:35:22 PDT 2018


spatel added inline comments.


================
Comment at: test/CodeGen/X86/sitofp.ll:3
+
+target triple = "i386-unknown-linux-gnu"
+
----------------
craig.topper wrote:
> vrybalov wrote:
> > vrybalov wrote:
> > > RKSimon wrote:
> > > > This test needs improving - you need to add proper FileCheck testing, preferably use the update_llc_test_checks script to check all codegen and cleanup the actual test - I'm not convinced you need all this code to demonstrate the sitofp?
> > > Main purpose of the test is to check llc doesn't hang on compilation. Now it hangs.
> > Without "target triple = "i386-unknown-linux-gnu"" the test passes compilation now.
> This should be sufficient to hit the bug
> 
> ```
> target triple = "i386-unknown-linux-gnu"
> 
> define double @foo(i16 %foo) #0 {
>   %conv = zext i16 %foo to i32
>   %conv1 = sitofp i32 %conv to double
>   ret double %conv1
> }
> 
> attributes #0 = { "use-soft-float"="true" }
> ```
The general rule is that if you're going to test something, then you might as well test that the output is *correct* rather than *not wrong*. The script that Simon mentioned makes that easy, especially now that the test is minimized. Please use FileCheck and the script for this test.


Repository:
  rL LLVM

https://reviews.llvm.org/D45572





More information about the llvm-commits mailing list