[PATCH] D115885: [SDAG] remove FP-to-int cast attribute check in fold to FTRUNC

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 16 09:04:55 PST 2021


spatel created this revision.
spatel added reviewers: nikic, pengfei, RKSimon, craig.topper.
Herald added subscribers: ecnelises, hiraditya, mcrosier.
spatel requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

We were using a function attribute to indicate a non-standard FP mode, but now we can use intrinsics for that job as shown in the new tests.
Presumably the x86 asm could be improved for that IR with intrinsics, but I have not worked out exactly how to do that. Note that the transform to FTRUNC still requires a hacky check for "nsz" (because FMF are not applied to FP casts).

This is a cleanup based on the clang change in D115804 <https://reviews.llvm.org/D115804> / 8c7f2a4f87192 <https://reviews.llvm.org/rG8c7f2a4f871928d8734ee3f03e67d09086850b60> .
This is effectively a revert of 5a90285bd98d2 + D46237 <https://reviews.llvm.org/D46237> .


https://reviews.llvm.org/D115885

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/X86/ftrunc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115885.394894.patch
Type: text/x-patch
Size: 6249 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211216/ff0afd2c/attachment.bin>


More information about the llvm-commits mailing list