David Goodwin
2009-Jun-26 23:25 UTC
[LLVMdev] "icmp eq", "icmp ne" not commuting operands on ARM
NE and EQ comparisons should be able to commute their operands. But, for ARM at least, this does not seem to be happening. The first sequence below generates CMN (compare negated) but the second does not (complete test attached). These seem to map to ARMcmpNZ. Where would I look to see if that is marked commutative? %nb = sub i32 0, %b %tmp = icmp ne i32 %a, %nb %nb = sub i32 0, %b %tmp = icmp ne i32 %nb, %a David -------------- next part -------------- A non-text attachment was scrubbed... Name: thumb2-cmn.ll Type: application/octet-stream Size: 526 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090626/783a00c4/attachment.obj> -------------- next part --------------
Evan Cheng
2009-Jun-27 00:16 UTC
[LLVMdev] "icmp eq", "icmp ne" not commuting operands on ARM
David and I talked off line. He's going to fix it. Evan On Jun 26, 2009, at 4:25 PM, David Goodwin wrote:> NE and EQ comparisons should be able to commute their operands. But, > for ARM at least, this does not seem to be happening. The first > sequence below generates CMN (compare negated) but the second does > not (complete test attached). These seem to map to ARMcmpNZ. Where > would I look to see if that is marked commutative? > > %nb = sub i32 0, %b > %tmp = icmp ne i32 %a, %nb > > %nb = sub i32 0, %b > %tmp = icmp ne i32 %nb, %a > > David > > <thumb2-cmn.ll> > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev