Compiler Design Gate Smashers [ Full HD ]
The compiler stops working on source code and starts working on IR.
Three Address Code (TAC): t1 = b * c, t2 = a + t1.
Gate Smashers Tricks:
Hot GATE Topic: Syntax Trees vs. DAG (Directed Acyclic Graph).
Gate Smashers doesn't teach irrelevant theory. They focus on what has appeared in GATE papers from 1990 to 2024. If a concept hasn't been asked in a decade, they skip it. This is crucial for Compiler Design, where the syllabus intersects significantly with Theory of Computation. compiler design gate smashers
From analyzing past 10 years (GATE CS):
| Topic | Weight (approx) | Important Subtopics | | :--- | :--- | :--- | | Parsing (LR items, SLR/CLR) | 4–5 marks | LR(0) DFA, Shift-reduce conflicts, FOLLOW sets for SLR | | First & Follow + LL(1) | 2–3 marks | Predictive parsing table, First/Follow calculation | | Intermediate Code | 2 marks | TAC generation, Quadruples, Triples | | Syntax Directed Translation | 2 marks | SDT for expressions, declarations | | Runtime Environment | 1–2 marks | Activation record, stack vs heap | | Lexical Analysis | 1–2 marks | DFA minimization, Token count |
Imagine you have this simple code:
if (x > 0)
y = 10;
else
y = 20;
A standard compiler creates a branch (a gate):
A "Gate Smasher" compiler optimization transforms this into a single stream of instructions without jumps:
The Optimized Assembly (Conceptual):
CMP x, 0 ; Compare x to 0
MOV eax, 10 ; Load 10 into register
MOV ebx, 20 ; Load 20 into register
CMOVG eax, ebx ; Conditionally move ebx to eax if Greater
By using CMOV, the compiler has "smashed" the branch. The CPU pipeline never stalls because there is no jump to predict. It simply calculates the data and selects the result on the fly.
Here is a phased breakdown of the syllabus, exactly how a "Gate Smashers" follower would approach it.