[PATCH] D43037: [SelectionDAG] Add a helper function for creating a boolean constant based on the target's boolean content

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 11:49:32 PST 2018


craig.topper created this revision.
craig.topper added reviewers: spatel, efriedma, RKSimon.

This has been split off from https://reviews.llvm.org/D42948 where I was trying to add vector support to SimplifySetCC.

Many in SimplifySetCC and FoldSetCC try to create true or false constants. Some of them query getBooleanContents to figure out whether to use all ones or just 1 for true. But many places do not check and just use 1 without ensuring the VT has an i1 scalar type. Note sure if those places only trigger before type legalization so they only see an i1 
 type?

To cleanup the inconsistency and reduce some duplicated code, this patch adds a getBoolConstant method to SelectionDAG that takes are of querying getBooleanContents and doing the right thing.


https://reviews.llvm.org/D43037

Files:
  include/llvm/CodeGen/SelectionDAG.h
  lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  lib/CodeGen/SelectionDAG/TargetLowering.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43037.133270.patch
Type: text/x-patch
Size: 13790 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180207/f01bfe94/attachment.bin>


More information about the llvm-commits mailing list