how to type-legalize a dag

I have added new instructions to my target, unfortunately they are not being properly type legalized. The instructions I’ve added are a vector add, vector load and a vector store. Can anyone lend a hand on how to legalize them so that my target would be able to recognize them.

Below is the output of llc with a -debug-only=isel. As you could see the output type for load, store, and add changes from v4i32 to i32 during legalization. How can I preserve the output type to v4i32?

Any help is greatly appreciated.

=== main
Initial selection DAG: BB#0 ‘main:entry’
SelectionDAG has 14 nodes:
0x3e7e2f0: ch = EntryToken

0x3ea45e0: i32 = undef

0x3e7e2f0:
0x3ea43d0: i32 = FrameIndex<1>

0x3ea45e0:
0x3ea46e8: v4i32,ch = load 0x3e7e2f0, 0x3ea43d0, 0x3ea45e0<LD16%a> [ORD=5]

0x3e7e2f0:
0x3ea47f0: i32 = FrameIndex<2>

0x3ea45e0:
0x3ea48f8: v4i32,ch = load 0x3e7e2f0, 0x3ea47f0, 0x3ea45e0<LD16%b> [ORD=6]

0x3ea4e20: i32 = Register %R11

0x3ea46e8:
0x3ea48f8:
0x3ea4c10: ch = TokenFactor 0x3ea46e8:1, 0x3ea48f8:1 [ORD=8]

0x3ea46e8:
0x3ea48f8:
0x3ea4a00: v4i32 = add 0x3ea46e8, 0x3ea48f8 [ORD=7]

0x3ea4b08: i32 = FrameIndex<0>

0x3ea45e0:
0x3ea4d18: ch = store 0x3ea4c10, 0x3ea4a00, 0x3ea4b08, 0x3ea45e0<ST16%z> [ORD=8]

0x3ea4e20:
0x3ea44d8: i32 = Constant<0>

0x3ea4f28: ch,glue = CopyToReg 0x3ea4d18, 0x3ea4e20, 0x3ea44d8 [ORD=9]

0x3ea4f28:
0x3ea4e20:
0x3ea4f28:
0x3ea5030: ch = EsenciaISD::RET_FLAG 0x3ea4f28, 0x3ea4e20, 0x3ea4f28:1 [ORD=9]

Optimized lowered selection DAG: BB#0 ‘main:entry’
SelectionDAG has 14 nodes:
0x3e7e2f0: ch = EntryToken

0x3ea45e0: i32 = undef

0x3e7e2f0:
0x3ea43d0: i32 = FrameIndex<1>

0x3ea45e0:
0x3ea46e8: v4i32,ch = load 0x3e7e2f0, 0x3ea43d0, 0x3ea45e0<LD16%a> [ORD=5]

0x3e7e2f0:
0x3ea47f0: i32 = FrameIndex<2>

0x3ea45e0:
0x3ea48f8: v4i32,ch = load 0x3e7e2f0, 0x3ea47f0, 0x3ea45e0<LD16%b> [ORD=6]

0x3ea4e20: i32 = Register %R11

0x3ea46e8:
0x3ea48f8:
0x3ea4c10: ch = TokenFactor 0x3ea46e8:1, 0x3ea48f8:1 [ORD=8]

0x3ea46e8:
0x3ea48f8:
0x3ea4a00: v4i32 = add 0x3ea46e8, 0x3ea48f8 [ORD=7]

0x3ea4b08: i32 = FrameIndex<0>

0x3ea45e0:
0x3ea4d18: ch = store 0x3ea4c10, 0x3ea4a00, 0x3ea4b08, 0x3ea45e0<ST16%z> [ORD=8]

0x3ea4e20:
0x3ea44d8: i32 = Constant<0>

0x3ea4f28: ch,glue = CopyToReg 0x3ea4d18, 0x3ea4e20, 0x3ea44d8 [ORD=9]

0x3ea4f28:
0x3ea4e20:
0x3ea4f28:
0x3ea5030: ch = EsenciaISD::RET_FLAG 0x3ea4f28, 0x3ea4e20, 0x3ea4f28:1 [ORD=9]

Type-legalized selection DAG: BB#0 ‘main:entry’
SelectionDAG has 46 nodes:
0x3e7e2f0: ch = EntryToken [ID=-3]

0x3ea43d0: i32 = FrameIndex<1> [ID=-3]

0x3ea45e0: i32 = undef [ID=-3]

0x3ea47f0: i32 = FrameIndex<2> [ID=-3]

0x3ea4b08: i32 = FrameIndex<0> [ID=-3]

0x3ea8520:
0x3ea7b70:
0x3ea7a68: ch = TokenFactor 0x3ea8520:1, 0x3ea7b70:1 [ORD=5] [ID=-3]

0x3ea7648:
0x3ea7540:
0x3ea7438: ch = TokenFactor 0x3ea7648:1, 0x3ea7540:1 [ORD=5] [ID=-3]

0x3ea6f10: ch = TokenFactor 0x3ea7a68, 0x3ea7438 [ORD=5] [ID=-3]

0x3eab3a0:
0x3eab190:
0x3eaae78: ch = TokenFactor 0x3eab3a0:1, 0x3eab190:1 [ORD=6] [ID=-3]

0x3eaa950:
0x3ea9288:
0x3ea8f70: ch = TokenFactor 0x3eaa950:1, 0x3ea9288:1 [ORD=6] [ID=-3]

0x3ea8940: ch = TokenFactor 0x3eaae78, 0x3ea8f70 [ORD=6] [ID=-3]

0x3ea4c10: ch = TokenFactor 0x3ea6f10, 0x3ea8940 [ORD=8] [ID=-3]

0x3ea4e20: i32 = Register %R11 [ID=-3]

0x3ea4c10:
0x3ea8520:
0x3eab3a0:
0x3eab4a8: i32 = add 0x3ea8520, 0x3eab3a0 [ORD=7] [ID=-3]

0x3ea4b08:
0x3ea45e0:
0x3eac5c0: ch = store 0x3ea4c10, 0x3eab4a8, 0x3ea4b08, 0x3ea45e0<ST4[%z]> [ORD=8] [ID=-3]

0x3ea4c10:
0x3ea7b70:
0x3eab190:
0x3eab298: i32 = add 0x3ea7b70, 0x3eab190 [ORD=7] [ID=-3]

