[PATCH] D32916: [DAGCombine] (addcarry 0, 0, X) -> (ext/trunc X)

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 14:16:22 PDT 2017


deadalnix added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:2146
+
+  // fold (addcarry 0, 0, X) -> (ext/trunc X) and no carry.
+  if (isNullConstant(N0) && isNullConstant(N1))
----------------
RKSimon wrote:
> I'm not sure if you can do this - aren't carry bits boolean types? So won't they be TargetLowering::BooleanContent? 
> 
> getBoolExtOrTrunc doesn't quite work - you're wanting a 0 or 1 result......
No they are whatever the target decides to use as boolean. All i1 are one after legalization.

I'm not sure, however, what's the correct way to extends this. What's wrong with getBoolExtOrTrunc ?


https://reviews.llvm.org/D32916





More information about the llvm-commits mailing list