Exclude bitcast and ext/trunc signbit optimization on ppc_fp128
authorEric Christopher <echristo@gmail.com>
Sat, 11 Apr 2020 00:06:17 +0000 (17:06 -0700)
committerEric Christopher <echristo@gmail.com>
Sat, 11 Apr 2020 00:07:55 +0000 (17:07 -0700)
commit45dca043957a43cd07715da40690a80504d37de0
tree10fc55b0f7250a603eb0c8cf4ccae5b781dd8b64
parentc81daab7d3bf10a36233934ae60261cb2716c987
Exclude bitcast and ext/trunc signbit optimization on ppc_fp128

Revision a1c05fe <https://reviews.llvm.org/rGa1c05fe20f3def1f1be9f50d2adefc6b6f1578ad>
removed bitcast from the list of problematic transformations, however:

  %97 = fptrunc ppc_fp128 %2 to double            // we need to check ppc_fp128 here to prevent the transformation
  %98 = bitcast double %97 to i64                 // a1c05fe checks ppc_fp128 at here
  %99 = icmp slt i64 %98, 0
  %100 = zext i1 %99 to i8
  store i8 %100, i8* %7, align 1

so this patch does that. I'm also disabling it in the presence of extend just in case.

I verified separately that the hash of -std::infinity and std::infinity don't match now.

Differential Revision: https://reviews.llvm.org/D77911
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/icmp.ll