0x3ea4b08:
0x3ea7120:
0x3eac1a0: i32 = add 0x3ea4b08, 0x3ea7120 [ORD=8] [ID=-3]

0x3ea45e0:
0x3eac4b8: ch = store 0x3ea4c10, 0x3eab298, 0x3eac1a0, 0x3ea45e0<ST4[%z+4]> [ORD=8] [ID=-3]

0x3eac3b0: ch = TokenFactor 0x3eac5c0, 0x3eac4b8 [ORD=8] [ID=-3]

0x3ea4c10:
0x3ea7648:
0x3eaa950:
0x3eaaa58: i32 = add 0x3ea7648, 0x3eaa950 [ORD=7] [ID=-3]

0x3eab6b8:
0x3ea45e0:
0x3eabf90: ch = store 0x3ea4c10, 0x3eaaa58, 0x3eab6b8, 0x3ea45e0<ST4[%z+8]> [ORD=8] [ID=-3]

0x3ea4c10:
0x3ea7540:
0x3ea9288:
0x3ea9390: i32 = add 0x3ea7540, 0x3ea9288 [ORD=7] [ID=-3]

0x3eab6b8:
0x3ea7120:
0x3eabb70: i32 = add 0x3eab6b8, 0x3ea7120 [ORD=8] [ID=-3]

0x3ea45e0:
0x3eabe88: ch = store 0x3ea4c10, 0x3ea9390, 0x3eabb70, 0x3ea45e0<ST4[%z+12]> [ORD=8] [ID=-3]

0x3eabd80: ch = TokenFactor 0x3eabf90, 0x3eabe88 [ORD=8] [ID=-3]

0x3eab960: ch = TokenFactor 0x3eac3b0, 0x3eabd80 [ORD=8] [ID=-3]

0x3ea4e20:
0x3ea44d8: i32 = Constant<0> [ID=-3]

0x3ea4f28: ch,glue = CopyToReg 0x3eab960, 0x3ea4e20, 0x3ea44d8 [ORD=9] [ID=-3]

0x3ea5240: i32 = Constant<8> [ID=-3]

0x3ea43d0:
0x3ea5240:
0x3ea6d00: i32 = add 0x3ea43d0, 0x3ea5240 [ORD=5] [ID=-3]

0x3ea7120: i32 = Constant<4> [ID=-3]

0x3e7e2f0:
0x3ea6d00:
0x3ea7120:
0x3ea7228: i32 = add 0x3ea6d00, 0x3ea7120 [ORD=5] [ID=-3]

0x3ea45e0:
0x3ea7540: i32,ch = load 0x3e7e2f0, 0x3ea7228, 0x3ea45e0<LD4[%a+12]> [ORD=5] [ID=-3]

0x3e7e2f0:
0x3ea6d00:
0x3ea45e0:
0x3ea7648: i32,ch = load 0x3e7e2f0, 0x3ea6d00, 0x3ea45e0<LD4[%a+8]> [ORD=5] [ID=-3]

0x3e7e2f0:
0x3ea43d0:
0x3ea7120:
0x3ea7858: i32 = add 0x3ea43d0, 0x3ea7120 [ORD=5] [ID=-3]

0x3ea45e0:
0x3ea7b70: i32,ch = load 0x3e7e2f0, 0x3ea7858, 0x3ea45e0<LD4[%a+4]> [ORD=5] [ID=-3]

0x3e7e2f0:
0x3ea43d0:
0x3ea45e0:
0x3ea8520: i32,ch = load 0x3e7e2f0, 0x3ea43d0, 0x3ea45e0<LD4[%a]> [ORD=5] [ID=-3]

0x3ea47f0:
0x3ea5240:
0x3ea8730: i32 = add 0x3ea47f0, 0x3ea5240 [ORD=6] [ID=-3]

0x3e7e2f0:
0x3ea8730:
0x3ea7120:
0x3ea8d60: i32 = add 0x3ea8730, 0x3ea7120 [ORD=6] [ID=-3]

0x3ea45e0:
0x3ea9288: i32,ch = load 0x3e7e2f0, 0x3ea8d60, 0x3ea45e0<LD4[%b+12]> [ORD=6] [ID=-3]

0x3e7e2f0:
0x3ea8730:
0x3ea45e0:
0x3eaa950: i32,ch = load 0x3e7e2f0, 0x3ea8730, 0x3ea45e0<LD4[%b+8]> [ORD=6] [ID=-3]

0x3e7e2f0:
0x3ea47f0:
0x3ea7120:
0x3eaac68: i32 = add 0x3ea47f0, 0x3ea7120 [ORD=6] [ID=-3]

0x3ea45e0:
0x3eab190: i32,ch = load 0x3e7e2f0, 0x3eaac68, 0x3ea45e0<LD4[%b+4]> [ORD=6] [ID=-3]

0x3e7e2f0:
0x3ea47f0:
0x3ea45e0:
0x3eab3a0: i32,ch = load 0x3e7e2f0, 0x3ea47f0, 0x3ea45e0<LD4[%b]> [ORD=6] [ID=-3]

0x3ea4b08:
0x3ea5240:
0x3eab6b8: i32 = add 0x3ea4b08, 0x3ea5240 [ORD=8] [ID=-3]

0x3ea4f28:
0x3ea4e20:
0x3ea4f28:
0x3ea5030: ch = EsenciaISD::RET_FLAG 0x3ea4f28, 0x3ea4e20, 0x3ea4f28:1 [ORD=9] [ID=-3]

Optimized type-legalized selection DAG: BB#0 ‘main:entry’
SelectionDAG has 39 nodes:
0x3e7e2f0: ch = EntryToken [ID=-3]

0x3ea43d0: i32 = FrameIndex<1> [ID=-3]

0x3ea45e0: i32 = undef [ID=-3]

0x3ea47f0: i32 = FrameIndex<2> [ID=-3]

0x3ea4b08: i32 = FrameIndex<0> [ID=-3]

0x3ea4e20: i32 = Register %R11 [ID=-3]

0x3ea7a68:
0x3ea8520:
0x3eab3a0:
0x3eab4a8: i32 = add 0x3ea8520, 0x3eab3a0 [ORD=7] [ID=-3]

