[PATCH] D122462: [PowerPC] Add guard in LowerSELECT_CC for ppcf128

Ting Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 24 22:52:49 PDT 2022


tingwang created this revision.
tingwang added reviewers: jsji, nemanjai, shchenz, PowerPC.
tingwang added a project: LLVM.
Herald added subscribers: kbarton, hiraditya.
Herald added a project: All.
tingwang requested review of this revision.
Herald added a subscriber: llvm-commits.

LowerSELECT_CC can be used to lower intrinsics for example __builtin_max. In the long double case, we need to add this check so that ppcf128 does not wrongly pickup PPCISD::XSMAXC.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122462

Files:
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp


Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
===================================================================
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -7913,7 +7913,8 @@
 
   // We have xsmaxc[dq]p/xsminc[dq]p which are OK to emit even in the
   // presence of infinities.
-  if (Subtarget.hasP9Vector() && LHS == TV && RHS == FV) {
+  if (Subtarget.hasP9Vector() && LHS == TV && RHS == FV &&
+      CmpVT != MVT::ppcf128) {
     switch (CC) {
     default:
       break;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122462.418134.patch
Type: text/x-patch
Size: 539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220325/d3634a71/attachment.bin>


More information about the llvm-commits mailing list