[AArch64] Add a comment to make it explicit why we increased the complexity.
authorQuentin Colombet <qcolombet@apple.com>
Thu, 2 Apr 2015 18:54:23 +0000 (18:54 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Thu, 2 Apr 2015 18:54:23 +0000 (18:54 +0000)
Follow-up of r233653.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233936 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AArch64/AArch64InstrFormats.td

index 555b5006ebac759ecd46a0bd4c070a7609d658ae..0e457329f73558f8a75a9c1a99c528952821a5a9 100644 (file)
@@ -1637,6 +1637,10 @@ multiclass AddSub<bit isSub, string mnemonic,
                   SDPatternOperator OpNode = null_frag> {
   let hasSideEffects = 0, isReMaterializable = 1, isAsCheapAsAMove = 1 in {
   // Add/Subtract immediate
+  // Increase the weight of the immediate variant to try to match it before
+  // the extended register variant.
+  // We used to match the register variant before the immediate when the
+  // register argument could be implicitly zero-extended.
   let AddedComplexity = 6 in
   def Wri  : BaseAddSubImm<isSub, 0, GPR32sp, GPR32sp, addsub_shifted_imm32,
                            mnemonic, OpNode> {