0x3ea4b08:
0x3ea45e0:
0x3eac5c0: ch = store 0x3ea7a68, 0x3eab4a8, 0x3ea4b08, 0x3ea45e0<ST4[%z]> [ORD=8] [ID=-3]

0x3ea7a68:
0x3ea7b70:
0x3eab190:
0x3eab298: i32 = add 0x3ea7b70, 0x3eab190 [ORD=7] [ID=-3]

0x3ea4b08:
0x3ea7120:
0x3eac1a0: i32 = add 0x3ea4b08, 0x3ea7120 [ORD=8] [ID=-3]

0x3ea45e0:
0x3eac4b8: ch = store 0x3ea7a68, 0x3eab298, 0x3eac1a0, 0x3ea45e0<ST4[%z+4]> [ORD=8] [ID=-3]

0x3ea7a68:
0x3ea7648:
0x3eaa950:
0x3eaaa58: i32 = add 0x3ea7648, 0x3eaa950 [ORD=7] [ID=-3]

0x3ea4b08:
0x3ea5240:
0x3eab6b8: i32 = add 0x3ea4b08, 0x3ea5240 [ORD=8] [ID=-3]

0x3ea45e0:
0x3eabf90: ch = store 0x3ea7a68, 0x3eaaa58, 0x3eab6b8, 0x3ea45e0<ST4[%z+8]> [ORD=8] [ID=-3]

0x3ea7a68:
0x3ea7540:
0x3ea9288:
0x3ea9390: i32 = add 0x3ea7540, 0x3ea9288 [ORD=7] [ID=-3]

0x3ea4b08:
0x3ea46e8:
0x3ea48f8: i32 = add 0x3ea4b08, 0x3ea46e8 [ORD=8]

0x3ea45e0:
0x3eabe88: ch = store 0x3ea7a68, 0x3ea9390, 0x3ea48f8, 0x3ea45e0<ST4[%z+12]> [ORD=8] [ID=-3]

0x3eabb70: ch = TokenFactor 0x3eac5c0, 0x3eac4b8, 0x3eabf90, 0x3eabe88 [ORD=8]

0x3ea4e20:
0x3ea44d8: i32 = Constant<0> [ID=-3]

0x3ea4f28: ch,glue = CopyToReg 0x3eabb70, 0x3ea4e20, 0x3ea44d8 [ORD=9] [ID=-3]

0x3ea5240: i32 = Constant<8> [ID=-3]

0x3ea7120: i32 = Constant<4> [ID=-3]

0x3e7e2f0:
0x3ea43d0:
0x3ea46e8:
0x3eaae78: i32 = add 0x3ea43d0, 0x3ea46e8 [ORD=5]

0x3ea45e0:
0x3ea7540: i32,ch = load 0x3e7e2f0, 0x3eaae78, 0x3ea45e0<LD4[%a+12]> [ORD=5] [ID=-3]

0x3e7e2f0:
0x3ea43d0:
0x3ea5240:
0x3ea6d00: i32 = add 0x3ea43d0, 0x3ea5240 [ORD=5] [ID=-3]

0x3ea45e0:
0x3ea7648: i32,ch = load 0x3e7e2f0, 0x3ea6d00, 0x3ea45e0<LD4[%a+8]> [ORD=5] [ID=-3]

0x3e7e2f0:
0x3ea43d0:
0x3ea7120:
0x3ea7858: i32 = add 0x3ea43d0, 0x3ea7120 [ORD=5] [ID=-3]

0x3ea45e0:
0x3ea7b70: i32,ch = load 0x3e7e2f0, 0x3ea7858, 0x3ea45e0<LD4[%a+4]> [ORD=5] [ID=-3]

0x3e7e2f0:
0x3ea43d0:
0x3ea45e0:
0x3ea8520: i32,ch = load 0x3e7e2f0, 0x3ea43d0, 0x3ea45e0<LD4[%a]> [ORD=5] [ID=-3]

0x3e7e2f0:
0x3ea47f0:
0x3ea46e8:
0x3eac3b0: i32 = add 0x3ea47f0, 0x3ea46e8 [ORD=6]

0x3ea45e0:
0x3ea9288: i32,ch = load 0x3e7e2f0, 0x3eac3b0, 0x3ea45e0<LD4[%b+12]> [ORD=6] [ID=-3]

0x3e7e2f0:
0x3ea47f0:
0x3ea5240:
0x3ea8730: i32 = add 0x3ea47f0, 0x3ea5240 [ORD=6] [ID=-3]

0x3ea45e0:
0x3eaa950: i32,ch = load 0x3e7e2f0, 0x3ea8730, 0x3ea45e0<LD4[%b+8]> [ORD=6] [ID=-3]

0x3e7e2f0:
0x3ea47f0:
0x3ea7120:
0x3eaac68: i32 = add 0x3ea47f0, 0x3ea7120 [ORD=6] [ID=-3]

0x3ea45e0:
0x3eab190: i32,ch = load 0x3e7e2f0, 0x3eaac68, 0x3ea45e0<LD4[%b+4]> [ORD=6] [ID=-3]

0x3e7e2f0:
0x3ea47f0:
0x3ea45e0:
0x3eab3a0: i32,ch = load 0x3e7e2f0, 0x3ea47f0, 0x3ea45e0<LD4[%b]> [ORD=6] [ID=-3]

0x3ea46e8: i32 = Constant<12>

0x3ea8520:
0x3ea7b70:
0x3ea7648:
0x3ea7540:
0x3eab3a0:
0x3eab190:
0x3eaa950:
0x3ea9288:
0x3ea7a68: ch = TokenFactor 0x3ea8520:1, 0x3ea7b70:1, 0x3ea7648:1, 0x3ea7540:1, 0x3eab3a0:1, 0x3eab190:1, 0x3eaa950:1, 0x3ea9288:1 [ORD=8]

0x3ea4f28:
0x3ea4e20:
0x3ea4f28:
0x3ea5030: ch = EsenciaISD::RET_FLAG 0x3ea4f28, 0x3ea4e20, 0x3ea4f28:1 [ORD=9] [ID=-3]

Legalized selection DAG: BB#0 ‘main:entry’
SelectionDAG has 39 nodes:
0x3e7e2f0: ch = EntryToken [ID=0]

