From 693173feefaa326fad0e386470846fb3199ba381 Mon Sep 17 00:00:00 2001
From: Chris Lattner
Alias processing if the phase that canonicalizes different lexical forms of +
Alias processing is the phase that canonicalizes different lexical forms of the same instructions down to one representation. There are several different kinds of alias that are possible to implement and they are listed below in the order that they are processed (which is in order from simplest/weakest to most @@ -1911,7 +1911,7 @@ description.
The first phase of alias processing is simple instruction mneomonic remapping for classes of instructions which are allowed with two different -mneomonics. This phase is a simple and unconditionally remapping from one input +mnemonics. This phase is a simple and unconditionally remapping from one input mnemonic to one output mnemonic. It isn't possible for this form of alias to look at the operands at all, so the remapping must apply for all forms of a given mnemonic. Mnemonic aliases are defined simply, for example X86 has: @@ -1928,7 +1928,19 @@ def : MnemonicAlias<"ud2a", "ud2">;
... and many others. With a MnemonicAlias definition, the mnemonic is -remapped simply and directly.
+remapped simply and directly. Though MnemonicAlias's can't look at any aspect +of the instruction (such as the operands) they can depend on global modes (the +same ones supported by the matcher), through a Requires clause: + ++def : MnemonicAlias<"pushf", "pushfq">, Requires<[In64BitMode]>; +def : MnemonicAlias<"pushf", "pushfl">, Requires<[In32BitMode]>; ++
In this example, the mnemonic gets mapped into different a new one depending +on the current instruction set.
-- cgit v1.2.3-70-g09d2