[PATCH] D81827: [CGP] Convert phi types

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 17 11:51:05 PDT 2020


efriedma added a comment.

> Am I right in saying that this would not be a problem under ARM?

Sort of.  There are two aspects here. One, what does the hardware do?  Two, what do optimizations do?  ARM obviously allows arbitrary values in floating-point registers, but this transform would be wrong if we started throwing away nan bits in float constants.

Currently, we essentially implement the model where we preserve NaN bits, except on 32-bit x86 where things sort of explode.  So until we actually start making changes, this is unlikely to actually break anything on ARM.  Maybe safer to guard this under a target hook so we don't make the situation on 32-bit x86 worse, though.



================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:5774
+        } else if (!isa<UndefValue>(V))
+          return false;
+      }
----------------
The list of Defs you're handling here is sort of a heuristic.  The transform itself doesn't really care.

I guess the choice of LoadInst and ExtractElementInst here is a reasonable conservative guess.  If we wanted to be more aggressive, we'd probably want to try to do some real cost estimate.


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

https://reviews.llvm.org/D81827





More information about the llvm-commits mailing list