0x3ea43d0: i32 = FrameIndex<1> [ID=1]

0x3ea45e0: i32 = undef [ID=3]

0x3ea47f0: i32 = FrameIndex<2> [ID=4]

0x3ea4b08: i32 = FrameIndex<0> [ID=5]

0x3ea4e20: i32 = Register %R11 [ID=6]

0x3ea5240: i32 = Constant<8> [ID=7]

0x3ea7120: i32 = Constant<4> [ID=8]

0x3ea46e8: i32 = Constant<12> [ID=9]

0x3e7e2f0:
0x3ea43d0:
0x3ea45e0:
0x3ea8520: i32,ch = load 0x3e7e2f0, 0x3ea43d0, 0x3ea45e0<LD4[%a]> [ORD=5] [ID=10]

0x3e7e2f0:
0x3ea47f0:
0x3ea45e0:
0x3eab3a0: i32,ch = load 0x3e7e2f0, 0x3ea47f0, 0x3ea45e0<LD4[%b]> [ORD=6] [ID=11]

0x3e7e2f0:
0x3ea47f0:
0x3ea5240:
0x3ea8730: i32 = add 0x3ea47f0, 0x3ea5240 [ORD=6] [ID=13]

0x3ea45e0:
0x3eaa950: i32,ch = load 0x3e7e2f0, 0x3ea8730, 0x3ea45e0<LD4[%b+8]> [ORD=6] [ID=22]

0x3e7e2f0:
0x3ea43d0:
0x3ea5240:
0x3ea6d00: i32 = add 0x3ea43d0, 0x3ea5240 [ORD=5] [ID=14]

0x3ea45e0:
0x3ea7648: i32,ch = load 0x3e7e2f0, 0x3ea6d00, 0x3ea45e0<LD4[%a+8]> [ORD=5] [ID=23]

0x3e7e2f0:
0x3ea47f0:
0x3ea7120:
0x3eaac68: i32 = add 0x3ea47f0, 0x3ea7120 [ORD=6] [ID=16]

0x3ea45e0:
0x3eab190: i32,ch = load 0x3e7e2f0, 0x3eaac68, 0x3ea45e0<LD4[%b+4]> [ORD=6] [ID=24]

0x3e7e2f0:
0x3ea43d0:
0x3ea7120:
0x3ea7858: i32 = add 0x3ea43d0, 0x3ea7120 [ORD=5] [ID=17]

0x3ea45e0:
0x3ea7b70: i32,ch = load 0x3e7e2f0, 0x3ea7858, 0x3ea45e0<LD4[%a+4]> [ORD=5] [ID=25]

0x3e7e2f0:
0x3ea43d0:
0x3ea46e8:
0x3eaae78: i32 = add 0x3ea43d0, 0x3ea46e8 [ORD=5] [ID=18]

0x3ea45e0:
0x3ea7540: i32,ch = load 0x3e7e2f0, 0x3eaae78, 0x3ea45e0<LD4[%a+12]> [ORD=5] [ID=26]

0x3e7e2f0:
0x3ea47f0:
0x3ea46e8:
0x3eac3b0: i32 = add 0x3ea47f0, 0x3ea46e8 [ORD=6] [ID=19]

0x3ea45e0:
0x3ea9288: i32,ch = load 0x3e7e2f0, 0x3eac3b0, 0x3ea45e0<LD4[%b+12]> [ORD=6] [ID=27]

0x3ea8520:
0x3ea7b70:
0x3ea7648:
0x3ea7540:
0x3eab3a0:
0x3eab190:
0x3eaa950:
0x3ea9288:
0x3ea7a68: ch = TokenFactor 0x3ea8520:1, 0x3ea7b70:1, 0x3ea7648:1, 0x3ea7540:1, 0x3eab3a0:1, 0x3eab190:1, 0x3eaa950:1, 0x3ea9288:1 [ORD=8] [ID=30]

0x3ea7a68:
0x3ea8520:
0x3eab3a0:
0x3eab4a8: i32 = add 0x3ea8520, 0x3eab3a0 [ORD=7] [ID=21]

0x3ea4b08:
0x3ea45e0:
0x3eac5c0: ch = store 0x3ea7a68, 0x3eab4a8, 0x3ea4b08, 0x3ea45e0<ST4[%z]> [ORD=8] [ID=34]

0x3ea7a68:
0x3ea7b70:
0x3eab190:
0x3eab298: i32 = add 0x3ea7b70, 0x3eab190 [ORD=7] [ID=29]

0x3ea4b08:
0x3ea7120:
0x3eac1a0: i32 = add 0x3ea4b08, 0x3ea7120 [ORD=8] [ID=15]

0x3ea45e0:
0x3eac4b8: ch = store 0x3ea7a68, 0x3eab298, 0x3eac1a0, 0x3ea45e0<ST4[%z+4]> [ORD=8] [ID=33]

0x3ea7a68:
0x3ea7648:
0x3eaa950:
0x3eaaa58: i32 = add 0x3ea7648, 0x3eaa950 [ORD=7] [ID=28]

0x3ea4b08:
0x3ea5240:
0x3eab6b8: i32 = add 0x3ea4b08, 0x3ea5240 [ORD=8] [ID=12]

0x3ea45e0:
0x3eabf90: ch = store 0x3ea7a68, 0x3eaaa58, 0x3eab6b8, 0x3ea45e0<ST4[%z+8]> [ORD=8] [ID=32]

0x3ea7a68:
0x3ea7540:
0x3ea9288:
0x3ea9390: i32 = add 0x3ea7540, 0x3ea9288 [ORD=7] [ID=31]

0x3ea4b08:
0x3ea46e8:
0x3ea48f8: i32 = add 0x3ea4b08, 0x3ea46e8 [ORD=8] [ID=20]

0x3ea45e0:
0x3eabe88: ch = store 0x3ea7a68, 0x3ea9390, 0x3ea48f8, 0x3ea45e0<ST4[%z+12]> [ORD=8] [ID=35]

0x3eabb70: ch = TokenFactor 0x3eac5c0, 0x3eac4b8, 0x3eabf90, 0x3eabe88 [ORD=8] [ID=36]

0x3ea4e20:
0x3ea44d8: i32 = Constant<0> [ID=2]

