Shiva Chen via llvm-dev
2017-Mar-17 03:08 UTC
[llvm-dev] Instruction Combine Cast (fptrunc (floor x)) -> (floor (fptrunc x))
Hi,
I have a test case would fail due to instruction combine cast
from floor to floorf.
double d = 1024.0 - 1.0 / 32768.0;
extern double floor(double);
extern float floorf(float);
extern void abort();
int main() {
float f1 = (float)floor(d);
if ((int)f1 != 1023)
abort ();
return 0;
}
My question is: Is the transformation legal for this case?
Thanks,
Shiva
Hal Finkel via llvm-dev
2017-Mar-17 13:31 UTC
[llvm-dev] Instruction Combine Cast (fptrunc (floor x)) -> (floor (fptrunc x))
Hi Shiva, Thanks for reporting this. It looks like a bug to me (from r292855). Can you file a bug report? Matt, can you fix this? -Hal On 03/16/2017 10:08 PM, Shiva Chen via llvm-dev wrote:> Hi, > > I have a test case would fail due to instruction combine cast > from floor to floorf. > > double d = 1024.0 - 1.0 / 32768.0; > extern double floor(double); > extern float floorf(float); > extern void abort(); > > int main() { > > float f1 = (float)floor(d); > > if ((int)f1 != 1023) > abort (); > > return 0; > } > > My question is: Is the transformation legal for this case? > > Thanks, > Shiva > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-- Hal Finkel Lead, Compiler Technology and Programming Languages Leadership Computing Facility Argonne National Laboratory
Matt Arsenault via llvm-dev
2017-Mar-17 23:07 UTC
[llvm-dev] Instruction Combine Cast (fptrunc (floor x)) -> (floor (fptrunc x))
> On Mar 17, 2017, at 06:31, Hal Finkel via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi Shiva, > > Thanks for reporting this. It looks like a bug to me (from r292855). Can you file a bug report? Matt, can you fix this? > > -Halhttps://reviews.llvm.org/D31107