Two canonicalizations for select %x, 1, 0
If the return type is i1, return simply the condition %x, otherwise extui %x to the return type.
Paths 
  |  Differential  D116517  
[MLIR] Canonicalize/fold select %x, 1, 0 to extui ClosedPublic Authored by wsmoses on Jan 2 2022, 8:52 PM. 
Details Summary Two canonicalizations for select %x, 1, 0 If the return type is i1, return simply the condition %x, otherwise extui %x to the return type. 
Diff Detail 
 Event TimelineThis revision is now accepted and ready to land.Jan 2 2022, 10:24 PM Closed by commit rG93c791839a42: [MLIR] Canonicalize/fold select %x, 1, 0 to extui (authored by wsmoses).  ·  Explain WhyJan 2 2022, 10:26 PM This revision was automatically updated to reflect the committed changes. 
Revision Contents 
 
Diff 396997 mlir/lib/Dialect/StandardOps/IR/Ops.cpp
 mlir/test/Dialect/Standard/canonicalize.mlir
  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Can we also support select %arg, %c0, %c1?
Maybe extui (xor %arg, true) ?