This patch extends existing constant folding in logical operations to handle S_XNOR, S_NAND, S_NOR, S_ANDN2, S_ORN2, V_LSHL_ADD_U32 and V_AND_OR_B32. Also added a couple of tests for existing folds.
Diff Detail
Event Timeline
test/CodeGen/AMDGPU/constant-fold-imm-immreg.mir | ||
---|---|---|
209–211 | Somehow this MIR looks ancient. The virtual registers should have the class annotations and then you can drop the register section. You can use -run-pass=none to convert this (and after delete the frame info etc.) |
Ran constant-fold-imm-immreg.mir through llc -run-pass none and fixed up the result as requested. This adds register info to the virtual registers and allows deletion of the register sections of the resulting file.
LGTM with another minor round of test reduction
test/CodeGen/AMDGPU/constant-fold-imm-immreg.mir | ||
---|---|---|
135–137 | You can strip out all of these default false/0 fields too |
I didn't get this in before the break. When I returned, I integrated to ToT and re-ran tests, and got a bunch of failures. I'm pretty sure it's nothing to do with this change, but didn't want to commit as-is. I haven't had a chance to dig deeper. If there is a problem with this change, I'll want to re-review it.
You can strip out all of these default false/0 fields too