0x3ea4f28: ch,glue = CopyToReg 0x3eabb70, 0x3ea4e20, 0x3ea44d8 [ORD=9] [ID=37]

0x3ea4f28:
0x3ea4e20:
0x3ea4f28:
0x3ea5030: ch = EsenciaISD::RET_FLAG 0x3ea4f28, 0x3ea4e20, 0x3ea4f28:1 [ORD=9] [ID=38]

Optimized legalized selection DAG: BB#0 ‘main:entry’
SelectionDAG has 39 nodes:
0x3e7e2f0: ch = EntryToken [ID=0]

0x3ea43d0: i32 = FrameIndex<1> [ID=1]

0x3ea45e0: i32 = undef [ID=3]

0x3ea47f0: i32 = FrameIndex<2> [ID=4]

0x3ea4b08: i32 = FrameIndex<0> [ID=5]

0x3ea4e20: i32 = Register %R11 [ID=6]

0x3ea5240: i32 = Constant<8> [ID=7]

0x3ea7120: i32 = Constant<4> [ID=8]

0x3ea46e8: i32 = Constant<12> [ID=9]

0x3e7e2f0:
0x3ea43d0:
0x3ea45e0:
0x3ea8520: i32,ch = load 0x3e7e2f0, 0x3ea43d0, 0x3ea45e0<LD4[%a]> [ORD=5] [ID=10]

0x3e7e2f0:
0x3ea47f0:
0x3ea45e0:
0x3eab3a0: i32,ch = load 0x3e7e2f0, 0x3ea47f0, 0x3ea45e0<LD4[%b]> [ORD=6] [ID=11]

0x3e7e2f0:
0x3ea47f0:
0x3ea5240:
0x3ea8730: i32 = add 0x3ea47f0, 0x3ea5240 [ORD=6] [ID=13]

0x3ea45e0:
0x3eaa950: i32,ch = load 0x3e7e2f0, 0x3ea8730, 0x3ea45e0<LD4[%b+8]> [ORD=6] [ID=22]

0x3e7e2f0:
0x3ea43d0:
0x3ea5240:
0x3ea6d00: i32 = add 0x3ea43d0, 0x3ea5240 [ORD=5] [ID=14]

0x3ea45e0:
0x3ea7648: i32,ch = load 0x3e7e2f0, 0x3ea6d00, 0x3ea45e0<LD4[%a+8]> [ORD=5] [ID=23]

0x3e7e2f0:
0x3ea47f0:
0x3ea7120:
0x3eaac68: i32 = add 0x3ea47f0, 0x3ea7120 [ORD=6] [ID=16]

0x3ea45e0:
0x3eab190: i32,ch = load 0x3e7e2f0, 0x3eaac68, 0x3ea45e0<LD4[%b+4]> [ORD=6] [ID=24]

0x3e7e2f0:
0x3ea43d0:
0x3ea7120:
0x3ea7858: i32 = add 0x3ea43d0, 0x3ea7120 [ORD=5] [ID=17]

0x3ea45e0:
0x3ea7b70: i32,ch = load 0x3e7e2f0, 0x3ea7858, 0x3ea45e0<LD4[%a+4]> [ORD=5] [ID=25]

0x3e7e2f0:
0x3ea43d0:
0x3ea46e8:
0x3eaae78: i32 = add 0x3ea43d0, 0x3ea46e8 [ORD=5] [ID=18]

0x3ea45e0:
0x3ea7540: i32,ch = load 0x3e7e2f0, 0x3eaae78, 0x3ea45e0<LD4[%a+12]> [ORD=5] [ID=26]

0x3e7e2f0:
0x3ea47f0:
0x3ea46e8:
0x3eac3b0: i32 = add 0x3ea47f0, 0x3ea46e8 [ORD=6] [ID=19]

0x3ea45e0:
0x3ea9288: i32,ch = load 0x3e7e2f0, 0x3eac3b0, 0x3ea45e0<LD4[%b+12]> [ORD=6] [ID=27]

0x3ea8520:
0x3ea7b70:
0x3ea7648:
0x3ea7540:
0x3eab3a0:
0x3eab190:
0x3eaa950:
0x3ea9288:
0x3ea7a68: ch = TokenFactor 0x3ea8520:1, 0x3ea7b70:1, 0x3ea7648:1, 0x3ea7540:1, 0x3eab3a0:1, 0x3eab190:1, 0x3eaa950:1, 0x3ea9288:1 [ORD=8] [ID=30]

0x3ea7a68:
0x3ea8520:
0x3eab3a0:
0x3eab4a8: i32 = add 0x3ea8520, 0x3eab3a0 [ORD=7] [ID=21]

0x3ea4b08:
0x3ea45e0:
0x3eac5c0: ch = store 0x3ea7a68, 0x3eab4a8, 0x3ea4b08, 0x3ea45e0<ST4[%z]> [ORD=8] [ID=34]

0x3ea7a68:
0x3ea7b70:
0x3eab190:
0x3eab298: i32 = add 0x3ea7b70, 0x3eab190 [ORD=7] [ID=29]

0x3ea4b08:
0x3ea7120:
0x3eac1a0: i32 = add 0x3ea4b08, 0x3ea7120 [ORD=8] [ID=15]

0x3ea45e0:
0x3eac4b8: ch = store 0x3ea7a68, 0x3eab298, 0x3eac1a0, 0x3ea45e0<ST4[%z+4]> [ORD=8] [ID=33]

0x3ea7a68:
0x3ea7648:
0x3eaa950:
0x3eaaa58: i32 = add 0x3ea7648, 0x3eaa950 [ORD=7] [ID=28]

0x3ea4b08:
0x3ea5240:
0x3eab6b8: i32 = add 0x3ea4b08, 0x3ea5240 [ORD=8] [ID=12]

0x3ea45e0:
0x3eabf90: ch = store 0x3ea7a68, 0x3eaaa58, 0x3eab6b8, 0x3ea45e0<ST4[%z+8]> [ORD=8] [ID=32]

0x3ea7a68:
0x3ea7540:
0x3ea9288:
0x3ea9390: i32 = add 0x3ea7540, 0x3ea9288 [ORD=7] [ID=31]

0x3ea4b08:
0x3ea46e8:
0x3ea48f8: i32 = add 0x3ea4b08, 0x3ea46e8 [ORD=8] [ID=20]

