[PATCH] Sink integer extend into user blocks if the target type is going to be expanded.

Tim Northover t.p.northover at gmail.com
Thu Mar 6 07:42:05 PST 2014


  Hi Manuel,

  I think the heuristic seems reasonable to me, as does most of the code. I've got a couple of comments though:


================
Comment at: test/CodeGen/X86/mul128_sext_loop.ll:1
@@ +1,2 @@
+; RUN: llc < %s -march=x86-64 | grep mul | count 1
+
----------------
It's better to use FileCheck for tests, we're trying to get rid of grep and so on.

Some focused tests with "opt -codegenprep" would also be a good idea.

================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:2534
@@ +2533,3 @@
+bool CodeGenPrepare::SinkExtExpand(CastInst *CI) {
+  if (TLI->getTypeAction(CI->getContext(), TLI->getValueType(CI->getType())) ==
+      TargetLowering::TypeExpandInteger)
----------------
I don't think you know that TLI is non-null here (or in your other added case). Notice all the "if (TLI && ...)" tests around here.


http://llvm-reviews.chandlerc.com/D2973



More information about the llvm-commits mailing list