Really I want this in the legalizer, but this is a start.
Diff Detail
Event Timeline
LGTM.
llvm/include/llvm/Target/GlobalISel/Combine.td | ||
---|---|---|
570 | Seems a bit questionable to call this a "known bits simplification", but I don't suppose it matters. | |
llvm/test/CodeGen/AMDGPU/GlobalISel/combine-urem-pow-2.mir | ||
34 | Isn't there a constant folding combine that should simplify this further? | |
llvm/test/CodeGen/AMDGPU/GlobalISel/urem.i32.ll | ||
210 | Maybe this is the same question as above, but: why doesn't this get constant folded to an s_mov ? |
llvm/include/llvm/Target/GlobalISel/Combine.td | ||
---|---|---|
570 | I wasn't sure where to group this, but it does depend on known bits | |
llvm/test/CodeGen/AMDGPU/GlobalISel/urem.i32.ll | ||
210 | We're missing constant folding combines for most operations. The only constant folding done is the implicit folding done by the MIRBuilder when the original inputs are constants |
llvm/test/CodeGen/AMDGPU/GlobalISel/urem.i32.ll | ||
---|---|---|
210 | Right but you use the builder to build this add: auto Add = Builder.buildAdd(Ty, Pow2Src1, NegOne); |
llvm/test/CodeGen/AMDGPU/GlobalISel/urem.i32.ll | ||
---|---|---|
210 | It looks like this isn't actually using the constant folding builder |
Seems a bit questionable to call this a "known bits simplification", but I don't suppose it matters.