0x3ea45e0:
0x3eabe88: ch = store 0x3ea7a68, 0x3ea9390, 0x3ea48f8, 0x3ea45e0<ST4[%z+12]> [ORD=8] [ID=35]

0x3eabb70: ch = TokenFactor 0x3eac5c0, 0x3eac4b8, 0x3eabf90, 0x3eabe88 [ORD=8] [ID=36]

0x3ea4e20:
0x3ea44d8: i32 = Constant<0> [ID=2]

0x3ea4f28: ch,glue = CopyToReg 0x3eabb70, 0x3ea4e20, 0x3ea44d8 [ORD=9] [ID=37]

0x3ea4f28:
0x3ea4e20:
0x3ea4f28:
0x3ea5030: ch = EsenciaISD::RET_FLAG 0x3ea4f28, 0x3ea4e20, 0x3ea4f28:1 [ORD=9] [ID=38]

===== Instruction selection begins: BB#0 ‘entry’
ISEL: Starting pattern match on root node: 0x3ea5030: ch = EsenciaISD::RET_FLAG 0x3ea4f28, 0x3ea4e20, 0x3ea4f28:1 [ORD=9] [ID=38]

Morphed node: 0x3ea5030: ch = RET 0x3ea4e20, 0x3ea4f28, 0x3ea4f28:1 [ORD=9]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3eabe88: ch = store 0x3ea7a68, 0x3ea9390, 0x3ea48f8, 0x3ea45e0<ST4[%z+12]> [ORD=8] [ID=35]

Initial Opcode index to 4
Morphed node: 0x3eabe88: ch = SW 0x3ea9390, 0x3ea7228, 0x3ea8d60, 0x3ea7a68Mem:ST4[%z+12] [ORD=8]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3eac5c0: ch = store 0x3ea7a68, 0x3eab4a8, 0x3ea4b08, 0x3ea45e0<ST4[%z]> [ORD=8] [ID=34]

Initial Opcode index to 4
Morphed node: 0x3eac5c0: ch = SW 0x3eab4a8, 0x3ea7228, 0x3ea48f8, 0x3ea7a68Mem:ST4[%z] [ORD=8]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3eac4b8: ch = store 0x3ea7a68, 0x3eab298, 0x3eac1a0, 0x3ea45e0<ST4[%z+4]> [ORD=8] [ID=33]

Initial Opcode index to 4
Morphed node: 0x3eac4b8: ch = SW 0x3eab298, 0x3ea7228, 0x3ea4c10, 0x3ea7a68Mem:ST4[%z+4] [ORD=8]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3eabf90: ch = store 0x3ea7a68, 0x3eaaa58, 0x3eab6b8, 0x3ea45e0<ST4[%z+8]> [ORD=8] [ID=32]

Initial Opcode index to 4
Morphed node: 0x3eabf90: ch = SW 0x3eaaa58, 0x3ea7228, 0x3eac1a0, 0x3ea7a68Mem:ST4[%z+8] [ORD=8]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3ea9390: i32 = add 0x3ea7540, 0x3ea9288 [ORD=7] [ID=31]

Initial Opcode index to 1084
Match failed at index 1090
Continuing at 1122
Morphed node: 0x3ea9390: i32 = ADD 0x3ea7540, 0x3ea9288 [ORD=7]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3eab298: i32 = add 0x3ea7b70, 0x3eab190 [ORD=7] [ID=29]

Initial Opcode index to 1084
Match failed at index 1090
Continuing at 1122
Morphed node: 0x3eab298: i32 = ADD 0x3ea7b70, 0x3eab190 [ORD=7]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3eaaa58: i32 = add 0x3ea7648, 0x3eaa950 [ORD=7] [ID=28]

Initial Opcode index to 1084
Match failed at index 1090
Continuing at 1122
Morphed node: 0x3eaaa58: i32 = ADD 0x3ea7648, 0x3eaa950 [ORD=7]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3ea9288: i32,ch = load 0x3e7e2f0, 0x3eac3b0, 0x3ea45e0<LD4[%b+12]> [ORD=6] [ID=27]

Initial Opcode index to 122
Morphed node: 0x3ea9288: i32,ch = LWZ 0x3ea4b08, 0x3ea8d60, 0x3e7e2f0Mem:LD4[%b+12] [ORD=6]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3ea7540: i32,ch = load 0x3e7e2f0, 0x3eaae78, 0x3ea45e0<LD4[%a+12]> [ORD=5] [ID=26]

Initial Opcode index to 122
Morphed node: 0x3ea7540: i32,ch = LWZ 0x3eac3b0, 0x3ea8d60, 0x3e7e2f0Mem:LD4[%a+12] [ORD=5]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3ea7b70: i32,ch = load 0x3e7e2f0, 0x3ea7858, 0x3ea45e0<LD4[%a+4]> [ORD=5] [ID=25]

Initial Opcode index to 122
Morphed node: 0x3ea7b70: i32,ch = LWZ 0x3eac3b0, 0x3ea4c10, 0x3e7e2f0Mem:LD4[%a+4] [ORD=5]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3eab190: i32,ch = load 0x3e7e2f0, 0x3eaac68, 0x3ea45e0<LD4[%b+4]> [ORD=6] [ID=24]

Initial Opcode index to 122
Morphed node: 0x3eab190: i32,ch = LWZ 0x3ea4b08, 0x3ea4c10, 0x3e7e2f0Mem:LD4[%b+4] [ORD=6]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3ea7648: i32,ch = load 0x3e7e2f0, 0x3ea6d00, 0x3ea45e0<LD4[%a+8]> [ORD=5] [ID=23]

Initial Opcode index to 122
Morphed node: 0x3ea7648: i32,ch = LWZ 0x3eac3b0, 0x3eac1a0, 0x3e7e2f0Mem:LD4[%a+8] [ORD=5]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3eaa950: i32,ch = load 0x3e7e2f0, 0x3ea8730, 0x3ea45e0<LD4[%b+8]> [ORD=6] [ID=22]

Initial Opcode index to 122
Morphed node: 0x3eaa950: i32,ch = LWZ 0x3ea4b08, 0x3eac1a0, 0x3e7e2f0Mem:LD4[%b+8] [ORD=6]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3eab4a8: i32 = add 0x3ea8520, 0x3eab3a0 [ORD=7] [ID=21]

