[PATCH] D68739: [GISel] Allow ConstantFoldBinOp to consider G_FCONSTANT binary representation for combines

Marcello Maggioni via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 10 12:20:04 PDT 2019


kariddi updated this revision to Diff 224441.
kariddi added a comment.
Herald added subscribers: nhaehnle, jvesely.

So, I changed the getConstantVRegValWithLookThrough function with an extra operand. Honestly I couldn't see any reason why the new parameter should have been set as "false" by default, so I set it to true, because it seems what the design of GlobalISel seems to suggest considering the difference of float/int being "not-there".

This allowed me to remove the getAnyConstantVRegVal() function and use the normal getConstantVRegVal()

Instead. A test in AMDGPU started to have different output from what I understand because of the new folding and I updated it


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68739/new/

https://reviews.llvm.org/D68739

Files:
  llvm/include/llvm/CodeGen/GlobalISel/Utils.h
  llvm/lib/CodeGen/GlobalISel/Utils.cpp
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-frint.mir
  llvm/unittests/CodeGen/GlobalISel/ConstantFoldingTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68739.224441.patch
Type: text/x-patch
Size: 16823 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191010/43cb91b5/attachment.bin>


More information about the llvm-commits mailing list