[PATCH] D39108: [DAGCombine] Don't combine sext with extload if sextload is not supported and extload has multi users

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 27 10:21:11 PDT 2017


hfinkel added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:8278
+  // If sextload is not supported by target, we can only do the combine when
+  // load has one use.
   if (ISD::isEXTLoad(N0.getNode()) &&
----------------
How about adding to the comment:

  Doing otherwise can block folding the extload with other extends that the target does support.



================
Comment at: test/CodeGen/PowerPC/selectiondag-sextload.ll:14
+while.body:
+  %0 = load i8, i8* %p, align 1
+  %conv = zext i8 %0 to i32
----------------
Please check for the code you expect, not just the absence of the extra zext. We want to make sure we continue to generate efficient code.


https://reviews.llvm.org/D39108





More information about the llvm-commits mailing list