Initial Opcode index to 1084
Match failed at index 1090
Continuing at 1122
Morphed node: 0x3eab4a8: i32 = ADD 0x3ea8520, 0x3eab3a0 [ORD=7]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3eab3a0: i32,ch = load 0x3e7e2f0, 0x3ea47f0, 0x3ea45e0<LD4[%b]> [ORD=6] [ID=11]

Initial Opcode index to 122
Morphed node: 0x3eab3a0: i32,ch = LWZ 0x3ea4b08, 0x3ea48f8, 0x3e7e2f0Mem:LD4[%b] [ORD=6]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3ea8520: i32,ch = load 0x3e7e2f0, 0x3ea43d0, 0x3ea45e0<LD4[%a]> [ORD=5] [ID=10]

Initial Opcode index to 122
Morphed node: 0x3ea8520: i32,ch = LWZ 0x3eac3b0, 0x3ea48f8, 0x3e7e2f0Mem:LD4[%a] [ORD=5]

ISEL: Match complete!
ISEL: Starting pattern match on root node: 0x3ea44d8: i32 = Constant<0> [ID=2]

Initial Opcode index to 1684
Morphed node: 0x3ea44d8: i32 = MOVHI 0x3ea48f8

ISEL: Match complete!
===== Instruction selection ends:
Selected selection DAG: BB#0 ‘main:entry’
SelectionDAG has 30 nodes:
0x3e7e2f0: ch = EntryToken

0x3ea4e20: i32 = Register %R11

0x3eac3b0:
0x3ea48f8:
0x3e7e2f0:
0x3ea8520: i32,ch = LWZ 0x3eac3b0, 0x3ea48f8, 0x3e7e2f0Mem:LD4[%a] [ORD=5]

0x3ea4b08:
0x3ea48f8:
0x3e7e2f0:
0x3eab3a0: i32,ch = LWZ 0x3ea4b08, 0x3ea48f8, 0x3e7e2f0Mem:LD4[%b] [ORD=6]

0x3ea4b08:
0x3eac1a0:
0x3e7e2f0:
0x3eaa950: i32,ch = LWZ 0x3ea4b08, 0x3eac1a0, 0x3e7e2f0Mem:LD4[%b+8] [ORD=6]

0x3eac3b0:
0x3eac1a0:
0x3e7e2f0:
0x3ea7648: i32,ch = LWZ 0x3eac3b0, 0x3eac1a0, 0x3e7e2f0Mem:LD4[%a+8] [ORD=5]

0x3ea4b08:
0x3ea4c10:
0x3e7e2f0:
0x3eab190: i32,ch = LWZ 0x3ea4b08, 0x3ea4c10, 0x3e7e2f0Mem:LD4[%b+4] [ORD=6]

0x3eac3b0:
0x3ea4c10:
0x3e7e2f0:
0x3ea7b70: i32,ch = LWZ 0x3eac3b0, 0x3ea4c10, 0x3e7e2f0Mem:LD4[%a+4] [ORD=5]

0x3eac3b0:
0x3ea8d60:
0x3e7e2f0:
0x3ea7540: i32,ch = LWZ 0x3eac3b0, 0x3ea8d60, 0x3e7e2f0Mem:LD4[%a+12] [ORD=5]

0x3ea4b08:
0x3ea8d60:
0x3e7e2f0:
0x3ea9288: i32,ch = LWZ 0x3ea4b08, 0x3ea8d60, 0x3e7e2f0Mem:LD4[%b+12] [ORD=6]

0x3ea8520:
0x3ea7b70:
0x3ea7648:
0x3ea7540:
0x3eab3a0:
0x3eab190:
0x3eaa950:
0x3ea9288:
0x3ea7a68: ch = TokenFactor 0x3ea8520:1, 0x3ea7b70:1, 0x3ea7648:1, 0x3ea7540:1, 0x3eab3a0:1, 0x3eab190:1, 0x3eaa950:1, 0x3ea9288:1 [ORD=8]

0x3ea8520:
0x3eab3a0:
0x3eab4a8: i32 = ADD 0x3ea8520, 0x3eab3a0 [ORD=7]

0x3ea7228:
0x3ea48f8:
0x3ea7a68:
0x3eac5c0: ch = SW 0x3eab4a8, 0x3ea7228, 0x3ea48f8, 0x3ea7a68Mem:ST4[%z] [ORD=8]

0x3ea7b70:
0x3eab190:
0x3eab298: i32 = ADD 0x3ea7b70, 0x3eab190 [ORD=7]

0x3ea7228:
0x3ea4c10:
0x3ea7a68:
0x3eac4b8: ch = SW 0x3eab298, 0x3ea7228, 0x3ea4c10, 0x3ea7a68Mem:ST4[%z+4] [ORD=8]

0x3ea7648:
0x3eaa950:
0x3eaaa58: i32 = ADD 0x3ea7648, 0x3eaa950 [ORD=7]

0x3ea7228:
0x3eac1a0:
0x3ea7a68:
0x3eabf90: ch = SW 0x3eaaa58, 0x3ea7228, 0x3eac1a0, 0x3ea7a68Mem:ST4[%z+8] [ORD=8]

0x3ea7540:
0x3ea9288:
0x3ea9390: i32 = ADD 0x3ea7540, 0x3ea9288 [ORD=7]

0x3ea7228:
0x3ea8d60:
0x3ea7a68:
0x3eabe88: ch = SW 0x3ea9390, 0x3ea7228, 0x3ea8d60, 0x3ea7a68Mem:ST4[%z+12] [ORD=8]

0x3eabb70: ch = TokenFactor 0x3eac5c0, 0x3eac4b8, 0x3eabf90, 0x3eabe88 [ORD=8]

0x3ea4e20:
0x3ea48f8:
0x3ea44d8: i32 = MOVHI 0x3ea48f8

0x3ea4f28: ch,glue = CopyToReg 0x3eabb70, 0x3ea4e20, 0x3ea44d8 [ORD=9]

0x3ea7228: i32 = TargetFrameIndex<0>

0x3ea8d60: i32 = TargetConstant<12>

0x3ea48f8: i32 = TargetConstant<0>

0x3ea4c10: i32 = TargetConstant<4>

0x3eac1a0: i32 = TargetConstant<8>

0x3ea4b08: i32 = TargetFrameIndex<2>

0x3eac3b0: i32 = TargetFrameIndex<1>

0x3ea4e20:
0x3ea4f28:
0x3ea4f28:
0x3ea5030: ch = RET 0x3ea4e20, 0x3ea4f28, 0x3ea4f28:1 [ORD=9]

Total amount of phi nodes to update: 0
*** MachineFunction at end of ISel ***

Machine code for function main: SSA

Frame Objects:
fi#0: size=16, align=4, at location [SP]
fi#1: size=16, align=4, at location [SP]
fi#2: size=16, align=4, at location [SP]

BB#0: derived from LLVM BB %entry
%vreg0 = LWZ <fi#2>, 12; mem:LD4[%b+12] GPR:%vreg0
%vreg1 = LWZ <fi#1>, 12; mem:LD4[%a+12] GPR:%vreg1
%vreg2 = ADD %vreg1, %vreg0; GPR:%vreg2,%vreg1,%vreg0
%vreg3 = LWZ <fi#2>, 0; mem:LD4[%b] GPR:%vreg3
%vreg4 = LWZ <fi#1>, 0; mem:LD4[%a] GPR:%vreg4
%vreg5 = LWZ <fi#2>, 4; mem:LD4[%b+4] GPR:%vreg5
%vreg6 = LWZ <fi#1>, 4; mem:LD4[%a+4] GPR:%vreg6
%vreg7 = LWZ <fi#2>, 8; mem:LD4[%b+8] GPR:%vreg7
%vreg8 = LWZ <fi#1>, 8; mem:LD4[%a+8] GPR:%vreg8
SW %vreg2, <fi#0>, 12; mem:ST4[%z+12] GPR:%vreg2
%vreg9 = ADD %vreg8, %vreg7; GPR:%vreg9,%vreg8,%vreg7
SW %vreg9, <fi#0>, 8; mem:ST4[%z+8] GPR:%vreg9
%vreg10 = ADD %vreg6, %vreg5; GPR:%vreg10,%vreg6,%vreg5
SW %vreg10, <fi#0>, 4; mem:ST4[%z+4] GPR:%vreg10
%vreg11 = ADD %vreg4, %vreg3; GPR:%vreg11,%vreg4,%vreg3
SW %vreg11, <fi#0>, 0; mem:ST4[%z] GPR:%vreg11
%vreg12 = MOVHI 0; GPR:%vreg12
%R11 = COPY %vreg12; GPR:%vreg12
RET %R11

End machine code for function main.

Make sure that there is a register class associated with v4i32.

See TargetLoweringBase::addRegisterClass. It's generally called in <target>ISelLowering.cpp.

-Krzysztof

Thanks, it worked! I've been at it for the past 3 weeks. Really appreciate
the help.

I'd like to ask you another question (if you don't mind). My
EsenciaISelLowering.cpp contains the following code in the
EsenciaTargetLowering class constructor:

  setOperationAction(ISD::BR_CC, MVT::i32, Custom);
  setOperationAction(ISD::BR_CC, MVT::f32, Custom);
  setOperationAction(ISD::BR_JT, MVT::Other, Expand);
  setOperationAction(ISD::BRCOND, MVT::Other, Expand);
  setOperationAction(ISD::SETCC, MVT::i32, Expand);
  setOperationAction(ISD::SETCC, MVT::f32, Expand);
  setOperationAction(ISD::SELECT, MVT::i32, Expand);
  setOperationAction(ISD::SELECT, MVT::f32, Expand);
  setOperationAction(ISD::SELECT_CC, MVT::i32, Custom);
  setOperationAction(ISD::SELECT_CC, MVT::f32, Custom);

I sort of have an intuition what it is doing, but quite nail it.Do you mind
explaining it? Also I didn't add any of the setOperationAction for the
MVT::v4i32 and my simple test case worked. How come?

This tells the legalizer how to treat various operations with given types. What the type is of, somewhat depends on the operation. You can look in lib/CodeGen/SelectionDAG/LegalizeDAG.cpp, in function SelectionDAGLegalize::LegalizeOp, to see where the type comes from. That's where the actions are being looked up.

If the action is "Legal", then there is nothing to be done with it, since it's already considered legal. If the action is "Expand", which will convert the operation into some sort of a generic expansion which will either be legal or will be legalized further. A "Custom" action causes the legalizer to call LowerOperation in target's ISel lowering class. That function will then be responsible for generating the target-specific code for this operation.

-Krzysztof

Unfinished edit. Should be

If the action is "Expand", the legalizer will replace the operation with...

-Krzysztof

If the action is "Expand", which will convert the operation into

Unfinished edit. Should be

If the action is "Expand", the legalizer will replace the operation with...

I think this is still unfinished :slight_smile:

Only this part of the sentence needed more work, but ok, here's the whole thing:

If the action is "Expand", the legalizer will replace the operation with some sort of a generic expansion which will either be legal or will be legalized further.

There. :slight_smile:

-Krzysztof

        If the action is "Expand", which will convert the operation into

    Unfinished edit. Should be

    If the action is "Expand", the legalizer will replace the operation
    with...

I think this is still unfinished :slight_smile:

Only this part of the sentence needed more work, but ok, here's the whole
thing:

If the action is "Expand", the legalizer will replace the operation with
some sort of a generic expansion which will either be legal or will be
legalized further.

Given that the action is "Expand" how does legalizer know which replacement
to use for a given operation?

It's pretty random, and the only way to be sure is to read
LegalizeDAG.cpp. The two basic variants are:

  + Check whether the intended opcode is Legal, use that if possible,
otherwise keep trying until you run out of ideas.
  + Expand it to something, legal or not. Then that node will be
expanded in turn.

Obviously neither is guaranteed to terminate in a legal node (for
example you could set absolutely everything to Expand in which case
there's no solution).

These heuristics tend to cover the common cases, but most targets need
to mark at least a few nodes as Custom and handle them manually.

Cheers.

Tim.

It's pretty much all hardcoded. A more complex operation is rewritten in terms of simpler operations, which are more likely to be legal.
Look in SelectionDAGLegalize::ExpandNode to see what happens in each case.

-Krzysztof

I see. Thanks!

Thanks!