intel/compiler: Fix pointer arithmetic when reading shader assembly
[mesa.git] / src / intel / compiler / brw_fs_live_variables.h
index 65220f58d3053de01874e155ffdc393e6e98660e..5661c102eeb0befde2e39fa265592af72ef512be 100644 (file)
 #ifndef BRW_FS_LIVE_VARIABLES_H
 #define BRW_FS_LIVE_VARIABLES_H
 
+#include "brw_ir_analysis.h"
 #include "brw_ir_fs.h"
 #include "util/bitset.h"
 
 struct cfg_t;
-class fs_visitor;
+struct backend_shader;
 
 namespace brw {
 
@@ -76,12 +77,21 @@ public:
       BITSET_WORD flag_liveout[1];
    };
 
-   DECLARE_RALLOC_CXX_OPERATORS(fs_live_variables)
-
-   fs_live_variables(fs_visitor *v, const cfg_t *cfg);
+   fs_live_variables(const backend_shader *s);
    ~fs_live_variables();
 
+   bool validate(const backend_shader *s) const;
+
+   analysis_dependency_class
+   dependency_class() const
+   {
+      return (DEPENDENCY_INSTRUCTION_IDENTITY |
+              DEPENDENCY_INSTRUCTION_DATA_FLOW |
+              DEPENDENCY_VARIABLES);
+   }
+
    bool vars_interfere(int a, int b) const;
+   bool vgrfs_interfere(int a, int b) const;
    int var_from_reg(const fs_reg &reg) const
    {
       return var_from_vgrf[reg.nr] + reg.offset / REG_SIZE;
@@ -110,22 +120,27 @@ public:
    int *end;
    /** @} */
 
+   /** @{
+    * Final computed live ranges for each VGRF.
+    */
+   int *vgrf_start;
+   int *vgrf_end;
+   /** @} */
+
    /** Per-basic-block information on live variables */
    struct block_data *block_data;
 
 protected:
    void setup_def_use();
-   void setup_one_read(struct block_data *bd, fs_inst *inst, int ip,
-                       const fs_reg &reg);
+   void setup_one_read(struct block_data *bd, int ip, const fs_reg &reg);
    void setup_one_write(struct block_data *bd, fs_inst *inst, int ip,
                         const fs_reg &reg);
    void compute_live_variables();
    void compute_start_end();
 
-   fs_visitor *v;
+   const struct gen_device_info *devinfo;
    const cfg_t *cfg;
    void *mem_ctx;
-
 };
 
 } /* namespace brw */