Skip to content
Commit 9b611e43 authored by Craig Topper's avatar Craig Topper
Browse files

[SelectionDAG] Add a helper function for creating a boolean constant based on...

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

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.

Differential Revision: https://reviews.llvm.org/D43037

llvm-svn: 324634
parent 08d829da
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment